Form InventOnhandItem and display modifier by two datasources

Hello
There is a form InventOnhandItem. I want to display info of InventSerial.ProdDate into grid of InventOnhandItem. Normaly i would use display method modifier on one of the InventOnhandItem Data Sources (InventSum or InventDim) but InventSerial  relation needs InventSum.itemId and InventDim.InventSerialId.It is imposible to find InventSerial record using simple display modifier like this:
display InventSerialProdDate prodDate (inventSum _invSum)
or this
display InventSerialProdDate prodDate (InventDim _invDim)

Because I need both _invSum.itemId and _invDim.inventserialId. From InventDim_DS i cannot see current InventSum.ItemID or from InventSum_DS I cannot see InventDim.InventSerialId. I tried looking at InventDimCtrl_Frm_OnHand class with no luck :(
So what could be the solution to display InventSerial.ProdDate into InventOnhandItem form`s grid joining by InventSum.ItemId and inventDim.InventSerialId

Found solution myself. I used xrecord.joinChild();
So the full solution:
  display InventSerialProdDate prodDate (inventSum _invSum)
   InventDim   invDim;
   ;
   invDim = _inventSum.joinChild();
   return InventSerial::find(invDim.inventSerialId,_inventSum.ItemId).ProdDate;

Another solution to put in table inventsum 
display  InventBatchExpDate InventBatch_ExpDate()
{
    InventDim   inventDim;
    ;
    inventDim = this.joinChild();
    return InventBatch::find(inventDim.inventBatchId,this.ItemId).expDate;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.