Notifications
Announcements
No record found.
I have made a new field in the assets form . for eg (Technician)when creating an asset you will have to enter the name of that technician.Now I have to auto generate show the name of that technician when selecting a asset on work Order.Anyone?
Hi,
Do you mean you want to show Technician filed on the drop down list of asset field?
I have already done that.
Now Whatever asset I am saving here. should reflect on Work order.
if I am Selecting any asset on work order I have added a field there, now what I want is if I enter asset on work order Technician name should come automatically.
Thanks
You could create an onChange event on your "Customer Asset" field with the following code:
function onChange(executionContext){ var formContext = executionContext.getFormContext(); formContext.getAttribute("new_technician").setValue(null); var asset = formContext.getAttribute("msdyn_customerasset").getValue(); if(asset != null && asset.length > 0){ var assetID = asset[0].id; Xrm.WebApi.retrieveRecord("msdyn_customerasset",assetID).then( function success(result){ // the below new_technician is the name of Technician in your Customer Asset entity var technician = result['new_technician']; // this new_technician is the name of Technician in your Work Order entity formContext.getAttribute("new_technician").setValue(technician); }, function (error){ console.log(error.message); } ) } }
Result:
Select a Customer Asset, Steve is Technician name.
Then Technician on the Work Order form would be generated automatically:
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 55 Super User 2025 Season 2
Daniyal Khaleel 27 Most Valuable Professional
Soundari 15