Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Costing Method error when using Item Template

(2) ShareShare
ReportReport
Posted on by
I'm trying to create an Item via Item Template. In Item Template, Costing Method is Average. However after creating the Item via Item Template, It keeps the Costing method as FIFO which is the default value of that particular field which using the Costing Method Enum. It's not overriding the Default Costing Method field in Inventory Setup either.
 
Error is creating from below procedure.
codeunit 1336 /Item Templ. Mgt./
 
internal procedure InitFromTemplate(var Item: Record Item; ItemTempl: Record /Item Templ./; UpdateExistingValues: Boolean)
 
for i := 3 to ItemTemplRecRef.FieldCount do begin
            ItemTemplFldRef := ItemTemplRecRef.FieldIndex(i);
            if TemplateFieldCanBeProcessed(ItemTemplFldRef.Number, FieldExclusionList) then begin
                ItemFldRef := ItemRecRef.Field(ItemTemplFldRef.Number);
                EmptyItemFldRef := EmptyItemRecRef.Field(ItemTemplFldRef.Number);
                EmptyItemTemplFldRef := EmptyItemTemplRecRef.Field(ItemTemplFldRef.Number);
                if (not UpdateExistingValues and (ItemFldRef.Value = EmptyItemFldRef.Value) and (ItemTemplFldRef.Value <> EmptyItemTemplFldRef.Value)) or
                   (UpdateExistingValues and (ItemTemplFldRef.Value <> EmptyItemTemplFldRef.Value))
                then begin
                    ItemFldRef.Value := ItemTemplFldRef.Value;
                    FieldValidationList.Add(ItemTemplFldRef.Number);
                end;
            end;
        end;
 
Seems like an error. What do you think?
  • HVGEEL Profile Picture
    HVGEEL 286 on at
    Costing Method error when using Item Template
    Thank you for pointing that out.
    I was unaware of that bug.
     
    Pretty crucial if it slips unnoticed.
  • Verified answer
    gdrenteria Profile Picture
    gdrenteria 13,057 Most Valuable Professional on at

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! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans