Make Custom Field Read Only

Questions about and code samples for custom order rules and validation within Select.
Post Reply
kendale.wyatt
Posts: 27
Joined: Wed Sep 26, 2018 1:24 pm

Make Custom Field Read Only

Post by kendale.wyatt »

I have a custom field that I need to make read only since we will not be using it anymore. The field is Order.Title.TitleProducts.RecInfoRestrictiveCovenants_150171#

The Context shows Order:Title:Commitment

What am I doing wrong here? I cannot get it to work.




from System import *
from SoftPro.ClientModel import *
from SoftPro.OrderTracking.Client import *
from SoftPro.OrderTracking.Client.Orders import *

#Rule logic with a non-COR style style name
def RestrictiveCovenants(args):
order = args.Context
args.Value = True


#Rename rule
RestrictiveCovenants._name_ = 'Commitment_RecInfoRestrictiveCovenants_150171#_ReadOnly'
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Make Custom Field Read Only

Post by BobRichards »

Please post your code inside code tags (the </> button above) so the browser doesn't mess up the spacing.

Be aware that in Python, the property "__name__" as two underscores at the beginning and at the end. It can be difficult to see.

Code: Select all

RestrictiveCovenants.__name__ = 'Commitment_RecInfoRestrictiveCovenants_150171#_ReadOnly'
Bob Richards, Senior Software Developer, SoftPro
kendale.wyatt
Posts: 27
Joined: Wed Sep 26, 2018 1:24 pm

Re: Make Custom Field Read Only

Post by kendale.wyatt »

That was the issue, I only had one underscore before and after. Thank you!
Post Reply