Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Item Creation Error

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

While creating item its showing following error.Department->LS Retail->BackOffice->Product Design->Retail Item->New(when i am clicking this its showing following error.

item-creation-error.JPG

Please any one help me to solve this issue.

*This post is locked for comments

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    Tharanga Chandrasekara 23,116 on at
    RE: Item Creation Error

    In the code you need to check if the "No." field actually have a value and then need to check if the GET statement return any dataset. If the "No." does not have an value then you will get an error like you mention. 

    You need to modify the code as below 

    IF "No." <> '' THEN 
      IF (Type = Type::Item) AND ( lItem.GET("No."))THEN BEGIN
       // code goes here.... 


    Just try this. Most probably this will workout. If this does not solve the error, then let us know. 

  • Vidura Dananjaya Profile Picture
    Vidura Dananjaya 123 on at
    RE: Item Creation Error

    IF (Type = Type::Item) AND  lItem.GET("No.") THEN BEGIN

    IF lItem."Fuel Item" THEN BEGIN

    lFcDeliveryTrans.SETCURRENTKEY("Document Type","Document No.","Line No.");

    lFcDeliveryTrans.SETRANGE("Document Type",lFcDeliveryTrans."Document Type"::Purchase);

    lFcDeliveryTrans.SETRANGE("Document No.", "Document No.");

    lFcDeliveryTrans.SETRANGE("Line No.", "Line No.");

    lFcDeliveryTrans.SETRANGE(Received, FALSE);

    IF lFcDeliveryTrans.FINDSET(TRUE,TRUE) THEN

    REPEAT

    lFcDeliveryTrans."Document Type" := lFcDeliveryTrans."Document Type"::" ";

    lFcDeliveryTrans."Document No." := '';

    lFcDeliveryTrans."Line No." := 0;

    lFcDeliveryTrans.MODIFY(TRUE);

    UNTIL lFcDeliveryTrans.NEXT = 0;

    END;

    END;

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Item Creation Error

    I tried to change this coding in debugging time its not getting changed .

    from where should i change this coding.

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Item Creation Error

    IF Type = Type::Item THEN BEGIN

    lItem.GET("No.");  --> This line has problem 

    IF lItem."Fuel Item" THEN BEGIN

    lFcDeliveryTrans.SETCURRENTKEY("Document Type","Document No.","Line No.");

    lFcDeliveryTrans.SETRANGE("Document Type",lFcDeliveryTrans."Document Type"::Purchase);

    lFcDeliveryTrans.SETRANGE("Document No.", "Document No.");

    lFcDeliveryTrans.SETRANGE("Line No.", "Line No.");

    lFcDeliveryTrans.SETRANGE(Received, FALSE);

    IF lFcDeliveryTrans.FINDSET(TRUE,TRUE) THEN

    REPEAT

    lFcDeliveryTrans."Document Type" := lFcDeliveryTrans."Document Type"::" ";

    lFcDeliveryTrans."Document No." := '';

    lFcDeliveryTrans."Line No." := 0;

    lFcDeliveryTrans.MODIFY(TRUE);

    UNTIL lFcDeliveryTrans.NEXT = 0;

    END;

    Change the red color line to  IF ltItem.GET("No.") THEN;

    Hope this will help you

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Item Creation Error

    Hi,

    when i debug its stopped on following code .the above error is  also coming in purchase order deleting time

    IF Type = Type::Item THEN BEGIN
    lItem.GET("No.");
    IF lItem."Fuel Item" THEN BEGIN
    lFcDeliveryTrans.SETCURRENTKEY("Document Type","Document No.","Line No.");
    lFcDeliveryTrans.SETRANGE("Document Type",lFcDeliveryTrans."Document Type"::Purchase);
    lFcDeliveryTrans.SETRANGE("Document No.", "Document No.");
    lFcDeliveryTrans.SETRANGE("Line No.", "Line No.");
    lFcDeliveryTrans.SETRANGE(Received, FALSE);
    IF lFcDeliveryTrans.FINDSET(TRUE,TRUE) THEN
    REPEAT
    lFcDeliveryTrans."Document Type" := lFcDeliveryTrans."Document Type"::" ";
    lFcDeliveryTrans."Document No." := '';
    lFcDeliveryTrans."Line No." := 0;
    lFcDeliveryTrans.MODIFY(TRUE);
    UNTIL lFcDeliveryTrans.NEXT = 0;
    END;

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,749 on at
    RE: Item Creation Error

    It is really hard to find the issue without debugging, so as other suggested please use the debugger. Below is the video how to use it.

    www.youtube.com/watch

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Item Creation Error

    Hi

    You are creating item in ls retail so might be there will be some relationship has been created between nav item and ls retail item and for this some customisation done by add on

    This can easily be find by activating debugger

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Item Creation Error

    without debugging, is there any other ways to solve this issue?

  • Suggested answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: Item Creation Error

    There might be the case that in some reference, related to item list, there is a blank line with empty item ID. As other members mentioned, best option is to use debugger to check the exact location of the error. One fast option is to create manually a line with empty Item ID in the Item table, perhaps it would allow you to create new items, but further on you would anyway need to find the error in data.

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Item Creation Error

    You can activate debugger and check where you are exactly the error

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