Subject: Multiple @Dblookup’s in a subform
Here is what we do in our Workflo!Approval Product. We have a Subform that is added to an existing form (not a necessary step for you). On the subform is a formula (Compute For Display so the results is not stored in the document) that looks up a profile document and returns column 3 (in our case) The formula for this column looks something like this :
ACProcessName:
ACMailForm:
ACConditionLock:
ACConditionToggle:
@Text(ACCondition):
ACConditionType:
ACRoutingMethodLock:
ACRoutingMethod:
ACApproversLock:
@Implode(ACApproversDefault;"~"):
ACApproverCommentsLock:
ACApproverComments:
ACAutoSkipLock:
ACAutoSkip:
@Text(ACSkipDays):
ACSkipDaysType:
ACNotifyAssignLock:
ACNotifyAssign:
ACNotifyLateLock:
ACNotifyLate:
@Text(ACLateDays):
ACLateDaysType:
@Text(ACLateTimes):
ACNotifyProgressLock:
@Implode(ACNotifyProgressGeneral;"~"):
@Implode(ACNotifyProgressNames;"~"):
ACNotifyTroubleLock:
@Implode(ACNotifyTroubleGeneral;"~"):
@Implode(ACNotifyTroubleNames;"~"):
so that it concatenates together all of the fields that I want to inherit from the profile. So a single lookup returns at the present time the data from about 175 different fields in the profile document. Notice that some of the fields are Multi-value so we do an @Implode and delimit the result with “~”.
Then in the subform we want to load the results into different fields so we use a Compute when Composed field with a formula like this:
@Explode(@Subset(@Subset(ACProfileData;10);-1);“~”)
in this case return the 10th element in the Computed for Display field and returns an array of in this case Approvers Names (but that is immaterial.
A simpler single value fields looks like this:
@Subset(@Subset(ACProfileData;65);-1)
which returns the 65th item, etc.
What I have done to sort of create an index of the values is that I have pasted the Field list out of the Column in the Lookup View into a spreadsheet and then numbered the items. so that if I want the MailForm name I know that it is the second elemnet in the returned data.
This takes a bit of set up but once you have it working it is pretty easy to add additional fields into the definition. Add them to the end of the list of fields in the Lookup Column formula and then reference them by their appropriate index location. It is really pretty fast in execution considering all then stuff it has to do, but it typically only happens once on Composition. I have written an agent that will reset the values after the document has been composed, but anyway …
You can look at the code by downloading our Workflo!Approval Demo at
http://www.wfs.com/workweb/WFSWebLib.nsf/Src/DocSet*Notes+Net06
look at the Hidden Fields Subform for the field ACProfileDate and the view (Approval Cycle Profiles). It’s really not that complex and I’m sure someone might be able to improve on the process, but it works and has been for a long time.
Found reference:
http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/144e971d6849848c85257203005b543a?OpenDocument