Disabling validation when loading a Contact from the CLT

Discussions related to writing and managing custom business rules.

Moderator: Phil Barton

Post Reply
brianc_la
Posts: 15
Joined: Fri Oct 10, 2008 2:01 pm

Disabling validation when loading a Contact from the CLT

Post by brianc_la »

As a recent requirements change, I would also like to be able to add a Contact from the Contact Lookup Table(CLT), but the custom validations prevent the text from populating the fields. As stated above, the val popup boxes do not display. I would like to suppress the validations when the newly added SA or UW is completely blank and the contact is being selected from the CLT.

2. In a feat to do the seemingly impossible, is there a way to disable/bypass the custom validations that trigger on changes to the Settlement Agent/UW while a contact is being loaded from the CLT? Is there a programatic property that signals a load from the CLT?
Phil Barton
Posts: 54
Joined: Wed Sep 24, 2008 2:37 pm
Location: Raleigh, NC
Contact:

Re: Disabling validation when loading a Contact from the CLT

Post by Phil Barton »

That is not possible. The validations fire when a specific data item (related to the validation) is filled with data. We currently don't have any flags to disable when filling in from a lookup table.
Phil Barton
Software Architect
SoftPro
Melissa McBerkowitz
Posts: 91
Joined: Wed Sep 10, 2008 3:33 pm
Location: Raleigh, NC
Contact:

Re: Disabling validation when loading a Contact from the CLT

Post by Melissa McBerkowitz »

Are you using a save validation or a field validation? If you're doing a field validation, you use [PotentialValue] to get the value the user is trying to set, but passing in the data item will give you the current value in the field. For example, if your field validation has:

<ValidatedField>LookupCode</ValidatedField>

your inputs could be:

<Input>
<Order>0</Order>
<Source>[PotentialValue]</Source>
</Input>
<Input>
<Order>1</Order>
<Source>LookupCode</Source>
</Input>

The first will give you what the user is trying to set to, the second will give you the current value. If the current value is blank, your rule could skip the validation.

ETA: But Phil's right, there's no way to tell if the user has selected from a lookup vs. manually typed in an entry, unless you want to validate their entry against the lookup data in the database.
Melissa McBerkowitz
VP of Product Strategy, SoftPro
brianc_la
Posts: 15
Joined: Fri Oct 10, 2008 2:01 pm

Re: Disabling validation when loading a Contact from the CLT

Post by brianc_la »

Thanks for the reply.

That would work if the field would automatically revert back to the original value and the contents were strictly protected on the fields. I could enforce the changes to an existing Contact like Settlement Agent. I see this behavior for other validations like the BillTo contact.

The problem is when I clear the field, the validator message may pop up, but the field is left clear after the validation. Now the user has to remember the value if they accidentally cleared the field. This would be the same scenario as the contact being added into a newly created Contact page. To bypass the validation on a clear/empty field would allow the addition from the CLT but would also allow the user to change existing information on an existing Order Contact.

If the field would automatically revert back to the original value, the validation could prevent clearing of the field and also would allow the bypass of the validation when an additional Contact is added from the CLT.
brianc_la
Posts: 15
Joined: Fri Oct 10, 2008 2:01 pm

Re: Disabling validation when loading a Contact from the CLT

Post by brianc_la »

I was thinking of a solution using a business object, if the business object would fire only once at the beginning of the CLT insert. I could bypass validations if {SettlementAgents}.count == 0 (all SA's deleted) and all the fields on Contact are clear. If at the very beginning of the CLT addition the Business Rule (BR) would fire and return true. The possible problem is that as the fields trigger validations the BR would reevaluate and return false. This could be my flag. It seems I have seen the business object only triggering in my IDE only once during a save, I am not sure about this BR behavior.
Post Reply