Getting Started with HotSpot functionality

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

Getting Started with HotSpot functionality

Post by brianc_la » Mon Oct 13, 2008 5:00 pm

I want my save validations to use the Hot Spot functionality. How must i do to the validators?

Typically I format the error as such:

return new ValidationError(errorMessage.Value, ValidationErrorLevel.Error, source.Value, strDataItem.Value);

I notice some of the Core Rules have a <HotSpotScreen></HotSpotScreen>. Is this of use?

Phil Barton
Posts: 54
Joined: Wed Sep 24, 2008 2:37 pm
Location: Raleigh, NC
Contact:

Re: Getting Started with HotSpot functionality

Post by Phil Barton » Tue Oct 14, 2008 9:41 am

Providing a non-null source and non-null/non-empty data item name should provide hotspot functionality to the appropriate field for the screen related to the object specified as the source.
Phil Barton
Software Architect
SoftPro

Melissa McBerkowitz
Posts: 91
Joined: Wed Sep 10, 2008 3:33 pm
Location: Raleigh, NC
Contact:

Re: Getting Started with HotSpot functionality

Post by Melissa McBerkowitz » Tue Oct 14, 2008 9:47 am

Hotspots with save validation work differently than hotspots on other business rules. Your save validation error/warning will have a hotspot as long as you specify appropriate values for the final two parameters in your code:

return new ValidationError(errorMessage.Value, ValidationErrorLevel.Error, source.Value, strDataItem.Value);

Where you have source.Value, you need to supply an IBusinessObject for the appropriate context, typically the context of the object you're validating. If your save validation uses <BusinessObjectContext>OrderContact</BusinessObjectContext>, your rule would have a parameter like:

InputParameterHandle<IBusinessObject> source

In the CoreBusinessRules.xml, you'd map this parameter like this:

<Input>
<Order>#</Order>
<Source>This</Source>
</Input>

(insert appropriate integer for the Order tag)

For the last parameter, you simply need to supply a string that matches the data item for where you want to hotspot. For example, if you want to hotspot to the OrderContact's lookup code, you'd supply the string "LookupCode". You can either pass this string into your rule as a constant via the XML, or simply hard-code the string in your rule's code.
Melissa McBerkowitz
VP of Product Strategy, SoftPro

Post Reply