You need to sign in to do that
Don't have an account?
ankush
Jquery to check a particular value of picklist and update
I have a scenario where a custom button updates the value of picklist to a particular value when ever the button is clicked. The code was working fine. But had another requirement to have this custom button only work when the picklist values are not any value for two particular values. Hence I used the if condition but it is not working. Can some one guide me where I am going wrong.
Withouth the line in bold it is working for all picklist values but as informed above if I want to work only for particular two picklist I tried the statement in bold which is not updating anything.
{!requireScript("/soap/ajax/32.0/connection.js")}
var er = new sforce.SObject("FC_Reviewer__External_Review__c");
er.id = "{!FC_Reviewer__External_Review__c.Id}";
if(er.FC_Reviewer__Status__c == "Ready To Review" || er.FC_Reviewer__Status__c== "Review In Progress")
er.FC_Reviewer__Status__c="Review Submitted";
result = sforce.connection.update([er]);
window.location.reload();
Withouth the line in bold it is working for all picklist values but as informed above if I want to work only for particular two picklist I tried the statement in bold which is not updating anything.
{!requireScript("/soap/ajax/32.0/connection.js")}
var er = new sforce.SObject("FC_Reviewer__External_Review__c");
er.id = "{!FC_Reviewer__External_Review__c.Id}";
if(er.FC_Reviewer__Status__c == "Ready To Review" || er.FC_Reviewer__Status__c== "Review In Progress")
er.FC_Reviewer__Status__c="Review Submitted";
result = sforce.connection.update([er]);
window.location.reload();
You need to query first, like code may be this work in your org...
If this answers your question mark Best Answer it as solution and then hit Like!
Thanks for the help and guidance but no update is happening yet even after we click the button the picklist value is not getting changed.