Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Posting Item Charges to Production Output Customization

(1) ShareShare
ReportReport
Posted on by 32
Hi,
 
 
I want to do absorption costing to add some actual charges to production output using item charges.
 
Here is a sample of what i was trying to achieve however i get an error.
 
Has anyone customized item cahrges to post using journals?
 
var
                    ItemJnl: Record "Item Journal Line";
                    ItemJnlPostLine: Codeunit "Item Jnl.-Post Line";
                begin
                    ItemJnl.Init();
                    ItemJnl."Posting Date" := TODAY;
                    ItemJnl."Journal Template Name" := 'ITEM';
                    ItemJnl."Journal Batch Name" := 'DEFAULT';
                    ItemJnl."Document No." := 'Testing';
                    ItemJnl."External Document No." := 'test';
                    ItemJnl."Item No." := '1000';
                    ItemJnl.Validate("Item No.");
                    ItemJnl."Item Charge No." := 'JB-FREIGHT';
                    ItemJnl.Description := 'JB-FREIGHT';
                    ItemJnl."Document Line No." := 20000;
                    ItemJnl."Unit of Measure Code" := '';
                    ItemJnl.Quantity := 1;
                    ItemJnl."Qty. per Unit of Measure" := 1;
                    ItemJnl."Invoiced Quantity" := 1;
                    ItemJnl."Invoiced Qty. (Base)" := 1;
                    ItemJnl.Amount := 400;
                    ItemJnl."Unit Cost (ACY)" := 400;
                    ItemJnl."Unit Cost" := 400;
                    ItemJnl."Applies-to Entry" := 330;
                    ItemJnl."Gen. Prod. Posting Group" := 'SERVICES';
                    ItemJnl.Insert();
 
 
 
 
                    Message('Inserted');
 
                    //ItemJnlPostLine.RunWithCheck(ItemJnl);
 
                end;
 
The error
Error message: 
The Item Ledger Entry does not exist. Identification fields and values: Entry No.='0'

 
 
AL call stack: 
"Item Jnl.-Post Line"(CodeUnit 22).PostItem line 73 - Base Application by Microsoft
"Item Jnl.-Post Line"(CodeUnit 22).Code line 133 - Base Application by Microsoft
"Item Jnl.-Post Line"(CodeUnit 22).PostSplitJnlLine line 12 - Base Application by Microsoft
"Item Jnl.-Post Line"(CodeUnit 22).RunWithCheck line 16 - Base Application by Microsoft
"Item Jnl.-Post Batch"(CodeUnit 23).PostLines line 48 - Base Application by Microsoft
"Item Jnl.-Post Batch"(CodeUnit 23).Code line 56 - Base Application by Microsoft
"Item Jnl.-Post Batch"(CodeUnit 23).OnRun(Trigger) line 6 - Base Application by Microsoft
"Item Jnl.-Post"(CodeUnit 241).Code line 25 - Base Application by Microsoft
"Item Jnl.-Post"(CodeUnit 241).OnRun(Trigger) line 3 - Base Application by Microsoft
"Item Journal"(Page 40)."Post - OnAction"(Trigger) line 2 - Base Application by Microsoft
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,673 Super User 2024 Season 2 on at
    Posting Item Charges to Production Output Customization
    Although there is an Item Charge No. field in the Item Journal, you cannot post from this page.
    It is recommended that you customize it in the Purchase Order
    If you just want to increase the item cost, you can use the item revaluation journal
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,262 Super User 2024 Season 2 on at
    Posting Item Charges to Production Output Customization
    Hi,
     
    Make sure that the the Item Ledger Entry table have a record where Entry No. = 330.
     
    Otherwise you can set 0 for Applies-to Entry.
     
     
    Best regards,
    Mohamed Amine MAHMOUDI

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,379 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans