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 :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Setting field value with Javascript on form not triggering standard operations as if user entered data

(0) ShareShare
ReportReport
Posted on by 68

We are setting the Product lookup on the Work Order Product form in mobile with offline enabled.

The value is setting correctly on the form, showing the Product name, and with the Product ID set, but the Unit Amount is not being set as it is when a user adds the same product to the form directly.

How can we trigger the standard Microsoft operations to set the Unit Amount etc as if the user had input the value on the form?

The script is run from a new field that reads a Product barcode to save the users inputting the product number into the Work Order Product.

We did have another script on the Product field, which we disabled for testing, and still the standard Microsoft functionality is not triggered on adding the product to the form.

We cannot save the form, as the Unit Amount is a required field, and the user has not yet entered the Quantity.

I have the same question (0)
  • Suggested answer
    Hari Narayanan Profile Picture
    589 on at

    Have you tried fireonChange for the product?

    When a field is set via code, there is a safety mechanism to not trigger on Change by default as it could lead to infinite loops  or undesired results. so developer can choose to trigger the onChange via fireOnChange api.

    learn.microsoft.com/.../fireonchange

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 > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 55 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 27 Most Valuable Professional

#3
Soundari Profile Picture

Soundari 15

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans