Announcements
Hi when we use quickview form we generally follow this
var quickViewControl = formContext.ui.quickForms.get("quickviewname");
var myValue = quickViewControl.getControl("internalname").getAttribute().getValue();
This works totally fine. But now work order form of customer is embedded in booking. and this work order customer form is main form, and i am not able to extract it's value on booking form. Can someone help how do i extract value by javascript.
Thank you
After working with MS support they provided the code that should work for PCF Form Component:
//this value defines if the control was already loaded. I added a 1 because I have the field twice in the form
var wasContentLoaded = formContext.getControl("regardingobjectid1").isLoaded();
if (wasContentLoaded && formContext.getControl("regardingobjectid1").data.getIsDirty())
{
// if any field of the form component got updated
var object = new Array();
object[0] = new Object();
object[0].id = formContext.data.entity.getId();
object[0].name = formContext.data.entity.getPrimaryAttributeValue();
object[0].entityType = formContext.data.entity.getEntityName();
formContext.getControl("regardingobjectid1").data.entity.attributes.get("cus_phonecall").setValue(object);
}
In this example I am updating the cus_phonecall field from the related entity.
This is working fine in my environments.
I hope this helps!!
Best,
Anyone trying to this here is the JS required:
You can use the console to work out the names or index to use.
Hello Ravi!!
Have you found a solution for this?
Hi,
When I checked the configuration it used Quick View Form only.
<QuickForms><QuickFormIds><QuickFormId entityname="msdyn_workorder">613513a1-322d-4ecc-81bd-bd65640d834c</QuickFormId></QuickFormIds></QuickForms>
Have you tried using same quick view JS code to retrieve the value?
Yes it used PCF Form Component control to embed Work Order form and not using quick view form directly as we do it normally on form ->Insert->Quick View Form
I am using lookup present on bookable resource entityt form, just want to know if there is a direct way to get them like we can do for quick view, that would be easy and simple.
Hi Ravi,
you mean that it took lookup field of work order, so you can use web Api to retrieve lookup entity by id to get value of the field you need.
Refer this:
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
There is work order customer and work order service forms are there, which recently have been introduced in Work order entity by microsoft teams. Now these two forms are embedded in booking and work order form of Bookable resource booking entity. They took a lookup field of work order and added custom control in it which shows full form of work order form in booking entity's main form.
if this would have been a quick view form I know how to extract the value. I can edit these fileds in booking form as they are editable. All i need a way to abstrat their value via Javascript
Hi,
But now work order form of customer is embedded in booking. and this work order customer form is main form
What do you mean by this?
Can you please send screenshot of Booking form?
I have checked booking form on my instance and I don't see any work order form embedded into it. How did you embedd work order form to booking form?
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156