Hi Sandy,
You can populate description field with WO ID by following steps.
Here are steps.
1.write custom JavaScript code.
function autoPopulateData(executionContext) { var workerID = Xrm.Page.data.entity.getId().replace("{", "").replace("}", ""); var att = Xrm.Page.getAttribute("new_description"); att.setValue(workerID); }
2. Add your JavaScript code in a Script web resource.
3. Associate Script web resource to a form.
4. Test
Regards,
Clofly
Great!! Thank You Clofly.
It seems your code is pulling GUID.
My requirement is, an auto-populated field, named as Work Order ID, which need to be get & set in the description field in same form.
The following is modified sample code.
function autoPopulateData(executionContext) { var workerID = Xrm.Page.getAttribute("msdyn_name").getValue(); var att = Xrm.Page.getAttribute("new_description"); att.setValue(workerID); }
In my form, the Work Order Number field which name is "msdyn_name” is an auto-populated field.
So you just replace "msdyn_name” in the code with the name of the Work Order ID in your environment, the description field will be populated with the same WO ID automantically When the form onload.
Would a simple workflow work to populate the description field?
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 Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
MVP-Daniyal Khaleel 67
Tom_Gioielli 24 Super User 2025 Season 2
mk1329 16