Page 1 of 1

Make Custom Field Read Only

Posted: Thu Jul 23, 2020 4:00 pm
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'

Re: Make Custom Field Read Only

Posted: Thu Jul 23, 2020 6:09 pm
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'

Re: Make Custom Field Read Only

Posted: Mon Jul 27, 2020 3:31 pm
by kendale.wyatt
That was the issue, I only had one underscore before and after. Thank you!