Questions about and code samples for custom order rules and validation within Select.
- Posts: 6
- Joined: Mon Apr 10, 2017 4:08 pm
We are having an issue where 2 different underwriters are being added to a file, and it is causing issues with dispersing & accounting.
I am trying to find a way to block a U2 contact from being created, and I believe I can do that with a COR but I am having trouble determining the best way to handle this.
Any help would be greatly appreciated!
- Posts: 1006
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
In a custom validation routine, we can look at the total number of Underwriters and if it exceeds one then raise an error. That will stop the order from being saved until the user gets the number of Underwriters below 2.
Code: Select all
if args.Context.Underwriters.Count > 1:
args.RaiseError('Only one underwriter is allowed.')
Bob Richards, Software Developer, SoftPro