|
Best of Support |
|
|
Answer-set naming |
|
Issue
How to dynamically name and select an Answer-set.
Solution:
Your requirement is something that we do often. We would suggest that the best way of approaching this is to move the script for pre-populating your Dialog into the template before creating or loading the Answer-set, in which case it would go something like this:
Determine the required answer-set name:
%[AnswerSetName=MyDatabase.Field]
Check to see if the Answer-set exists. Only if it does not exist, create a new Answer-set, preset the values from the database, and save:
%[DeleteBlockIf(Dialogs.Exists("\ApplicationMapping\DialogName","AnswerSetName")]
%[X=Dialogs.New("\ApplicationMapping\DialogName","AnswerSetName")]
%[X.Field1=MyDatabase.Field1]
%[X.Field2=MyDatabase.Field2]
etc.
%[Dialogs.Save(X,True)]
%[EndBlock()]
Now simply load the Answer-set (either newly created and populated, or existing) for further editing:
%[Dialogs.Capture("\ApplicationMapping\DialogName","AnswerSetName", True)]
Daniel Todes