问题
For some strange reason I cannot access any control on the header or the business process flow section. I try to access them in the debugging tool after the page has loaded but I get null all the time. This is what I have/have done so far:
- CRM 2016 on-premise
- I have administrator rights
- I use Xrm.Page.getControl("header_CONTROL NAME") for header controls
- I use Xrm.Page.getControl("header_process_CONTROL NAME") for BPF controls
- I have checked the control names and they are correct
Any help is appreciated.
回答1:
It is possible you are in a wrong context in your debugging tool because forms usually rendered in an iframe.
If by that tool you mean the Chrome DevTools try to select some of those controls in elements view of your DOM and execute Xrm.Page.getControl after that.
回答2:
I saw this happen when I tried accessing the controls in a "New Record" (create) form. In Update forms the same code worked as expected.
来源:https://stackoverflow.com/questions/43259770/cannot-access-header-or-business-process-flow-controls-on-a-crm-form