Custom Rule Use Lookups

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
czentman
Posts: 157
Joined: Tue Dec 02, 2008 12:02 pm

Custom Rule Use Lookups

Post by czentman »

can I compare data in my file to data in a lookup in the custom rules python. Can I access the lookups from python? If so, how? If not, can I access the database tables at all and compare data in my file to my own table in the database? Can you guide me along with this. We have the underwriters sending us specific properties or contact names to "watch out" for our users need to be alerted to check into and we keep is as a "watch list" and want to compare our contacts with the contacts in the list, and/or our properties in the file to the properties in the list.
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Custom Rule Use Lookups

Post by BobRichards »

You must not do this operation in a Custom Order Rule since it can generate multiple queries to the database. Calling a mid-tier interface should not be performed either since it would make running the rule set entirely too slow. Remember that rules can run multiple times so response time is further degraded. Custom Order Rules should be restricted to objects that are part of the order model.

One method to do this is write a server-side package that monitors the OrderSaving event. On each order save, it would check the necessary information at the server and could generate a validation error message for the user. It would also prevent the order from being saved until the validation is error free.

Sorry.
Bob Richards, Senior Software Developer, SoftPro
Post Reply