Announcements
No record found.
On change of District (lookup field) of Work Order, we want change on Price List( Lookup Field) of Work Order, how to achieve this?
There is no out of the box field 'District' on the Work Order. Is it a custom field? You can use Javascript for auto-setting any field based on business logic.
You could go with Flow, plugin or javascript.
Below is an example of JavaScript that you would attach to OnChange Event of the District lookup field. The names of the columns or your lookup are likely different and I can't recall if there are any issues setting pricelist however the basic structure should be right.
function getsetLookupDetails(executionContext) { // Getting Form Context var formContext = executionContext.getFormContext(); // Getting the value of District var districtId = formContext.getAttribute("new_district").getValue(); // Getting the GUID District var Id = districtId[0].id; // Getting Name of the District var Name = districtId[0].name; // Getting Entity Name of District var EntityType = OwnerId[0].entityType; // Retrieve the priclist if (FormType == 1) { Xrm.WebApi.retrieveMultipleRecords("pricelist", "?$select=name,pricelevelid").then( function success(result) { for (var i = 0; i < result.entities.length; i ) { var pricelistId = result.entities[i]["pricelevelid"]; // id pricelist var pricelistName = result.entities[i]["name"]; // name of pricelist var pricelistEntity = "pricelist"; // Should be priclist entity name if(pricelistName == Name) // If Name of district name of pricelist otherwise use some other logic to check mname { formContext.getAttribute("msdyn_fieldservicepricelistitemid").setValue([{ id: pricelistId, name: pricelistName, entityType: pricelistEntity }]); } } }); } }
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Travis South 54
11manish 37 Super User 2026 Season 2
ParthPatel249 33