Skip to main content

Notifications

Business Central forum
Unanswered

Planning worksheet calculate regenerative plan with error

Posted on by 231
Hi All,
 
Subj: Planning worksheet calculate regenerative plan with error : "The record in table Inventory Profile already exists. Identification fields and values: Line No.='1'
 
We needed to add an extra filter in the code for the ForecastConsumption() function within the Inventory Profile Offsetting codeunit. To achieve this, we used the OnBeforeForecastConsumption() event, moving all the code from the function into this event and setting the Handler to TRUE to prevent the standard code from executing.
However, we encountered an error that says, 'Inventory Profile already exists with identification values: Line No = 1.'

For testing, we removed all our custom filters and ran the planning process using only the standard code within the event, but the error still persisted.
 
Kindly suggest.
Categories:
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 1,529 on at
    Planning worksheet calculate regenerative plan with error
    To fix the "Inventory Profile already exists" error, check for existing records with Line No. = 1 before running your planning worksheet.
    In your OnBeforeForecastConsumption() event, add logic to ensure you only insert or modify records if they don't already exist. Use debugging tools to trace the issue and confirm that no other customizations are causing conflicts.

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,459 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,358 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans