Page 1 of 1

Getting Started with HotSpot functionality

Posted: Mon Oct 13, 2008 5:00 pm
by brianc_la
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?

Re: Getting Started with HotSpot functionality

Posted: Tue Oct 14, 2008 9:41 am
by Phil Barton
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.

Re: Getting Started with HotSpot functionality

Posted: Tue Oct 14, 2008 9:47 am
by Melissa McBerkowitz
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.