web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Creation of a large set of records by clicking a button on the ribbon

(0) ShareShare
ReportReport
Posted on by 905

Hello everyone,

I have a list of employees 3000+ in a custom table and I want to perform a calculation for their salaries based on different conditions and validations on a monthly basis.

Please find below the scenario that I want to achieve:

I want to add a button on the employee view page table that will be visible on the ribbon command bar. When the HR click this button, a background process should be triggered (other than power automate as it may cause throttling issues or also a plugin due to 2min timeout) that should validate the data based on the conditions that we will develop in the code and perform the creation of the large set of records in another custom table in dataverse.

I mentioned a large set of records because for every employee the process will create around 10-20 line items in the custom table so taking the highest number (20 line-item x3000 employee)= 60K records.

In addition, I need to take into consideration the below:

1. When the background process is triggered the button should be hidden on the command bar to avoid clicking the button again from the client-side.
2. Will it be possible to show like a progress bar that the calculation is in progress on the client-side in the model-driven app?

Could you suggest what can be the solution for the above requirements and especially the tool that should be used for the background process that will perform the creation of the records? Can you please provide some documentation?

The tool that should be used to develop the logic of the above should be accurate and efficient as this is a calculation of the employee salaries.

Any help is highly appreciated.

Best regards,
EBMRay

I have the same question (0)
  • EBMRay Profile Picture
    905 on at

    Hello Bipin Kumar ,

    I did some research and found that Azure Function can be an option. Also, what about a custom WPF Desktop App integrated with model-driven?

    Please let me know your thoughts. I would highly appreciate your input.

    Best regards,

    EBMRay

  • Verified answer
    mildseven Profile Picture
    45 on at

    Use a custom Action. Implement it as a webhook to an Azure function (which doesn't have the 2-min constraint). Call the action from JavaScript, and you can use out of the box showProgressIndicator for the progress bar. On successful execution of the action's logic in Azure, you can set the outputParameter to whatever you like: Success(boolean). On the front end, you close the progress bar if the output parameter Success == true.

    If you're running this on a view/subgrid, do you plan on selecting records? Or are you updating all records in the view? Depending on the route you take, you'll most likely need to incorporate additional logic to meet your business requirements.

  • EBMRay Profile Picture
    905 on at

    Hi mildseven ,

    Thank you for your valuable response.

    Exactly, the webhook will be used to call the Azure function when the button is clicked from the UI. Is there any example that shows how the showProgressIndicator will disappear whenever the Azure function succeeded?

    The button will be clicked from a View that will trigger the function without selecting any record.

    I found this useful post that might help anyone will come across this post:

    www.blog.allandecastro.com/.../

    Best regards,
    EBMRay

  • mildseven Profile Picture
    45 on at

    You could do something like this:

    Xrm.Utility.showProgressIndicator("Processing...");

    var result = await Xrm.WebApi.online.execute("your custom action logical name");
        if (result && result.ok) {
        var output = await result.json();
        var success = output["Success"];

        if(success){ Xrm.Utility.closeProgressIndicator(); } 

        else {

            -error handling logic-

        }

    }

  • EBMRay Profile Picture
    905 on at

    Hi mildseven ,

    Thank you for your reply and for providing an example.

    I will start with the implementation and will let you know if I have any further questions.

    Best regards,

    EBMRay

  • mildseven Profile Picture
    45 on at

    Please mark my answer as verified if it worked. Thanks!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans