David Castillo
2008-05-15 19:15:02 UTC
I'm trying to update a PO line from code.
I have a form that opens from the PO line passing the PO line record.
On that form, I update a location field that I want to carry over to the PO
line record.
I have code on that form to do an update of the InventDim table based on the
PO's InventDimId.
When I debugg it, it updates fine but when I refresh the PO line record, it
still has the original LocationId that was on the PurchLine and InventDim
tables.
Any ideas why that is not taking? Below is the code on the form that open
from the PO line. Please let me know if you have other methods of updating
the InventDim on a PO line. Thanks.
ttsbegin;
select forupdate localInventDim where localInventDim.inventDimId ==
purchLine.InventDimId;
if(localInventDim)
{
localInventDim.inventBatchId = formInventBatchId.text();
localInventDim.InventLocationId = formInventLocationId.text();
localInventDim.wMSLocationId = formwMSLocationId.text();
localInventDim.update();
}
ttscommit;
ttsbegin;
select forupdate localPurchLine where localPurchLine.RecId ==
purchLine.RecId;
if(localPurchLine)
{
localPurchLine.PurchReceivedNow =
any2real(formTotalFootage.valueStr());
localPurchLine.update();
}
ttscommit;
element.args().record().reread();
I have a form that opens from the PO line passing the PO line record.
On that form, I update a location field that I want to carry over to the PO
line record.
I have code on that form to do an update of the InventDim table based on the
PO's InventDimId.
When I debugg it, it updates fine but when I refresh the PO line record, it
still has the original LocationId that was on the PurchLine and InventDim
tables.
Any ideas why that is not taking? Below is the code on the form that open
from the PO line. Please let me know if you have other methods of updating
the InventDim on a PO line. Thanks.
ttsbegin;
select forupdate localInventDim where localInventDim.inventDimId ==
purchLine.InventDimId;
if(localInventDim)
{
localInventDim.inventBatchId = formInventBatchId.text();
localInventDim.InventLocationId = formInventLocationId.text();
localInventDim.wMSLocationId = formwMSLocationId.text();
localInventDim.update();
}
ttscommit;
ttsbegin;
select forupdate localPurchLine where localPurchLine.RecId ==
purchLine.RecId;
if(localPurchLine)
{
localPurchLine.PurchReceivedNow =
any2real(formTotalFootage.valueStr());
localPurchLine.update();
}
ttscommit;
element.args().record().reread();