Wednesday, March 25, 2015

Cross dictionary form "return to" doesn't work - here's a workaround

I have a lookup in dictionary 1, and want to use that lookup in dictionary 2. Unfortunately when i use the standard "return" it's returning nothing to dic 2's window. Apparently cross dic "return to" doesn't work. I could duplicate the lookup and transfer it to dic 2, but that violates the DRY principle (do not repeat yourself).

1. Add a procedure in the lookup called CrossDicOpen
    Pass in the fully qualified field to return to, and the dictionary ID.
    For example:
    Fully Qualified Return To Field = 'Schedule ID' of window Schedules of form Schedules;
    Dictionary ID = 2

2. Add fully qualified field and dictionary ID fields to the lookup window as hidden fields

3. When select is chosen check if it was opened by another dictionary. If it is then do a cross dic call to that dictionary, setting Fully Qualified Return To Field = the selected record, and running that field's change script.

Note: Make sure to escape any quote marks.

No comments:

Post a Comment

There was an error in this gadget