You need to sign in to do that
Don't have an account?
User 444
Can we call two different vf pages from custom button in salesforce using two different conditions, if yes how?
0
I am calling a vf page from a custom button if it meets a particular condition, but now I want to call another vf page if condition changes. Is it possible? and how to do it?
In below code, I want selected product = "anytwo"( if any two of T1, T2, T3 are active) condition displaying /apex/AP_productSelectionPage.(another vf page)
My code as of now displaying only one vf page:
/apex/AP_AgencySelectionPage?contactId={!Contact.Id}&selectionType=Register_Agency& selectedProduct={! if( and(Contact.IsT1Active__c,Contact.IsT2Active__c,!Contact.IsT3Active__c ), 'T3', if( and(Contact.IsT2Active__c,!Contact.IsT1Active__c,Contact.IsT3Active__c ), 'T1', if( and(!Contact.IsT2Active__c,Contact.IsT1Active__c,Contact.IsT3Active__c ), 'T2', if( and(!Contact.IsT2Active__c,Contact.IsT1Active__c,!Contact.IsT3Active__c ), 'T2', if( and(!Contact.IsT2Active__c,!Contact.IsT1Active__c,Contact.Ist3Active__c ), 'T1', if( and(Contact.IsT2Active__c,!Contact.IsT1Active__c,!Contact.IsT3Active__c ), 'T1' , if( and(Contact.IsT2Active__c,Contact.IsT1Active__c,Contact.IsT3Active__c ), 'Allthree' )))
I am calling a vf page from a custom button if it meets a particular condition, but now I want to call another vf page if condition changes. Is it possible? and how to do it?
In below code, I want selected product = "anytwo"( if any two of T1, T2, T3 are active) condition displaying /apex/AP_productSelectionPage.(another vf page)
My code as of now displaying only one vf page:
/apex/AP_AgencySelectionPage?contactId={!Contact.Id}&selectionType=Register_Agency& selectedProduct={! if( and(Contact.IsT1Active__c,Contact.IsT2Active__c,!Contact.IsT3Active__c ), 'T3', if( and(Contact.IsT2Active__c,!Contact.IsT1Active__c,Contact.IsT3Active__c ), 'T1', if( and(!Contact.IsT2Active__c,Contact.IsT1Active__c,Contact.IsT3Active__c ), 'T2', if( and(!Contact.IsT2Active__c,Contact.IsT1Active__c,!Contact.IsT3Active__c ), 'T2', if( and(!Contact.IsT2Active__c,!Contact.IsT1Active__c,Contact.Ist3Active__c ), 'T1', if( and(Contact.IsT2Active__c,!Contact.IsT1Active__c,!Contact.IsT3Active__c ), 'T1' , if( and(Contact.IsT2Active__c,Contact.IsT1Active__c,Contact.IsT3Active__c ), 'Allthree' )))
Can you check if the below question is similar what you are looking for . If so please check the answer for the same.
https://developer.salesforce.com/forums/?id=9060G000000MSMsQAO
If this solution helps, Please mark it as best answer.
Thanks,