Blogs

Hide a field in all the stages of a Business Process Flow in Dynamics 365

, December 8, 201713929 Views

I have come up with a solution to a problem that many of the CRM developers may have come across with. Let me explain the scenario as follows:

Suppose, you have created a Business Process Flow for an entity with multiple stages. And each stage is having a common field in it.

Now, the customer requires to hide that common field in all the stages once he reaches a particular stage.

Here I am explaining you the way, this requirement could be achieved:

When a form displays a business process flow control in the header, additional controls gets added for each attribute that is been displayed in that BPF.

These controls hold unique names like:-

header_process_<attribute name>

If you write:-

Xrm.Page.getControl(“header_process_<attribute name>”).setVisible(false)

It will just hide the first occurrence in BPF.

But, in our case we need to hide a particular field in all the BPF stages.

Thus we need to set visibility property to each of those fields as below:-

Xrm.Page.getControl(“header_process_<attribute name>”).setVisible(false)
Xrm.Page.getControl("header_process_<attribute name>_1").setVisible (false);
Xrm.Page.getControl("header_process_<attribute name>_2").setVisible (false);
Xrm.Page.getControl("header_process_<attribute name>_3").setVisible (false);

(i.e) You just need to append numeric series to the attribute name based on the number of times a field occurs in BPF.

I Hope this helps you…

Happy CRMing!!


 

Insert data into Many-to-Many relationship in Dynamics CRM very easily & quickly, using the Drag and drop listbox.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/drag-and-drop-listbox