In order to un-mark transactions that were previously marked via X++, use the code below:
CustVendOpenTransManager manager;
Common originator;
// Set the originator code from a record.
originator = element.args().record();
manager = CustVendOpenTransManager::construct(originator);
// If there are marked transactions, clear them
if (manager.getSpecTransCount() > 0)
manager.resetMarkedTrans();
Obviously the code above shows some flexibility using the common and loading the framework from different forms. If you just want to clear out a customer's marked transactions in a quick way, you can use the code below and simple replace the customer number with the one you are interested in clearing out. Easy enough.
static void unmarkAllTransByCustomer(Args _args)
{
CustTable custTable = CustTable::find('C00023567');
CustVendOpenTransManager manager = CustVendOpenTransManager::construct(custTable);
if (manager.getSpecTransCount() > 0)
manager.resetMarkedTrans();
}
is there any way to know who (user) is currently marking the transactions?
ReplyDeleteThere is but I don't believe there is anything from a functional standpoint to help indicate who is using that record out of the box. It's been a while since I've seen the screen but I believe it was a modification (not a big one).
DeleteIt was helpful for a few clients I had when stepping on toes in the matching process was sometimes an issue.
Hi Justin! Can you please give me a hint about that modification ( about the user who marked the transaction ) ?
DeleteThe mod was from AX 4.0 and upgraded to 2009. From what I recall, it had a physical field added to the marking transaction table. I don't remember the specific table names but there was a link created when a transaction is marked. In 2012, you should be able to use the 'modified by' field on the table/field when the record is created. You'll then need to add it to the form so the end users can see who marked it. It's literally been 6 years since I did this last so the above may not make any sense but its what I remember :-) For what its worth.
Delete