Quantcast
Channel: Martin Dráb's Activities
Viewing all articles
Browse latest Browse all 17532

Calling Action MenuItem: PurchCancel from X++

$
0
0

Hi All,

I am calling an action menu item, PurchCancel from my own RunBaseBatch class as follows. 

Args args = new Args();
args.record(purchLine.purchTable());
args.parmEnum(NoYes::Yes);
args.caller(this);
new MenuFunction(menuitemActionStr(PurchCancel), MenuItemType::Action).run(args);

Then I get the following prompt because of the purchCancel.prompt() code in PurchCancel.mainOnServer method.

protected static void mainOnServer(PurchTable _purchTable)
{
    PurchCancel purchCancel = PurchCancel::construct();
    purchCancel.parmPurchTable(_purchTable);

    if (purchCancel.prompt())
    {
        purchCancel.runOperation();
    }
}

Then if I click OK, I get an error saying that An unbalanced X++ TTSBEGIN/TTSCOMMIT pair has been detected... 

1)how can I avoid this prompt() and 2) also solve this unbalanced X++ TTSBEGIN/TTSCOMMIT Pair issue?

Thank you. 


Viewing all articles
Browse latest Browse all 17532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>