Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 1 PlanDynamics 365 release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
2022 release wave 1 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
Does anyone know how to (for an example) manually cancel ex 30 selected items out of 100 items ( with Delivery Remainder) on a Sales order in a fast way via a job in AOT (AX2012)?
I have this code ( left pic below) to cancel one "Order -row" at the time. In this ex, row "2" is about to be cancel.
But I need a code to cancel selected lines (rows) in an order ( for ex, see the yellow in the pic below to the right, and this code doesn´t work):
Note, I don´t want to cancel ALL the lines in the order that have Delivery Remainder, I only want to cancel the "order-rows" that I write in the code.
And I don´t want to Delete the lines either.
Does anyone have a good tip on how this could be possible?
We are starting to work with Backorders, and we need to cancel blocked articles that slip through, in a fast way.
regards / BCC
Can you please tell us more about your problem than just "this code doesn´t work"?
By the way, why do you use doUpdate() in the first transaction (instead of update() or write()) and what's the point of the second transaction, where you update no fields but you call write()?
Hi, I didn´t create this particular (top image) code myself, so I don´t know why “DoUpate ()” and “write ()” were used.
But our idea was that we want for example to write all the "linenumbers" on a SO to be canceled, of which my example was with several "number-rows" in a line.
So that, in the below pic, was just an example of how we would like it to work.
The top ( see pics) code works, if you just want to cancel linenumber "2", but the bottom code doesn´t works.
The Error message- code “Error executing code: (object) does n´t have a valid code that can be executed in 'SalesCancel “ appears.
Your code currently doesn't execute at all, because it's not compiled.
Compile your job and fix compilation errors, if there are any. Then run it again.
When I write in the code, as I want it with several "line numbers", and then try to compile the code, I get the error message "Err: 9999".
So I'm a little stuck there.
So you know, I´m quite new with codes in AX2012 R3 :)..
You can run your code before you compile it, therefore you can't ignore the error.
Please look at the compiler output - doesn't it show any error message and the line number?
I see the error - you can't use a comma-seprated list of values. Do this instead:
&& ( salesLine.LineNum == 2
|| salesLine.LineNum == 4
|| salesLine.LineNum == 89)
Wow, it works :)
Thank you very much
Business Applications communities