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?
Getting Started with HotSpot functionality
Moderator: Phil Barton
-
- Posts: 54
- Joined: Wed Sep 24, 2008 2:37 pm
- Location: Raleigh, NC
- Contact:
Re: Getting Started with HotSpot functionality
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
Software Architect
SoftPro
-
- Posts: 91
- Joined: Wed Sep 10, 2008 3:33 pm
- Location: Raleigh, NC
- Contact:
Re: Getting Started with HotSpot functionality
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.
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
VP of Product Strategy, SoftPro