Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Production Control Base DP report AX 2012 R3

Posted on by 61
////
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I'm working on a conditional logic issue in my X++ code. I need to filter records from the ProdTable where the Production ItemId is 'Item-003366,' and this specific item number has many consumption records in its lines.

In the first line of consumption, I have an ItemNumber set to 'Item-001674.' What I want to do is further explode this 'Item-001674' to display its lines, and I need to find the first occurrence of 'Item-003366' in the report.

I'm encountering an issue in my code where I'm checking if _itemId is equal to 'Item-001674.' When it is, I call the ExplodFormulaItemConsumption method. However, when _itemId is 'Item-001674,' it seems that the code within the ExplodFormulaItemConsumption method runs indefinitely, and it doesn't return to the outer loop. I'm not receiving any error messages, but the code isn't behaving as expected when _itemId is 'Item-001674.'

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    Production Control Base DP report AX 2012 R3
    Please use the debugger to find out more about what's happening in explodFormulaItemConsumption().
     
    Note that you may be able to simplify testing by calling explodFormulaItemConsumption() from a runnable class, rather than through the report and insertData() method, because your description suggests that they aren't related to the current problem. You just need to call explodFormulaItemConsumption() with the right parameters (such as _itemId = 'Item-001674').

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans