RE: executionContext for JS and HTML web resource that should be triggered by onclick
Hi partner,
We could not get "executionContext" in html web resource directly.
From your code I saw that you just want to get the value of "org_productbuyerid" field, so I suggest that you could follow my steps.
For example I want to get the form field "Name" value in html web resource.
I used the following code.
var value2= window.parent.Xrm.Page.getAttribute("new_name").getValue()

Although Microsoft has announced that it is abandoning this approach "Xrm.page", However, they did not say that it should not be used in the form, which is the most appropriate method at present.
BTW, if your field "productbuyerid" is a look up field, you need to get its id by this code:
var buyer=formContext.getAttribute("productbuyerid").getValue();
var buyerid=buyer[0].id;
Hope it helps.
Best Regards,
Leo