RE: How to increment sequence number on other entity "B" when record is saved on entity "A".How can i achieve this
Hi Sandy,
The flow can achieve it, here are steps:
In my example, custom(A) entity and test(B) entity have no relationship
1.Go Power Automate(https://us.flow.microsoft.com/en-us/ ) to create an Automated flow.
2.Create the Trigger event – in this case I have set the trigger to fire when a custom record is created.
2.Add ‘List records’ step, Retrieve one test record with a most recent Created On date value.
3.Add ‘compose’ step to get seqno value from ‘List records’ step.
Once you do this and fill in the fields, Flow takes care of the Apply to each loop. So don’t get confused by this and look for a Apply to each. You don’t need to do this.
4.In ‘Apply to each’ step, add ‘condition’ step to check seqno value is null or not.
(1) In ‘Yes’ branch,
Add ‘Compose’ step to convert seqno value to int and add 1.
Add ‘create a new record’ and fill seqno field with the value of ‘compose2’ step.
(2) In ‘No’ branch, add ‘create a new record’, fill seqno field with the 500000 value.
5.Save and test the flow.
The following is the overview of the flow:
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.