Hi,
I am using AFS to update Sales Order in session tdsls4100m000. However, some fields are updated while some are not.
This is the code:
**************
stpapi.clear(session.code)
stpapi.put.field(session.code, "tdsls400.orno.segment.1", trim$(str$(i.sales.order)))
stpapi.find(session.code, error.msg)
if not isspace(error.msg) then
error.msg = "Record not found: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
if stpapi.mark(session.code, error.msg) = 0 then
error.msg = "Cannot mark: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
if stpapi.synchronize.dialog(session.code, "modify", error.msg) = 0 then
error.msg = "Cannot open synchonized dialog for updating SQ header: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.form.command(session.code, 5, "open.sales.order", error.msg)
if isspace(error.msg) then
|These fields get updated
stpapi.put.field(session.code, "tdsls400.ofbp", trim$(str$(i.sold.to.bp)))
stpapi.put.field(session.code, "tdsls400.sotp", trim$(str$(i.so.type)))
stpapi.put.field(session.code, "tdsls400.stbp", trim$(str$(i.ship.to)))
stpapi.put.field(session.code, "tdsls400.corn", trim$(str$(i.customer.order)))
|These fields don't get updated
stpapi.put.field(session.code, "tdsls400.refa", trim$(str$(i.reference.a)))
stpapi.put.field(session.code, "tdsls400.refb", trim$(str$(i.reference.b)))
stpapi.put.field(session.code, "tdsls400.cfrw", trim$(str$(i.carrier)))
stpapi.put.field(session.code, "tdsls400.cpay", trim$(str$(i.payment.term)))
|Moreover, if these two fields are uncommented, all of the fields here don't get updated at all
|stpapi.put.field(session.code, "tdsls400.prdt", trim$(str$(i.planned.date)))
|stpapi.put.field(session.code, "tdsls400.ddat", trim$(str$(i.planned.date)))
stpapi.update(session.code, true, error.msg)
if not isspace(error.msg) then
error.msg = "Cannot update SO header: " & error.msg
stpapi.recover(session.code,recov.error.msg)
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.end.session(session.code)
return(error.msg)
**************
I commented the lines showing which fields are getting updated and which fields are not. Please advice.
I am using AFS to update Sales Order in session tdsls4100m000. However, some fields are updated while some are not.
This is the code:
**************
stpapi.clear(session.code)
stpapi.put.field(session.code, "tdsls400.orno.segment.1", trim$(str$(i.sales.order)))
stpapi.find(session.code, error.msg)
if not isspace(error.msg) then
error.msg = "Record not found: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
if stpapi.mark(session.code, error.msg) = 0 then
error.msg = "Cannot mark: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
if stpapi.synchronize.dialog(session.code, "modify", error.msg) = 0 then
error.msg = "Cannot open synchonized dialog for updating SQ header: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.form.command(session.code, 5, "open.sales.order", error.msg)
if isspace(error.msg) then
|These fields get updated
stpapi.put.field(session.code, "tdsls400.ofbp", trim$(str$(i.sold.to.bp)))
stpapi.put.field(session.code, "tdsls400.sotp", trim$(str$(i.so.type)))
stpapi.put.field(session.code, "tdsls400.stbp", trim$(str$(i.ship.to)))
stpapi.put.field(session.code, "tdsls400.corn", trim$(str$(i.customer.order)))
|These fields don't get updated
stpapi.put.field(session.code, "tdsls400.refa", trim$(str$(i.reference.a)))
stpapi.put.field(session.code, "tdsls400.refb", trim$(str$(i.reference.b)))
stpapi.put.field(session.code, "tdsls400.cfrw", trim$(str$(i.carrier)))
stpapi.put.field(session.code, "tdsls400.cpay", trim$(str$(i.payment.term)))
|Moreover, if these two fields are uncommented, all of the fields here don't get updated at all
|stpapi.put.field(session.code, "tdsls400.prdt", trim$(str$(i.planned.date)))
|stpapi.put.field(session.code, "tdsls400.ddat", trim$(str$(i.planned.date)))
stpapi.update(session.code, true, error.msg)
if not isspace(error.msg) then
error.msg = "Cannot update SO header: " & error.msg
stpapi.recover(session.code,recov.error.msg)
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.end.session(session.code)
return(error.msg)
**************
I commented the lines showing which fields are getting updated and which fields are not. Please advice.