Options

Transfer order-Error

idontknowidontknow Member Posts: 66
I have made a field on Purchase order(SPC code-Field name) and after posting that,i am trying to transfer the item which i purchased.But when i am trying to post the transfer order,the system is throwing an error.

Error:
The item ledger entry doesnot exist
Identification fields and values:
Entry No :'3345200',SPC code =''


I tried to debug it,and the control is taking to this code in the code unit(5895) and the cursor is stopped at the arrow mentioned below
UpDateWindow(WindowAdjmtLevel,WindowItem,Text007,WindowFWLevel,WindowEntry);
WITH ItemLedgEntry DO
  IF AppliedEntryToAdjustExists(Item."No.") THEN BEGIN
    CopyILEToILE(ItemLedgEntry,TempItemLedgEntry);
    TempItemLedgEntry.FIND('-');
  [b]--> [/b] REPEAT
      GET(TempItemLedgEntry."Entry No.");
      UpDateWindow(WindowAdjmtLevel,WindowItem,WindowAdjust,WindowFWLevel,"Entry No.");

      RndgResidualBuf.AddAdjustedCost("Entry No.",0,0,"Completely Invoiced");

      ForwardAppliedCost(ItemLedgEntry,FALSE);

      EliminateRndgResidual(ItemLedgEntry);
    UNTIL (TempItemLedgEntry.NEXT = 0) OR LevelExceeded;
  END;

What could be the problem?How should i go about it?

Comments

  • Options
    Alex_ChowAlex_Chow Member Posts: 5,063
  • Options
    ara3nara3n Member Posts: 9,255
    I doubt that somebody deleted the ILE.
    Especially if he is shipping the Transfer Order.

    I see that you added SPC Code as Primary Key into the table???


    Why would you change the ILE PK??
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    idontknowidontknow Member Posts: 66
    ara3n wrote:
    I doubt that somebody deleted the ILE.
    Especially if he is shipping the Transfer Order.

    I see that you added SPC Code as Primary Key into the table???


    Why would you change the ILE PK??

    I think it is not that because of deletion because,the system is throwing the same message .where ever SPC code field is present.

    By the way,the entry is still available in the item ledger entry table.

    Yes i have added the SPC code to primary key,because when i created that field,the system didnt allow me to proceed until it was added to the primary key.It pushed me to add.
  • Options
    ara3nara3n Member Posts: 9,255
    idontknow wrote:
    Yes i have added the SPC code to primary key,because when i created that field,the system didnt allow me to proceed until it was added to the primary key.It pushed me to add.

    [-o<


    remove it from PK ASAP. Have you ever dealt with a database? What system on earth would make you add a field as primary key?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    idontknowidontknow Member Posts: 66
    ara3n wrote:
    idontknow wrote:
    Yes i have added the SPC code to primary key,because when i created that field,the system didnt allow me to proceed until it was added to the primary key.It pushed me to add.

    [-o<


    remove it from PK ASAP. Have you ever dealt with a database? What system on earth would make you add a field as primary key?

    I have removed SPC code field from the primary key,now when i am trying to post a transfer order,the system has thrown an error :

    The field below must be included in the table's primary key.

    Field:SPC code
    Table: Item Ledger Entry


    How should i go about it?
  • Options
    klavinklavin Member Posts: 117
    Man this is scary... A lot of mods that probably should never have happened.

    What code is triggering the error? Are you doing a ILE.GET(EntryNo,SPCCode); somewhere? If so, it needs to be changed.

    I hope this isn't a production database [-o< [-o< [-o< [-o< [-o< [-o<
    -Lavin
    "Profanity is the one language all programmers know best."
  • Options
    idontknowidontknow Member Posts: 66
    klavin wrote:
    Man this is scary... A lot of mods that probably should never have happened.

    What code is triggering the error? Are you doing a ILE.GET(EntryNo,SPCCode); somewhere? If so, it needs to be changed.

    I hope this isn't a production database [-o< [-o< [-o< [-o< [-o< [-o<

    That code ILE.GET(EntryNo,SPCCode) was not written anywhere.

    This is not a production database....
  • Options
    klavinklavin Member Posts: 117
    Use Debugger and let us know what code is causing the error. A GET would require it to be a part of the pk... a bad table relation as well.

    If you have a field with a table relation to ILE, trying to link to the SPC code from the ILE that will not work either.

    Help us help, we need more detail
    -Lavin
    "Profanity is the one language all programmers know best."
  • Options
    idontknowidontknow Member Posts: 66
    klavin wrote:
    Use Debugger and let us know what code is causing the error. A GET would require it to be a part of the pk... a bad table relation as well.

    If you have a field with a table relation to ILE, trying to link to the SPC code from the ILE that will not work either.

    Help us help, we need more detail

    This problem has been solved by our senior consultant.but i want to know why the relation will not work and why did you mention the below statement?

    If you have a field with a table relation to ILE, trying to link to the SPC code from the ILE that will not work either.

    What is the problem with such table relation?I would like to know...so that i will not repeat in the future...
  • Options
    klavinklavin Member Posts: 117
    The tablerelation needs to be of the Primary Key, for example the Item."Vendor No." field is related to Vendor."No." (Vendor's primary key). Or Value Entry."Item Ledger Entry No." is related to "Item Ledger Entry"."Entry No." ; Item Ledger's primary key.

    If for example you wanted to lookup all Item Ledger Entries where the SPC code was "X" you can have the lookup point at Item Ledger Entry and the formlink being where SPC Code = SPC Code on the record.

    Look at the example of the Sales Order Form (42) Order Button > MenuItem: Invoices.
    This runs the Posted Sales Invoices form, and on the property RunFormLink it has it's relation to what you are seeing.
    -Lavin
    "Profanity is the one language all programmers know best."
Sign In or Register to comment.