I have the following code which generates a list of Customer "Checkcodes" which are a concatenation of the company name, city, state, and customer code. It's used by my users in the retrieve spec for a quick picklist to look up a customer's record.
var vCheckcodeLookups as string
// Populates the Checkcode combo box
IF @MODE() = 2
THEN
{
vCheckcodeLookups = @XListValues(@FN, "Customer!Checkcode")
vCheckcodeLookups = @SortstringArray(vCheckcodeLookups,0)
vCheckcodeLookups = @Replace(vCheckcodeLookups, "&", "\&")
PopulateListElement(Checkcode, vCheckcodeLookups)
}
I currently have this running On Retrieve Spec Open of the Checkcode element. Works fine, but causes a noticeable delay before the retrieve spec fully opens for use (there are thousands of customer records).
In an effort to have it run only when necessary (specifically, just when my users wanted to use the checkcode element to supply them with the checkcode) I tried moving it to the On Element Entry area, but it failed to function. Got a blank dropdown. Any idea what I'm doing wrong?
Update: If I put it in On Element Entry it works in Add or Update Mode, but not Retrieve.