cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JasonHoffo
Frequent Visitor

Flows in Model Driven Apps

I need a flow to run on Save & Close on a model driven app

 

So I looked at business Rule -> I can create the rule as an entity , but i want to update another entity with data when Save & Close has been pressed. 

I have checked Calculated column and this doesn't offer much help 

Or do i need to create an Power Automate flow to do this and then update another entity on CDS ? 

 

Thanks, Jason 

 

 

6 REPLIES 6
Johnnyg
Community Support
Community Support

Hi Jason,

Yes, you could use Power Automate to update another CDS entity data as D365 business rule is mainly used to update fields in the main entity. 

Please inform us if you have any further questions on it.

 

Best Regards,
Johnny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GarethPrisk
Resident Rockstar
Resident Rockstar

In order to avoid confusion, the entity/record being saved will be referred to as CurrentRecord, and the other will be OtherRecord.

A couple of questions/notes:

  • How are CurrentRecord and OtherRecord related?
    • If OtherRecord exists already, and is a CurrentRecord lookup (N:1) , then you can consider a synchronous CDS workflow
    • If OtherRecord is a CurrentRecord child record (1:N), then you will need Flow
    • If OtherRecord and CurrentRecord aren't related, then you will need Flow and a way to identify OtherRecord
  • Save & Close is shown in MDAs for both new and existing records
    • Are you expecting it when CurrentRecord is created? Updated? Both?
    • NOTE: If CurrentRecord exists, then Save (and also auto-save) will also trigger the process if configured for update of CurrentRecord
  • Can you elaborate on what you expect the process to do?
    • Beyond "update another entity with data"
    • What are you looking to do/accomplish? This is mostly so we can understand if other options exist

 

chinven111
Frequent Visitor

we also have similiar requirement to update the custom invoice main screen grant total with all the line details screen total amount. How can we achieve this? Appreciate if anyone can advice us, thanks!

ArchitectMadhan
Super User
Super User

Hi @JasonHoffo ,

 

You can have a field called UpdateEntityB (Yes/No type) in Entity A, Set the value to the field UpdateEntityB as "Yes" or "No" on click of "Save and Close" using business rule or thru JavaScript. Now, create a "Automated Cloud Flow" and in the Trigger Condition of "Item created or modified", use the UpdateEntityB value equals to Yes. Now you can update your Entity B fields by fetching the reference of current record in Entity A.

 

If you find my solution helpful for resolving the issue, then please consider Accept it as the solution to help the other members find it more quickly.

- Architect Madhan

Please click the "Accept as Solution" button and give thumbs up, if it is helpful to you.

Hi, thanks for the suggestion. Can I check if we can create an event for the custom main when user clicks on the Save button? My worry is going through flow it might take some times for the amount to be updated in the mail form. Is there any existing library or js script that we can make use of for this? Appreciate your advice, thanks

ArchitectMadhan
Super User
Super User

@chinven111 ,

Could you create a new post there we can discuss about your issue? Because your case and Jason's case are bit different. If I answer for your scenario here, it would be misleading.

 

- Architect Madhan

Please click the "Accept as Solution" button and give thumbs up, if it is helpful to you.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,784)