Iron Python Logic: Disable Fields based on Contact and User

Questions about and code samples for custom order rules and validation within Select.
Post Reply
johnpbzdon
Posts: 11
Joined: Mon May 09, 2016 10:07 am

Iron Python Logic: Disable Fields based on Contact and User

Post by johnpbzdon »

We are trying to accomplish disabling some fields on specific contact types based on user role. For example if a user has a specific role, the Other Contact Type fields should be disabled so they cannot edit them. We are aware there are permissions that disable contact information, but we are only looking to disable specific fields (example fields: Order.Others.Name, Order.Others.PaymentInfo.PayeeName, Order.Others.Address.Address1). Can you please provide some Iron Python code examples to create a ProForm Order Rule?
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Iron Python Logic: Disable Fields based on Contact and U

Post by BobRichards »

One of the major tenets in writing Custom Order Rules (CORs) is that all the operations must be fast since rules can be called multiple times. This means that you must not call any interfaces/services on the server or database. In order to get the necessary information, you would need to access the IRoleManager that resides on the server - and that must not be done or the user screen could possibly freeze briefly.

You can get the most recent Select SDK help file by contacting your SoftPro Customer Representative. It has information and examples of CORs. It will describe the "ReadOnly" COR aspect that would allow you to write rule logic that would enable/disable the ability for the user to make changes to a field - but not based on Role.
Bob Richards, Senior Software Developer, SoftPro
Post Reply