infatuated01
10th February 2018, 10:27
Hi,
I am facing a problem that when I put a value into a field using AFS and then use save command, the value that I put disappeared from the field but when I use get.field command from AFS it's still there but after saving it's gone.
P.S. more information in note.
Best Regards,
Kanutm Setasathian
|**** OUTBOUND.ADVICE = whinh4525m000
|order
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.oorg", str$(whinh200.oorg))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.orno", str$(whinh200.orno))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.oset", str$(whinh200.oset))
|order line
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.pono", str$(whinh220.pono))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.seqn", str$(whinh220.seqn))
|advice
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.sern", str$(advice))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.locf", str$(whinr140.loca))
|to location
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.loct", "LOD007")
|Item
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.item", str$(whinr140.item))
|Inventory date
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.idat", str$(whinr140.idat))
|advice quantity
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.qads", str$(advised.quantity))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.quni", str$(whinh220.orun))
|Run
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.runn", str$(run))
ret = stpapi.insert(OUTBOUND.ADVICE, true, error.msg)
mark_h
12th February 2018, 00:46
Check out this http://www.baanboard.com/baanboard/showthread.php?t=25556&highlight=whinh4525m000 thread to see if it helps. It talks about synchronized dialog.
infatuated01
12th February 2018, 13:08
Thank for the reply mark.
But I am sorry for lack of information because I already tried synchronized dialog and then I got different sales order that I put in there. More information below.
Input that I put in .
whinh4201m0i0: Generate Outbound Advice (Knk): oorg : 1 (Sales)
whinh4201m0i0: Generate Outbound Advice (Knk): orno : CSO001281
whinh4201m0i0: Generate Outbound Advice (Knk): oset : 1
whinh4201m0i0: Generate Outbound Advice (Knk): pono : 10
whinh4201m0i0: Generate Outbound Advice (Knk): seqn : 0
whinh4201m0i0: Generate Outbound Advice (Knk): advice : 1
whinh4201m0i0: Generate Outbound Advice (Knk): warehouse : 5-FG
whinh4201m0i0: Generate Outbound Advice (Knk): from location : A1101
whinh4201m0i0: Generate Outbound Advice (Knk): lot : L20170830-001
whinh4201m0i0: Generate Outbound Advice (Knk): to location : LOD007
whinh4201m0i0: Generate Outbound Advice (Knk): item : 321-DVA
whinh4201m0i0: Generate Outbound Advice (Knk): idat : 1504072800
whinh4201m0i0: Generate Outbound Advice (Knk): advised advised : 300
whinh4201m0i0: Generate Outbound Advice (Knk): orun : pcs
whinh4201m0i0: Generate Outbound Advice (Knk): RUN : O20180212001
and
whinh4201m0i0: Generate Outbound Advice (Knk): oorg : 1 (Sales)
whinh4201m0i0: Generate Outbound Advice (Knk): orno : CSO001281
whinh4201m0i0: Generate Outbound Advice (Knk): oset : 1
whinh4201m0i0: Generate Outbound Advice (Knk): pono : 10
whinh4201m0i0: Generate Outbound Advice (Knk): seqn : 0
whinh4201m0i0: Generate Outbound Advice (Knk): advice : 2
whinh4201m0i0: Generate Outbound Advice (Knk): warehouse : 5-FG
whinh4201m0i0: Generate Outbound Advice (Knk): from location : B1101
whinh4201m0i0: Generate Outbound Advice (Knk): lot : L20170830-002
whinh4201m0i0: Generate Outbound Advice (Knk): to location : LOD007
whinh4201m0i0: Generate Outbound Advice (Knk): item : 321-DVA
whinh4201m0i0: Generate Outbound Advice (Knk): idat : 1504075922
whinh4201m0i0: Generate Outbound Advice (Knk): advised advised : 60
whinh4201m0i0: Generate Outbound Advice (Knk): orun : pcs
whinh4201m0i0: Generate Outbound Advice (Knk): RUN : O20180212001
Error that I got when I used synchronized dialog.
whinh4201m0i0: Generate Outbound Advice (Knk): insert Specified "To Location" not found in "Locations". Enter another "To Location".
whinh4201m0i0: Generate Outbound Advice (Knk): error : Specified "To Location" not found in "Locations". Enter another "To Location".
But I have "LOD007" in database.
Here's my code when I was using synchronized dialog.
ret = stpapi.synchronize.dialog(OUTBOUND.ADVICE, "add", error.msg)
if (advised.quantity <> 0 ) then
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.oorg", str$(whinh200.oorg))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.orno", str$(whinh200.orno))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.oset", str$(whinh200.oset))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.pono", str$(whinh220.pono))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.seqn", str$(whinh220.seqn))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.sern", str$(advice))
|from location
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.locf", str$(whinr140.loca))
|to location
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.loct", "LOD007")
|Item
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.item", str$(whinr140.item))
|Inventory date
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.idat", str$(whinr140.idat))
|advice quantity
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.qads", str$(advised.quantity))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.quni", str$(whinh220.orun))
|Run
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.runn", str$(run))
ret = stpapi.insert(OUTBOUND.ADVICE, true, error.msg)
advice = advice + 1
endif
if (not isspace(error.msg)) then
message("error : " & error.msg)
endif
-----------------------------------------------------------------------
And here's my error when I did not use synchronized dialog.
whinh4201m0i0: Generate Outbound Advice (Knk): error : Change the value of the Set field.\n\nReason: Warehousing order header (Sales / 1) does not exist.
It seems that my whinh225.orno disappeared while inserting data using AFS.
Here my full code when I do not use synchronized dialog.
|*** Flow Data come from above
if (advised.quantity <> 0 ) then
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.oorg", str$(whinh200.oorg))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.orno", str$(whinh200.orno))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.oset", str$(whinh200.oset))
|order line
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.pono", str$(whinh220.pono))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.seqn", str$(whinh220.seqn))
|advice
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.sern", str$(advice))
|warehouse
|stpapi.put.field(OUTBOUND.ADVICE, "whinh225.cwar", str$(whinr140.cwar))
|from location
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.locf", str$(whinr140.loca))
|to location
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.loct", "LOD007")
|Item
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.item", str$(whinr140.item))
|Inventory date
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.idat", str$(whinr140.idat))
|advice quantity
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.qads", str$(advised.quantity))
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.quni", str$(whinh220.orun))
|Run
stpapi.put.field(OUTBOUND.ADVICE, "whinh225.runn", str$(run))
ret = stpapi.insert(OUTBOUND.ADVICE, true, error.msg)
advice = advice + 1
endif
if (not isspace(error.msg)) then
message("error : " & error.msg)
endif
Sorry In advance .
mark_h
12th February 2018, 15:02
My first thought is that you would need the synchronized dialog so that the sessions could communicate with each other. I really do not have any knowledge of your version. But what went through my mind was if that location you are putting to the screen might need to formatted correctly first or have a variable in the domain you need. I know in my case on 4c4 I convert something like "123456" and make in " 123456" - I no longer recall if I had to do that to make it work or if just did it out of habit when writing API code.