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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How to recreate the functionality of "Create item from Item No"

(1) ShareShare
ReportReport
Posted on by 160
Hello, I have another table in which I want to implement the functionality of creating a new item card (or other table item) from typing it into (similar to) sales line.
I have a logic in mind which goes as follows
1. after typing into the line column, it will check the existing table for the item whether it exists or not
2. if it does not exists then it will provide a prompt message whether you want to create new item with that name
3. the typed name should be used as the primary key on creation of new item, it should not take the default number series.
4. it open up the card for filling up of further details
5. once done other related fields will get populated into the line
 
please suggest some references to get idea to work up with the code.
I have the same question (0)
  • Suggested answer
    Mustafa Omerbegović Profile Picture
    1,477 Moderator on at
    Hello,

    this what you described is very similar to Create Item from Item No. functionality and maybe the only difference between native functionality and the steps that you are listed is the 3. step where you want to use Name as PK, instead of No. series defined for selected Item Template. You can try using native functionality and set No. series, that will be linked with Item Template as Manual Nos., so that after populating Default Nos. you can change the No. on the Item Card. Since it is a new item you will have no problem with changing No. series.
     
    Greetings
  • Suggested answer
    Dynamics_Decoded_Gokul Profile Picture
    487 on at
    Hi 

    You can use the below to achive your requirement 
     
     GetSalesSetup();
     DefaultCreate := ("No." = '') and SalesSetup."Create Item from Description";
    if Item.TryGetItemNoOpenCard(
      ReturnValue, Description, DefaultCreate, not GetHideValidationDialog(), true)
    then
    case ReturnValue of
        '':
         begin
            LookupRequested := true;
            Description := xRec.Description;
         end;
       "No.":
            Description := xRec.Description;
          else begin
            CurrFieldNo := FieldNo("No.");
            Validate("No.", CopyStr(ReturnValue, 1, MaxStrLen(Item."No.")));
          end;
    end;

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,034 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,199 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,080

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans