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

Notifications

Announcements

No record found.

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,473 Super User 2025 Season 2 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
    463 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

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 2,092

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans