web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Avoid showing a prompt on Trade agreement journal posting

(1) ShareShare
ReportReport
Posted on by 3,155
I have created a custom Trade agreement journal workflow with an Automated task that will post the Trade agreement journal once it has been approved.
 
I was hoping to simply call the posting class, PriceDiscAdmCheckPost, through the main method with my own custom Args object.
However, I've noticed that it calls the 'prompt()' method which it gets from extending 'RunBaseBatch'.
Because workflow is not a UI side call, it is not happy with that 'prompt()' call and errors out.
 
Are there any tools at our disposal, as x++ developers, to avoid that 'prompt()' call?
My goal here was to use the standard code for the posting.
I have the same question (0)
  • Suggested answer
    Anton Venter Profile Picture
    20,343 Super User 2025 Season 2 on at
    Avoid showing a prompt on Trade agreement journal posting
    The main method is meant for calling from the UI i,e. menu item etc, that's why there's a call to the prompt method in the main method. Instead of using the main method, just use the runOperation / run method like the main method does but without calling the prompt method.
  • Verified answer
    b_radlyjames Profile Picture
    3,155 on at
    Avoid showing a prompt on Trade agreement journal posting
    Anton,
     
    Thank you for the response.  If you look at the 'main' method of this class, you will notice that there is some other setup occurring to prep the object before it does 'runOperation'.  I think these method calls are necessary, however, some of them are protected and can't be called outside of the class.  It appears that this class is not meant to be called outside the UI.
     
    EDIT:
    A little bit more info on this.  Inside the main method there are also calls to methods in the 'checkpost' class and other classes that can't be called outside of the ApplicationSuite model.  There doesn't seem to be anyway around this which leads me to believe that the only way to post Trade agreement journals is through the UI.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans