Copy (option dupl.occur) with AFS ??
I want to simulate the dupl.occur action with the AFS.
But after several try, it's not work !!!!!
In my case i want to copy à record of tipcs2121m000
So what is the solution to user dupl.occur with AFS ???
Thank you for your help
Not sure it is possible.
I think this is one of the features that is not possible using AFS. Like in this post what I recommend trying is to do a find of the record you want to copy, then put the new key fields(or item), then try a insert. This may work. If you do try it I would be interested in knowing if it did work.
Dupl.occur is possible but ....
I try your solution, but it's not work
because the field of the screen is not in the API field buffer so the fields are empty (==> Error message )
Your idea is correct if you make a stpapi.get.field for all field of all form of the session
and for the copy you make a put field of all field (with modify value) and finish with an insert.
But the very big problem is the code of the choice.dupl.occur of the session is NOT executed !!!!
So i find an another solution which it's possible only if you have the program script std. and with stpapi.application.option.
the solution is :
you create a user.9 option in the std script (tipcs2121)
if api.mode then
And in the specific program
stpapi.application.option(ARTPCS, 1, 9, error)
if error <> "" then
retsave = stpapi.save(ARTPCS,error)
if retsave = 0 then
message.erreur = "Pb sauvegarde Article :"
retour = 7
Good Idea :)
Also, you can add a section like that to the standard code without modifying the source code at all using the wrapper tools out there - QKEY, RMCgen and the freeware version on these boards: 'rush'.
Good thinking outside of the box - so much of the AFS programming needs that.
Great solution Guillaume.G and thanks to Lisa for pointing out how the extended source solutions could work with this. I have to keep this in mind . :)
And what about stpapi.application.option( "...", 1, -32 (or any form option relative to user.0), error ) ?
(looks like it works, tdsls4102s000 raises copy session tdsls4201s000, for example, but I did not play with it enough time, sorry)
Interesting concept. The instructions mention executing only user.0 thru user.9. I just tested stpapi.application.option("tibom8411m000",1,-25,msg) to see if it would print a report(of course the print option was set on this session) - it did work.
If you did use it just be prepared that this functionality might not work or exist in the future. Of course it is not like future releases will never break API function server. I have not seen any new documentation on API commands, so good find Goooch. Others may want to test this and report back.
If anybody is interested, I have tried the above suggestion and it does work for copying records. I am using a "template" supplier to copy to a new temporary supplier that is being handled by file transfers, replacing only the supplier code and name fields. Here's a sampling of the code for B4c4:
if tccomf2101m000.find() <> 1 then
|error - can't find supplier template
stpapi.application.option( "tccom2101m000", 1, -32, err.mess)
Thanks to all those who hinted at a solution here. There are way too many fields in the supplier table to make this a palatable experience.
i realize this is a year old (almost exactly a year old i just noticed :)) but this is exactly what i was looking for , thx so much mefreakboy! just curious, where can I find a list of codes to use for stapi.application.option. in other words how do you know -42 is for copy and -25 is for print? if any one knows i'd appreciate it. Thx!
You get the numbers from the maintain form, then standard options. This gives you a list with the number associated with that option.
Any option for Infor LN
Since stpapi.application.option does not work for Infor LN
which option we could use to enable the dupl.occur command in a session called by AFS
|All times are GMT +2. The time now is 02:30.|
©2001-2017 - Baanboard.com - Baanforums.com