I was very intrigued by the code example you gave. I see here that a USING expression is appended to the process call. I'm really not sure why. I thought that processes that run sequentially automatically inherit their predecessor's context - though there have been times when I have been unable to make that work for me. So the USING clause here appears redundant.
Is it redundant?
The manual says:
If a process requires process input then instances of the business objects representing the process input will be automatically taken from the current Context when the action is executed. It is also possible to explicitly indicate this input, for example,
If Policy.State = ’Open’ Then CalculatePremium USING Policy
The process input must be used explicitly in the action if it represents a reference attribute. For example,
If Customer.CurrentPolicy.State = ’Open’ Then CalculatePremium USING Customer.CurrentPolicy
<<<<<<<<<<
I guess this means that "USING Customer.CurrentPolicy" puts the CurrentPolicy instance into the context?
Here is what I'm trying to do.
The user wants to add a new account. They do this by clicking on a menu item that starts the process "Account_Add". This is currently defined as:
ENTER NEW Account USING Main
DISPLAY MESSAGE 'Account '+Account.AccountID+'
was created'
View Account USING Main
With the Account form on the screen they click on the "Add new item" button on the Main Contact reference. I mean here the small button that Aware generates automatically for reference items. That will display the entry screen for a Contact. When the Contact form's Create button is clicked I want to detect if the new Contact matches any existing Contacts. For the sake of this example, lets say its a match if the last names are equal and if the first names start with the same letter.
At that point I want to display a list of potential matches.
If they select a Contact from the list, that Contact will become the Account's Main Contact.
If they don't select a Contact from the list, the record they were in the process of creating will be created and will become the Account's Main Contact.
So far, I can't see a way to do this. Mostly because I can't get my hands on the process that adds the Contact to the Account.
thanks,
Terry