Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 15th August 2016, 21:44
vik.patil vik.patil is offline
Member
 
Join Date: Apr 2008
Posts: 40
vik.patil is on a distinguished road
Baan: ERP LN - DB: MS-SQL - OS: MS-WINDOWS
Duplicate record using AFS

Hi,

Can we duplicate record from multi occurrence session using AFS? I am unable to find option for Duplicate command using AFS.

Any help will be appreciated.

Regards,

Vikram
Reply With Quote
  #2  
Old 16th August 2016, 08:16
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,320
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

What is the session? What have you tried? Did you tried using DAL instead of AFS?
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Sponsored Links
  #3  
Old 16th August 2016, 14:14
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,929
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Pretty much if you can do it manually you can do it via AFS. Not always the case -think in one place all I did was store off the form fields and then just add another line in the multi-occurrence session. Like bhushan says which session and what exactly have your tried. I also moved this to the AFS forum - you can search this forum for the session in question and sometimes find working code or see what others have tried.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #4  
Old 16th August 2016, 18:09
vik.patil vik.patil is offline
Member
 
Join Date: Apr 2008
Posts: 40
vik.patil is on a distinguished road
Baan: ERP LN - DB: MS-SQL - OS: MS-WINDOWS
Thanks Bhushan and Mark,
Basically, We have one customized session which has Product Variant field and we need to copy same to another Variant so we are trying to use tipcf5501m000 session to select variant and click Duplicate command to create copy of selected variant. I am unable get command to duplicate record. Hope now requirement is clear.
Reply With Quote
  #5  
Old 16th August 2016, 19:25
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,929
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
If it is a button on the forum you have to figure out what button it is. In 4c4 sometimes they use the user defined fields I have to use stpapi.application.option. Not sure if that is the case in LN as your profile shows. I know for LN you might use stpapi.form.command - but you have to figure out the parameters for the command - I only have access to 4c4.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #6  
Old 17th August 2016, 02:43
vik.patil vik.patil is offline
Member
 
Join Date: Apr 2008
Posts: 40
vik.patil is on a distinguished road
Baan: ERP LN - DB: MS-SQL - OS: MS-WINDOWS
I am working on Baan V and stpapi.form.command is applicable. Basically we don't want to give direct access to Product variant Session to users so we are creating wrapper session to duplicate existing Variant. I tried with this function stpapi.form.command but in vain. Is there any way to call choice commands from AFS?
Reply With Quote
  #7  
Old 17th August 2016, 11:00
manish_patel's Avatar
manish_patel manish_patel is offline
Senior Member
 
Join Date: Apr 2007
Location: Surat-->Bangalore, INDIA
Posts: 183
manish_patel is on a distinguished road
Baan: Baan IVc4, Baan 5.0 b - DB: Oracle 11g R2 - OS: HP-UX 11.31
I think, there is no specific AFS function to execute standard option duplicate/copy.

You have to get the required fields value using Baan SQL query and then
Set the field value - stpapi.put.field() |**put field value from query result except key field
Insert the record - stpapi.insert().
__________________
Thanks & Regards,
Manish
Reply With Quote
  #8  
Old 17th August 2016, 14:48
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,929
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Actually in 4c4 even if you do not have direct access to the session you still have to have permissions to it. We use dem flows to take care of that part and we also wrote our own run program. Our run program makes sure the session is on the dem flow - those are the only ones that can be run using it.

Do you have source code for the session? I am wondering if there is like a function or something you can execute with the form command?

Another option is - since you don't want them to have direct access. Is to give them a display screen (you probably already did this) with a button to copy. When they hit the copy button you can go read from the baan tables the data you need. Then like Manish says you could just do a bunch of put fields and an insert of a new record.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #9  
Old 11th March 2017, 17:39
garias's Avatar
garias garias is offline
Member
 
Join Date: Feb 2002
Location: Ecuador
Posts: 44
garias is on a distinguished road
Baan: Baan IV b2, c2, c2 mcurr, Baan V ERP, Infor LN - DB: Oracle, Informix, SQL - OS: AIX, Solaris, Windows NT
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?

Regards

Gerard
Reply With Quote
  #10  
Old 12th March 2017, 01:33
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,929
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Look at the stpapi.form.command that is used in LN.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #11  
Old 12th March 2017, 10:42
garias's Avatar
garias garias is offline
Member
 
Join Date: Feb 2002
Location: Ecuador
Posts: 44
garias is on a distinguished road
Baan: Baan IV b2, c2, c2 mcurr, Baan V ERP, Infor LN - DB: Oracle, Informix, SQL - OS: AIX, Solaris, Windows NT
Hello Mark
I have tried to use stpapi.form.command to execute the dupl.occur command in a session called by AFS, but it does not work:
stpapi.form.command (mysession, 5, "exec.dupl.occur", error.msg)
I have tried:
stpapi.form.command (mysession, 5, "dupl.occur", error.msg)

Any idea.
Gerard
Reply With Quote
  #12  
Old 15th March 2017, 10:58
manish@erpln manish@erpln is offline
Junior Member
 
Join Date: Oct 2013
Location: Pune
Posts: 4
manish@erpln is on a distinguished road
Baan: BAAN IV, BAAN V, ERP LN FP2, FP3, FP5 , FP7, FP9 , FP10.4 - DB: SQL Server,Oracle - OS: Windows Xp,Windows7,Windows 10
Try this :-

stpapi.form.command (mysession, 2, "dupl.occur", error.msg)
or
stpapi.form.command (mysession, 2, "exec.dupl.occur", error.msg)

If doesn't works then you can use DAL function dal.copy.object("tableid").
__________________

Thanks
Manish Kumar
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AFS - insert record in whinh5120m100 eric.dizon AFS/DDC/OLE: Function servers 13 31st October 2016 16:14
Very nasty work around for an ugly problem AFS finds and updates WRONG RECORD OmeLuuk AFS/DDC/OLE: Function servers 5 17th August 2015 13:21
AFS stpap.find retunrs 2 - another record found a.menon AFS/DDC/OLE: Function servers 10 8th May 2014 15:07
AFS fail to delete record in Maintain Estimated End Items ppchong AFS/DDC/OLE: Function servers 1 22nd September 2011 15:47
how to insert record in type3 form via AFS??? alibaba AFS/DDC/OLE: Function servers 5 17th September 2004 05:19


All times are GMT +2. The time now is 10:04.


©2001-2017 - Baanboard.com - Baanforums.com