Skip to main content

Notifications

Announcements

No record found.

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 873

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

  • mildseven Profile Picture
    mildseven 45 on at
    RE: Creation of a large set of records by clicking a button on the ribbon

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

  • EBMRay Profile Picture
    EBMRay 873 on at
    RE: Creation of a large set of records by clicking a button on the ribbon

    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
    mildseven 45 on at
    RE: Creation of a large set of records by clicking a button on the ribbon

    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
    EBMRay 873 on at
    RE: Creation of a large set of records by clicking a button on the ribbon

    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

  • Verified answer
    mildseven Profile Picture
    mildseven 45 on at
    RE: Creation of a large set of records by clicking a button on the ribbon

    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
    EBMRay 873 on at
    RE: Creation of a large set of records by clicking a button on the ribbon

    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

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans