You need to sign in to do that
Don't have an account?

Button to check checkbox- need help with JS
All i'm trying to create a detail button that when clicked checks a checkbox. I found some java script in one of the forums for this purpose, but am having trouble making it work. I get an error "Cannot set property AECaseMgmt__Program_Case__c.Generate_Closing_Summary__c of undefined." Any ideas? Thanks.
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} var newRecords = []; var c = new sforce.SObject("AECaseMgmt__Program_Case__c"); c.id ="{!AECaseMgmt__Program_Case__c.Name}"; c.AECaseMgmt__Program_Case__c.Generate_Closing_Summary__c = true; newRecords.push(c); result = sforce.connection.update(newRecords); window.location.reload();
//If you want to update same record
This should work for you.
Regards
Medhya Mahajan
All Answers
change Line 4 to
c.id ="{!AECaseMgmt__Program_Case__c.Id}";
That should solve it. Let me know if you are still facing issues
Try this:
Hope this helps.
Regards
Medhya Mahajan
I'm still having trouble making this work. I made the suggested changes and I still get the error: "Cannot set property AECaseMgmt__Program_Case__c.Generate_Closing_Summary__c of undefined"
Does this mean that its not finding the Program Case SObject?
Thanks advance for anymore help/suggestions you can offer.
As mentioned above please try changing the line :
c.AECaseMgmt__Program_Case__c.Generate_Closing_Summary__c = true;
to
c.AECaseMgmt__Program_Case__r.Generate_Closing_Summary__c = true;
Mark as solved if it helps.
Regards
Medhya Mahajan
"Cannot set property 'Generate_Closing_Summary__c' of undefined"
Any other thoughts? I appreciate your help.
//If you want to update same record
This should work for you.
Regards
Medhya Mahajan