You need to sign in to do that
Don't have an account?
TimS
Help with javascript button code to check field for empty value
Using a custom button as written below to set value of a custom object (Request__c) picklist field (Status__c) to "Rejected." Need to modify so it validates any value has been entered in another picklist field (Reject_Reason__c). If no value is selected in Reject_Reason__c, then alert needs to appear instructing user to select a value and status field is NOT updated to "Rejected," as Status__c should only be set to "Rejected" if any value has been selected in Reject_Reason__c.
{!requireScript("/soap/ajax/26.0/connection.js")}
var request = new sforce.SObject("Request__c");
request.id = "{!Request__c.Id}"
request.Status__c = 'Rejected';
sforce.connection.update([request]);
window.location.reload(); //to reload the window and show the updated values
I've tried modifying but to no end as I am not vered in javascript at all. Anyone's assistance would be greatly appreciated! Thanks!
{!requireScript("/soap/ajax/26.0/connection.js")}
var request = new sforce.SObject("Request__c");
request.id = "{!Request__c.Id}"
request.Status__c = 'Rejected';
sforce.connection.update([request]);
window.location.reload(); //to reload the window and show the updated values
I've tried modifying but to no end as I am not vered in javascript at all. Anyone's assistance would be greatly appreciated! Thanks!
Here's one (of a few ways) to do what you're asking:
All Answers
Here's one (of a few ways) to do what you're asking: