You need to sign in to do that
Don't have an account?
balakrishna mandula 6
Picklist field in formula expression
Hi,
I have two picklist fileds called Approval Status with Values "Committed, Approved" and Proposal Type with values "Quote and Order" on same object.
And I have custom button called Convert To Order on detail page, if I click on Convert to Order but it should check with Approval Status field if it is having field value is Approved then Proposal Type should be changed to Order value.
for this I have created a custom button and added JavaScript OnClick event as below.
{!IF( ISPICKVAL( Custom_Object__c.Approval_Status__c , 'Approved'),
TEXT( Custom_Object__c.Proposal_Type__c )='Order' ,'Quote')}
But it's not working when I click the button
I have two picklist fileds called Approval Status with Values "Committed, Approved" and Proposal Type with values "Quote and Order" on same object.
And I have custom button called Convert To Order on detail page, if I click on Convert to Order but it should check with Approval Status field if it is having field value is Approved then Proposal Type should be changed to Order value.
for this I have created a custom button and added JavaScript OnClick event as below.
{!IF( ISPICKVAL( Custom_Object__c.Approval_Status__c , 'Approved'),
TEXT( Custom_Object__c.Proposal_Type__c )='Order' ,'Quote')}
But it's not working when I click the button
{!REQUIRESCRIPT('/soap/ajax/27.0/connection.js')}
var acct = new sforce.SObject('Account');
acct.Id = "{!Account.Id}";
acct.Approval_Status__c = "{!Account.Approval_Status__c}";
if(acct.Approval_Status__c == 'Approved')
acct.Proposal_Type__c = 'Order';
else
acct.Proposal_Type__c = 'Quote';
sforce.connection.update([acct]);
window.location.reload();
All Answers
{!REQUIRESCRIPT('/soap/ajax/27.0/connection.js')}
var acct = new sforce.SObject('Account');
acct.Id = "{!Account.Id}";
acct.Approval_Status__c = "{!Account.Approval_Status__c}";
if(acct.Approval_Status__c == 'Approved')
acct.Proposal_Type__c = 'Order';
else
acct.Proposal_Type__c = 'Quote';
sforce.connection.update([acct]);
window.location.reload();