Frank Liu
3rd May 2016, 11:53
Hi,
I am trying to use AFS to run Form-Command “initiate inventory issue…” on session Material to Issue for Production Orders, ticst0101m100, but “stpapi.form.command” always returned an error message “device not found” no matter I set the device display “D” or file “ASCIF”. Could you please help to identify? My Ln version is FP9 and my code is at below,
stpapi.put.field("ticst0101m100","ticst001.pdno","PO2000358")
stpapi.put.field("ticst0101m100","ticst001.pono",str$(20))
if stpapi.find("ticst0101m100",error.msg) = 1 then
if stpapi.synchronize.dialog("ticst0101m100","modify",error.msg) = 1 then
stpapi.put.field("ticst0101m100", "ticst001.issu", str$(1))
stpapi.put.field( "ticst0101m100", "ticst001.dris", str$(tcyesno.yes) )
if stpapi.update("ticst0101m100", true, error.msg) <> 1 then
message("AFS update error ", error.msg)
stpapi.recover( "ticst0101m100",error.msg )
else
printer.device = "ASCIF"
stpapi.enum.answer( "ticst0101m100","ticst01011", tcyesno.yes)
stpapi.set.report("ticst0101m100","tisfc020701000",printer.device, error.msg)
|stpapi.continue.process("ticst0101m100", error.msg)
stpapi.form.command("ticst0101m100", 5, "initiate.inventory", error )
if error <> "" then
message(error&", Error on AFS initiate inventory", error.msg)
else
message(error&" Ok : issued", error.msg)
endif
endif
else
message("synchronize Error : 3", error.msg)
endif
else
message("Find Error : 4", error.msg)
endif
I am trying to use AFS to run Form-Command “initiate inventory issue…” on session Material to Issue for Production Orders, ticst0101m100, but “stpapi.form.command” always returned an error message “device not found” no matter I set the device display “D” or file “ASCIF”. Could you please help to identify? My Ln version is FP9 and my code is at below,
stpapi.put.field("ticst0101m100","ticst001.pdno","PO2000358")
stpapi.put.field("ticst0101m100","ticst001.pono",str$(20))
if stpapi.find("ticst0101m100",error.msg) = 1 then
if stpapi.synchronize.dialog("ticst0101m100","modify",error.msg) = 1 then
stpapi.put.field("ticst0101m100", "ticst001.issu", str$(1))
stpapi.put.field( "ticst0101m100", "ticst001.dris", str$(tcyesno.yes) )
if stpapi.update("ticst0101m100", true, error.msg) <> 1 then
message("AFS update error ", error.msg)
stpapi.recover( "ticst0101m100",error.msg )
else
printer.device = "ASCIF"
stpapi.enum.answer( "ticst0101m100","ticst01011", tcyesno.yes)
stpapi.set.report("ticst0101m100","tisfc020701000",printer.device, error.msg)
|stpapi.continue.process("ticst0101m100", error.msg)
stpapi.form.command("ticst0101m100", 5, "initiate.inventory", error )
if error <> "" then
message(error&", Error on AFS initiate inventory", error.msg)
else
message(error&" Ok : issued", error.msg)
endif
endif
else
message("synchronize Error : 3", error.msg)
endif
else
message("Find Error : 4", error.msg)
endif