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

Announcements

No record found.

News and Announcements icon
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,157
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,635 Super User 2026 Season 1 on at
    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,157 on at
    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 512 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 386

#3
Adis Profile Picture

Adis 259 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans