Salesforce

How Do I Let the End User Mark Several Records in a Table and Handle the Marked Records (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

How Do I Let the End User Mark Several Records in a Table and Handle the Marked Records Collection? (Magic xpa 4.x)

Sometimes it is helpful to allow a user to select several items from a list. Magic xpa has a built-in facility to do this, in the multi mark functions.

Preparing the table for multi marking

The properties of the table have to be set up before multi-marking is available.

  • In the table properties, set Multi marking to Yes.

Now, the user can select multiple records from this table.

Handling marked records

Once the records are selected, you need to process them. Typically this would mean writing the records out to another table for further processing, but in our example we just give the user a message.

  1. Create an event that will be raised when it is time to handle the marked records. In our example, we use a push button that raises the event “ge.Start”.

  2. In the handler for the event, process the record as if it were just the current record. In our example, the user will get three messages, one for each record selected. This is true even though there is no block loop involved.

Other processing using MM functions

  1. Within the event, you can use MMStop() to exit the processing before all the marked records are handled. When MMStop() is executed, the engine will park on the record that was being processed when the MMStop() was executed.

  2. You can execute code after all the records are processed by using a block with the expression

MMCurr()=MMCount(0)

MMCurr() will be the number of the record currently being processed, while MMCount(0) is the total number of records.

In our example we use this test to clear the multi marking after the last record is processed.

  1. MMClear() unmarks all marked records.

See also

The Online Samples project (program EL07)

Reference
Attachment 
Attachment