Best of Support

Retrieving a list of users in Amicus Assembly as a drop-down list

Issue

I would like to retrieve a list of users in a certain user.group and then put them into a drop-down list. If the list is edited, I would like to write the changes back to Amicus Assembly. How would I do this?

Also, is there a way I can name the Answer-set using the ShortFileName in Amicus?

Solution:

 

Creating a list from an Amicus collection, e.g., "aa.users"

The following sample script will create (or update) an Amicus Assembly list called "list of users" stored in "aa reports". This list can of course be accessed from a Dialog:

%[MyList=Lists.New()]

%[ForEachBlock('x',aa.users)] %[MyList.Add(x.name, x.name)] %[EndBlock]

%[MyList.SaveAs("\aa reports", "List of users")]

 

Answer-Set Naming and Selection

The following sample script will create an Answer-set based on a short file matter name:

 

  1. Determine the required Answer-set name:

%[AnswerSetName=Matter.ShortFileName]

 

  1. You will probably need to strip the name of non-standard characters - just in case:

%[AnswerSetName=Replace(AnswerSetName, "-", "_")]

%[AnswerSetName=Replace(AnswerSetName, " ", "_")]

%[AnswerSetName=Replace(AnswerSetName, "'", "")]

%[AnswerSetName=Replace(AnswerSetName, '"', '')]

%[AnswerSetName=Replace(AnswerSetName, "\", "_")]

%[AnswerSetName=Replace(AnswerSetName, "/", "_")]

%[AnswerSetName=Replace(AnswerSetName, ":", "_")]

%[AnswerSetName=Replace(AnswerSetName, "?", "_")]

%[AnswerSetName=Replace(AnswerSetName, ">", "_")]

%[AnswerSetName=Replace(AnswerSetName, "<", "_")]

%[AnswerSetName=Replace(AnswerSetName, "|", "_")]

%[AnswerSetName=Replace(AnswerSetName, "%", "_")]

%[AnswerSetName=Replace(AnswerSetName, "!", "_")]

%[AnswerSetName=Replace(AnswerSetName, "@", "_")]

%[AnswerSetName=Replace(AnswerSetName, "^", "_")]

 

  1. Check to see if the Answer-set exists.  Only if it does not exist, create a new Answer-set.

%[DeleteBlockIf(Dialogs.Exists("\ApplicationMapping\DialogName", AnswerSetName)]

%[X=Dialogs.New("\ApplicationMapping\DialogName", AnswerSetName)]%[EndBlock]

 

  1. Now simply load the Answer-set (either newly created or existing) for further editing:

%[Dialogs.Capture("\ApplicationMapping\DialogName", AnswerSetName, True)]

 

Daniel Todes