Skip to main content
Hello All,

I have a requirement to create a custom button called "Create Quote" on  Quote related list of Opportunity page based on a condition.

We have a custom picklist field called Pricing_Model__c on Opportunity.

If the value of Pricing_Model is Platform, the new button should redirect to a flow.

If the value of Pricing_Model__c is any other vaue, the new Create quote button should be able to create quotes just like standard functionality with pre-populated values of Opportunity and Account details.

I am able to achieve this condition separately. However if I put the same in an IF condition, somehow its not working.

Please go through the below code and help me:

​​​​​​{!IF( ISPICKVAL( Opportunity.Pricing_Model__c , 'Platform') ,

URLFOR('/flow/Test_Main_Flow'),

('/lightning/o/Quote/new?defaultFieldValues=OpportunityId={!Opportunity.Id},AccountId={!Opportunity.AccountId},BillingName={!Opportunity.Account},ShippingName={!Opportunity.Account},BillingAddress={!Account.BillingAddress},BillingCountryCode={!Account.BillingCountryCode},BillingStateCode={!Account.BillingStateCode},BillingState={!Account.BillingState},BillingCity={!Account.BillingCity},BillingStreet={!Account.BillingStreet},BillingPostalCode={!Account.BillingPostalCode}ShippingAddress={!Account.ShippingAddress},ShippingCountryCode={!Account.ShippingCountryCode},ShippingStateCode={!Account.ShippingStateCode},ShippingState={!Account.ShippingState},ShippingCity={!Account.ShippingCity},ShippingStreet={!Account.ShippingStreet},ShippingPostalCode={!Account.ShippingPostalCode}')

)

}
1 resposta
0/9000