0

I need a Flow triggered when a new 'Placement__c' record is created using a Quick Action.

We use Person Accounts and a custom object called 'Placements'. It's a one to many relationships, so one Account can have many Placements. As an Account gets 2 or 3 Placements, most of the information needs to stay the same as the previous Placement. When a Placement is created (through a Quick Action on the Opportunity) there is currently a Process which invokes 4 other processes which populate information on the record.

That is working fine, the issue is when an Account gets Re-Placed (another Placement needs to be created), we need most of the information from the previous one to also be on the new 'Placement' such as checkbox values and picklist fields.

Is it possible for Flow to choose the previous Placement record from the Account and retrieve information to populate the new Placement? Essentially I just want Salesforce to choose the first child record to populate the new Placement upon creation if a Placement already exists on the Account -else, continue to create a new Placement. How would I go about achieving this?

1

You can use "Get Records" to retrieve the placements using as filter the account lookup field equal to the selected Account Id.

UPDATE:

You can trigger it using Process Builder or a trigger based on the record update

  • How would I trigger the flow to check this? How do I trigger it to run when record is saved? – Natasha Ali Nov 11 at 10:59
  • updated the answer – Christian Croce Nov 11 at 11:02
0

Is it possible for Flow to choose the previous Placement record from the Account and retrieve information to populate the new Placement? Essentially I just want Salesforce to choose the first child record to populate the new Placement upon creation if a Placement already exists on the Account -else, continue to create a new Placement. How would I go about achieving this?

  • Given that the Flow is triggered by some DML action on Account (say, via Process Builder)

  • Then, the Flow can be passed from ProcessBuilder the AccountId (make this an input variable in the Flow)

  • The Flow GetRecords element has no explicit context about "previous" but it can query all children of the Account (the Placement children) and return them in sorted order by Created Date. (Sort descending to get most recent which would be "previous" as I understand your OP)

You can also get the count of the number of children using an Assignment element and the equals Count operator so you can find out how many children there are

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.