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.
Please any one help me to solve this issue.
*This post is locked for comments
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.
Please any one help me to solve this issue.
*This post is locked for comments
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.
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;
I tried to change this coding in debugging time its not getting changed .
from where should i change this coding.
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
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;
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.
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
without debugging, is there any other ways to solve this issue?
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.
You can activate debugger and check where you are exactly the error
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,458 Most Valuable Professional
nmaenpaa 101,156