Skip to main content

Notifications

Customer Service forum
Unanswered

Auto Save form after BPF action completes

Posted on by 100

I have a BPF action that pulls back some variables (Process Arguments) that then set values against some form fields. This all works fine, but, it does not auto save the form so there are always "Unsaved changes" between transitions

Everything I have read points to putting and OnChange JS function call for that field in the form. The function works fine only if I manually change the values in the form or in the BPF field, but when the values are set via the action the JS function is not called and the form is still not saved.

Is there any way to get the form to save after a BPF action completes, or any other solution for the above issue?

Regards

Nick

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Auto Save form after BPF action completes

    Hi partner,

    "Onchange" event of fields could only be triggered when change the value manually.

    1460.pastedimage1576825171331v1.png

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/events/attribute-onchange

    If you want to trigger the onchange function when the field value is changed by js code, you could use getAttribute().addOnchange(function(){}) method.

    function onchangeActiveStage(executionContext){
        var formContext = executionContext.getFormContext();
        var hassametaxrate=formContext.getAttribute("purchaseprocess");
        hassametaxrate.setValue(1);
        hassametaxrate.addOnChange(function () { changeBPF(formContext); });
    }


    changeBPF = function (formContext) {
        alert(1);
    }

    Hope it helps.

    Best Regards,

    Leo

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

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,782 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,067 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans