Accessing state of multi-select picklist

Accessing state of multi-select picklist

I have a form to record orders taken in which a sales type has to be selected (Retail, Trade, etc).

I wish to summarise this information in a scripted form, whose only purpose will be the presentation of summary information from other forms - i.e. not a data-input form.

I have added a lookup multi-select checkbox that looks like this:

[ ] Retail
[ ] Trade
[ ] etc

I have added an unbound numeric field for populating with the number of matching orders taken.

I have created a script which correctly counts the number of orders by date selection, but I cannot get it to filter by sales type, simply because I cannot work out how to access the state of each entry in the checkbox list.

What I want to do is something like:


sumOrders = 0;
MatchingOrders = Orders [(Ordertaken >= input.Orderdatefrom && Ordertaken <= input.Orderdateto)];
for each xxx in MatchingOrders
{
If (input.Salestype[xxx.Salestype].State == True)
{
sumOrders = (sumOrders + xxx.Quantity);
}
}
set Ordercount = sumOrders;












Obviously "If (input.SalesType[xxx.Salestype].State == True)" is not the correct syntax, but is there a way to do this?

The application is "Trident Order Manager" and has already been shared with you in order to resolve a previous issue.

Any help would be gratefully received!

Many thanks

Chris Roberts