Skip to main content

Notifications

Microsoft Dynamics AX forum

can.t have unallocated cost on planning formula

Posted on by 180

I have made an inventory closing and I got this error message:

can.t have unallocated cost on planning formula

It only tells me the item number that has the error, not the transactions.  There are many transactions on this items.  Did anyone had this message in the past and what was the solution to solve the problem.

I cannot cancel the closing, the button is not available, I can only resume the inventory closing once the problem is corrected.  In the mean time many transactions are blocked which is crucial.

thanks

*This post is locked for comments

  • Suggested answer
    Ankit Mehta Profile Picture
    Ankit Mehta 20 on at
    RE: can.t have unallocated cost on planning formula

    Hello Everyone, I had the same issue and tried the solutions mentioned by Andrejs, and it worked.

    if you are still getting the error, please check the access permission of modules on Ledger calendar period (GL \ Setup \ Ledger \ Ledger calendar)

    There is hotfix, very well explained in below link (how error got generated), you can also try installing hotfix KB 2935085 instead executing job directly.

    axmartina.wordpress.com/.../invent-recalculation-error

    Thank You

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: can.t have unallocated cost on planning formula

    Hello Andrejs Opsis,

    My customer is facing this issue every month end recalculation and error thrown for particular item, can you please suggest a permanent fix for this issue.

    Thanks,

    Pavan

  • ColbyGallagher Profile Picture
    ColbyGallagher 3,664 on at
    RE: can.t have unallocated cost on planning formula

    Hi Andrejs, just confirming this worked for a client that had this exact issue, thanks for the code!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: can.t have unallocated cost on planning formula AX2012

    Hello,

    I have experienced this issue in one of my customers. In their case the problem was that those items where included in a formula using total cost allocation and didn't have an active cost.

    The solution is as easy as activating a cost price for those items.

    I hope that helps.

    Marc

  • Suggested answer
    Andrejs Opsis Profile Picture
    Andrejs Opsis 20 on at
    RE: can.t have unallocated cost on planning formula AX2012

    Hi!

    If "Prodtable"  is created by your class be sure to fill in both fields

    prodTable.QtySched ,

    prodTable.RemainInventPhysical (!!!)  if this =0 ,

         then on "start" production, there will not be generated records in table "InventTransOriginAssemblyComponent".

    JOB: create/restore records :

    static void adp_3819_RestoreAssembly(Args _args)

    {

       InventTransOrigin   InventTransOrigin_prod;

       InventTransOrigin   InventTransOrigin_raw;

       inventTransOriginAssemblyComponent inventTransOriginAssemblyComponent_prod;

       inventTransOriginAssemblyComponent inventTransOriginAssemblyComponent_raw;

       inventTransOriginAssemblyComponent inventTransOriginAssemblyComponent_new;

       int i,k;    

       int                     starttime;

       ;

       Starttime = timenow();

       while select InventTransOrigin_prod

           where

               //InventTransOrigin_prod.ItemId == '8035' &&

               InventTransOrigin_prod.ReferenceCategory == InventTransType::Production

           notExists join inventTransOriginAssemblyComponent_prod

               where inventTransOriginAssemblyComponent_prod.ASSEMBLYINVENTTRANSORIGIN == InventTransOrigin_prod.RecId

       {

           k++;

           while select InventTransOrigin_raw

               where

                   InventTransOrigin_raw.ReferenceCategory == InventTransType::ProdLine &&

                   InventTransOrigin_raw.ReferenceId == InventTransOrigin_prod.ReferenceId

           notExists join inventTransOriginAssemblyComponent_raw

               where

                   inventTransOriginAssemblyComponent_raw.ASSEMBLYINVENTTRANSORIGIN == InventTransOrigin_prod.RecId &&

                   inventTransOriginAssemblyComponent_raw.ComponentInventTransOrigin == InventTransOrigin_raw.RecId

           {

               inventTransOriginAssemblyComponent_new = null;

               inventTransOriginAssemblyComponent_new.AssemblyInventTransOrigin  = InventTransOrigin_prod.RecId;

               inventTransOriginAssemblyComponent_new.ComponentInventTransOrigin = InventTransOrigin_raw.RecId;

               inventTransOriginAssemblyComponent_new.insert();

               i++;

           }//while

       } //while

       info(strFmt("Total procesed %1, created lines %2", k, i));

       info(strfmt('Time %1',  time2str(timenow()- starttime, 1 , 1 )));

       //info(strfmt("%1: ttsLevel %2 ", '', appl.ttsLevel() ) );

    }

  • Martina Bergamo Profile Picture
    Martina Bergamo 1,470 on at
    RE: can.t have unallocated cost on planning formula AX2012

    Hi! I have the same issue!

    The item that produced the error is not included in the table InventTransOriginAssemblyComponent, but it has "Formula" as production type.

    Any ideas?

    Thanks.

    Martina

  • Francesco Profile Picture
    Francesco 520 on at
    RE: can.t have unallocated cost on planning formula AX2012

    I see something similar in our system and just ran it briefly through the debugger.

    It appears that the item that produces the error is not included in the table InventTransOriginAssemblyComponent, which should contain information on all assembled items and their components.

    Basically it is trying to find the item that this part belongs to.

    In the item setup I notice that the item does not have any production type. This does seem to constitute a planning item in the code.

    Like shivrav says, the solution could be as simple as selecting a production type for your item.

  • Shivraj Profile Picture
    Shivraj 15 on at
    RE: can.t have unallocated cost on planning formula AX2012

    U r applying formule on Planning Item rather on formule item

  • Weaveriski Profile Picture
    Weaveriski 23,616 on at
    RE: can.t have unallocated cost on planning formula AX2012

    I would suggest a developer debug the message to tell you the table that is causing the error to be called, it is not the one you would expect - although you may want to look in the equivalent of the ProdBOM where a formula could be attached to a batch order, but I do not know the name of the table. Otherwise you have covered the obvious so we would need guidance.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: can.t have unallocated cost on planning formula AX2012

    Thank you for your fast response.  

    I have checked all the tables and all the ones that are pmf or pds related are all blank.  Also, the formula table is blank too.  Would you be able to suggest any other tables?  

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

News and Announcements

Give Back to the Community this Month

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans