web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to use Item template by default when creating new item

(0) ShareShare
ReportReport
Posted on by

I have imported the data through xml port into a table and now iam  creating new items out of it , when i create new items how can i use the item template based on my selection of which template to use.

 is there any event subscriber for that, any help will be great, Thanks

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at
    RE: How to use Item template by default when creating new item

    Please check codeunit 1336 "Item Templ. Mgt."

  • Suggested answer
    Govinda Kumar Profile Picture
    2,304 Moderator on at
    RE: How to use Item template by default when creating new item

    Hi ZAYN T T,

    you can either delete all the other templates except your default template that you want to select. So it will automatically select your template..

    Or else you can add the event from code unit "Item Templ. Mgt." 

        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Templ. Mgt.", 'OnCreateItemFromTemplateOnBeforeSelectItemTemplate', '', false, false)]
        local procedure OnCreateItemFromTemplateOnBeforeSelectItemTemplate(Item: Record Item; var ItemTempl: Record "Item Templ.");
        var
            itemTemplate: Record "Item Templ.";
        begin
    
            itemTemplate.SetFilter(Code, '=%1', 'UER SERVICE'); // 'UER SERVICE is your template that you want to make default
            itemTemplate.Find('-');
    
            ItemTempl := itemTemplate;
        end;

    Hope it helps you.
    Regards
    Govinda Kumar

  • Community Member Profile Picture
    on at
    RE: How to use Item template by default when creating new item

    Thank you, I have one doubt whether we can get the standard template by this, 

    pastedimage1674735220231v1.png

  • Suggested answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at
    RE: How to use Item template by default when creating new item

    Do you mean you have to create template like above? or use one of the templates from those?

  • Community Member Profile Picture
    on at
    RE: How to use Item template by default when creating new item

    I need use of the template above

  • Suggested answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at
    RE: How to use Item template by default when creating new item

    Do you want to use one or both? If one then delete the other one and it will automatically apply.

  • Community Member Profile Picture
    on at
    RE: How to use Item template by default when creating new item

    I have setup page and I can select which one I need and based on the selection item will be created using the template

  • Verified answer
    YUN ZHU Profile Picture
    95,307 Super User 2025 Season 2 on at
    RE: How to use Item template by default when creating new item

    Hi, Sorry I didn't test it in detail. You can change your mind. After the Item is inserted, you can execute the following method.

    codeunit 1336 "Item Templ. Mgt."

    pastedimage1674780911563v2.png

    This is similar to running Apply Template after creating an item on the BC UI.

    pastedimage1674780998565v3.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Manan_Shah Profile Picture
    1,459 on at
    RE: How to use Item template by default when creating new item

    Hi Sainudheen,

    With customization you can fulfil your requirement, But it's little confusing like if you are using multiple config. Template for Item creation then 1 of them you want to use as default. Then what is the use of multiple template creation and purpose of selecting template while create a new Item. Because as choose default template system will apply default template on each new Item creation. So I suggest either use only 1 template. Else as I mention you have to do customization. 

  • Community Member Profile Picture
    on at
    RE: How to use Item template by default when creating new item

    Thanks for the Replies, Here my plan is setup a page and the user can select a template from that at the time of item creation through a function, this function will create 100 items at a time for every 100 item a template can be selected, if there is no template is selected then it will only create item with no template

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans