0

I have a custom button which sits on a Contact that launches a Visual Flow. If the Account relating to the Contact has an Account Record Type of 'Merchant' then I want the Flow to run as normal. If the Account relating to the Flow has any other record type I want a different Flow to run but by launching from the same button. I have a formula which pulls the Account record type id to to a custom field on card record called 'Account record ID'

I want to do this through an IF statement within the Button. IF RecordTypeID is'0001234' then launch /apex/Complaints_Flow_Contacts?ContactID={!Contact.Id} Else launch /apex/ComplaintsFlow?LinkToCard={!AMEX_Card__c.Id} (which is a different button).

Is this possible to do within a button?

2 Answers 2

1

Another option is to introduce a subflow call within your 'primary' flow. Pass the record type of the record into the flow as a variable first by using a URL variable pass like this:

/flow/Your_Flow?vRecordTypeID={!YourObject.RecordTypeID}

Then, introduce a check in the primary flow for the value of that parameter. If it meets your requirement (ie. merchant type), it routes to the subflow alternative (drag the alternative flow onto the pallete as a subflow, remembering to pass through any required parameters as output variables).

This way the logic to split the flow is embedded in the flow, not the button.

0

The easiest way would be to just create 2 different buttons - each leading to a different flow - and 2 page layouts (one for every record type). Then display the correct button on the resp. page layout. No need for the 'Account record ID' custom field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.