• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 614
  • Last Modified:

Need help with a script for hiding fields

Hi Experts,

I used a script that I got help with on Experts Exchange to create the attached.

It works well except for the last part.

Once the record has been entered, when I go to reopen the record I want both fields to show if the vsc_billtoid field is ‘New Customer Please Add’. The only time it works is if I click the vsc_newbilltoinfo check box and then click it again. Otherwise, it doesn’t work when the form is reopened.

What did I do wrong? The original script you provided works perfectly and I thought I would be able to use it to create this one. I am not getting any error messages.
SetNewBillToControlInvisible.txt
0
jlblanke
Asked:
jlblanke
  • 4
  • 2
1 Solution
 
Chinmay PatelEnterprise ArchitectCommented:
Hi jblanke,

It is a known behavior of CRM. To override it you can use this article
http://mscrmblogger.com/2011/02/24/crm-2011-toggle-visibility/

Let me know if you face any challenges.

Regards,
Chinmay.
0
 
jlblankeAuthor Commented:
Thanks for the reference! :)

I added the registerToggle code (attached) to the form's OnLoad event. Now I am getting an error:

There was an error with this field's customized event.

Field: window
Event: onload
Error: 'vsc_newbilltoinfo' is undefined
registerToggle.txt
0
 
Chinmay PatelEnterprise ArchitectCommented:
don't modify the existing script and add it as a separate web resource and in the page_load

write

registerToggle("c", "vsc_newbilltoinfo", "targetcontrolname");  

Open in new window


Replace targetcontrolname with appropriate value.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
jlblankeAuthor Commented:
I created the onload based on your example and the link you gave me and am getting window onload error:

The value of the property 'registerToggle' is null or undefined, not a Function object.

The Microsoft Dynamics CRM Error Report indicated the error at Line 1: Expected identifier.

I used the IE F12 debugger but there are no errors showing.

Attached is my code.
registerToggle.txt
0
 
jlblankeAuthor Commented:
Got it working. There was a conflict with another script.
0
 
jlblankeAuthor Commented:
I did not need to use the registertoggle script. There was another script that was calling this field. I was able to modify the first script and delete the second.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now