Phan Trí Hùng
12/13/2005 1:08:00 AM
Thanks Michael, it works correctly.
"Michael" wrote:
> I would think its because you only select the field Qty, but updating the
> whole record. Try doing a select * on it
>
> "Phan Trà Hùng" wrote:
>
> > Hi everyone!
> >
> > I'm trying to update field "Qty" in InventTrans table through X++ every time
> > I modify value in salesLine table. But it throws an error: "The reocord
> > already exists in....". I included my sample code for your examination:
> >
> > ttsbegin;
> > select forupdate firstonly Qty
> > from inventTrans
> > where inventTrans.TransRefId == sca_ShipTable.ReleaseSalesId &&
> > inventTrans.ItemId == this.ShipItem;
> >
> > inventTrans.Qty = -1 * salesQty;
> > inventTrans.update();
> > ttscommit;
> >
> > Can anyone helps me?
> >
> > Thanks in advance.