Hi,
I have this code where I want to insert an optional field on an order detail but it won't let me set OEORDD.ORDUNIQ when I try to retrieve the order detail record:
What am I doing wrong or am I missing something?
Thanks in advance!
I have this code where I want to insert an optional field on an order detail but it won't let me set OEORDD.ORDUNIQ when I try to retrieve the order detail record:
Code:
adsOEORDH.Order = 0
adsOEORDH.Fields("ORDUNIQ").Value = adsXMBPICK.Fields("ORDUNIQ").Value
If adsOEORDH.Read Then
adsOEORDD.Order = 0
[COLOR=#EF2929]adsOEORDD.Fields("ORDUNIQ").Value = adsOEORDH.Fields("ORDUNIQ").Value 'OEORDD.ORDUNIQ value is always 0[/color]
adsOEORDD.Fields("LINENUM").Value = adsXMBPICK.Fields("LINENUM").Value
If adsOEORDD.Read Then
adsOEORDDO.Fields("ORDUNIQ").Value = adsXMBPICK.Fields("ORDUNIQ").Value
adsOEORDDO.Fields("LINENUM").Value = adsXMBPICK.Fields("LINENUM").Value
adsOEORDDO.Fields("OPTFIELD").Value = "QTYPICKED"
If adsOEORDDO.Exists Then
adsOEORDDO.Fields("VALIFMONEY").Value = adsXMBPICK.Fields("QTYPICKED").Value
adsOEORDDO.Update
Else
adsOEORDDO.RecordGenerate False
adsOEORDDO.Fields("ORDUNIQ").Value = adsXMBPICK.Fields("ORDUNIQ").Value
adsOEORDDO.Fields("LINENUM").Value = adsXMBPICK.Fields("LINENUM").Value
adsOEORDDO.Fields("OPTFIELD").Value = "QTYPICKED"
adsOEORDDO.Fields("VALIFMONEY").Value = adsXMBPICK.Fields("QTYPICKED").Value
adsOEORDDO.Insert
End If
adsOEORDD.Update
adsOEORDH.Update
End If
End If
What am I doing wrong or am I missing something?
Thanks in advance!