Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Set field value on another table automatically after record creation

Posted on by 873

Hello everyone,

I have two custom tables:

- Project Resource Table (1:N)-> Schedule table.

The lookup column that is associated with the project resource table in the schedule table is the below Project Resource ID field:

Schedule-Table.PNGSchedule-Table-Rel.PNG
What I want to achieve is the below:

When an admin user wants to create a schedule for a technician from the table itself (and not from the editable grid) taking the example of the above screenshot iHealth project, I want the Project Resource ID field to be set automatically and populated after the record is saved based on the project selected that matches the record in the project resource table.

The admin user should not fill out the project resource ID as anyway I will hide it from the form.

For the above, If I created the record from the editable grid under the project resource table the Project Resource ID value is being populated successfully.
8130.SubGrid.PNG
I want to know what's the easiest method needed to achieve the above requirements without taking into consideration the editable grid?
TimesheetSche.PNG

Note: I thought about a Power Automate cloud flow that triggers record creation in the schedule table and updates the record with the project resource ID.
(But the problem is how to determine if the record created was from the grid or the table directly to avoid flow runs because if it was from the grid it will automatically populates that value).

Would highly appreciate it if someone can provide an example.

Thanks,
EBMRay

  • EBMRay Profile Picture
    EBMRay 873 on at
    RE: Set field value on another table automatically after record creation

    Hi ,

    Thank you for your reply.

    I will give it a try according to your inputs and will let you know if I need any assistance.

    I wish you a happy new year!

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set field value on another table automatically after record creation

    Hi EBMRay,

    You could use Power Automate to achieve this. Create a flow which triggered by Schedule record created. Then check it's Project Resource ID is null or not.

    If yes, then get Project Resource filter by Project Name in the record(List rows action). Finally, update the Schedule record with the  Project Resource.(Update Row Action)

    P.S. I would be offline. I would provide an example next Tuesday if you are still struggle with this.

  • EBMRay Profile Picture
    EBMRay 873 on at
    RE: Set field value on another table automatically after record creation

    Hi   ,

    Thank you for your reply.

    In your case, you want to automatically populate Project Resource ID when a schedule table record is created whatever it's created form editable grid or it's form, correct?

    Yes, from the grid the behavior is working perfectly but I want to achieve the same on the form level.

    When a schedule table record is created from editable grid, the  Project Resource ID is automatically populated. However, the record created from it's form, it couldn't.

    Yes, this is what I am trying to achieve.

    If so, as you say that it's difficult to distinguish it was created from a form or an editable grid. You could just check the Project Resource ID is empty or not. If it's empty, you could get the value of Project Name and  set

    the Project Resource ID is filed with corresponding value.(One Project should correspond to one Project Resource, correct?)

    Yes, one project is associated with only one project resource and one project resource is associated with many schedule for a project and the related resource.

    What is the best way to achieve this? Can you please provide an example?

    Best regards,

    EBMRay

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set field value on another table automatically after record creation

    Hi EBMRay,

    Please confirm my understanding:

    In your case, you want to automatically populate Project Resource ID when a schedule table record is created whatever it's created form editable grid or it's form, correct?

    When a schedule table record is created from editable grid, the  Project Resource ID is automatically populated. However, the record created from it's form, it couldn't.

    If so, as you say that it's difficult to distinguish it was created from a form or an editable grid. You could just check the Project Resource ID is empty or not. If it's empty, you could get the value of Project Name and  set 

    the Project Resource ID filed with corresponding value.(One Project should correspond to one Project Resource, correct?)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans