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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

how to do the form save action using a x++ job

(0) ShareShare
ReportReport
Posted on by 70

i have created transfer order using x++ job

but i need to do the save process also in the same job

am not able to get the whole formdatasource reference but somehow managed to call the Validatewrite() method but its not working as standard process because of the formdatasource refernce problem

how to do the save process using x++ job in d365

I have the same question (0)
  • nmaenpaa Profile Picture
    101,160 Moderator on at

    There is no form and no FormRun involved when you run a job. What exactly do you mean by "do the save process"? 

    Could you please share your job and tell us what issues you have with it? 

  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Ram,

    Please elaborate as the jobs in the AOT have been deprecated. You can now use runnable classes. Please share what you did so far, so we can help you.

  • WillWU Profile Picture
    22,361 on at

    Hi ram,

    As mentioned above, there is no FormRun when you run a job.

    Are you going to add some logic to validate the data? You can easily add them into the method that create the transfer order.

    And when you run the runnable class, the data will be saved, so what do you mean by "save process"?

  • ram_ind Profile Picture
    70 on at

    hi guys

    little correction its not a job it is class and am trying to call that class using custom web service integration.

    succesfully am able create the order and now i have to save the data in the form

    here is the code that i have used

    args.name(formStr(InventTransferOrders));

           args.caller();

           args.record(InventTransferLine::find(inventTransFerLine));

           formRun = ClassFactory.formRunClass(args);

           formRun.init();

           formRun.run();

    for (int i = 0; i <= formRun.dataSourceCount(); i++)

    {

    if(formDataSource.table() == tablenum(InventTransferLine))

    formDataSource  = formRun.datasource(i);

    formdatasource.validateWrite();

    }

    when i click the save button manually it hits the formdataource.inventTransFerLine.validatewrite()

    here am able to call that method but its not performing the standard validation

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You can't use FormRun in web service integrations, either.

    You can simply call inventTransferLine.validateWrite() to call the validation logic in the table.

    Any validations on the form are not relevant when you're not entering data using that form.

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 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans