Table extension is not working in Ax 2012 R3

I have created table extension for InventJournalTrans by using Serialization process.

When I tried to pack the table it is not working. 

 

This is the code I'm using to pack the table.

select Recid from inventJournalTrans
       where inventJournalTrans.RecId == _inventJournalTransRecid;

inventJournalTransExt = inventJournalTrans.inventJournalTransExt();
inventJournalTransExt.SendToWMS = Noyes::Yes;
inventJournalTrans.packInventJournalTransExt(inventJournalTransExt);

 

Please correct where I am doing wrong.

Thanks in advance.

  • Can anyone suggest me ?
  • In reply to Rajendra:

    I think you should be calling the inventJournalTrans.update() after pack.
  • In reply to Kranthi:

    Thanks for the reply Kranthi,

    No I debugged the code, after inserting the data into inventJournalTrans only I'm calling the pack

    here is the path.

    BomReportFinish.updateBOMConsumption();
    line num 91 : journalTransData.insert();

    after above line I wrote below code to pack the table

    select Recid from inventJournalTrans
    where inventJournalTrans.RecId == _inventJournalTransRecid;

    inventJournalTransExt = inventJournalTrans.inventJournalTransExt();
    inventJournalTransExt.SendToWMS = Noyes::Yes;
    inventJournalTrans.packInventJournalTransExt(inventJournalTransExt);
  • In reply to Rajendra:

    In that case you need to be doing it before the insert(). Look at \Classes\SMAServiceFunctionLine_Transfer\createProjJournalLine_ItemConsum

    If you want to do it after the insert(), then you should call the update.
  • In reply to Kranthi:

    Kranthi Can you please suggest how to call update here
  • In reply to Rajendra:

    why cannot you move your code to the place before journalTransData.insert();?
  • In reply to Kranthi:

    I tried to move my code above it. Still facing same issue.

    While debugging the code, I can see that inventjournalTrans recid is creating in journalTransData.insert(); method.
  • In reply to Rajendra:

    Can you show your code (after moving it to before insert)?
    You don't have to do a select, the below code is not required if you are moving the code before insert()
    select Recid from inventJournalTrans
    where inventJournalTrans.RecId == _inventJournalTransRecid;
  • In reply to Kranthi:

    Thanks Kranthi Working fine,

    I have commented this code

    //select Recid from inventJournalTrans where inventJournalTrans.RecId == _inventJournalTransRecid;

    Now its working before insert the actual table and packing the data.

    inventJournalTransExt = inventJournalTrans.inventJournalTransExt();
    inventJournalTransExt.SendToWMS = bomExt.SendToWMS;
    inventJournalTrans.packInventJournalTransExt(inventJournalTransExt);

    journalTransData.insert();

Related
Recommended