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 3rd January 2003, 11:28
guilmor's Avatar
guilmor guilmor is offline
Member
 
Join Date: Sep 2002
Location: Spain
Posts: 50
guilmor is on a distinguished road
Baan: Baan IVc4, BaanERP - DB: Oracle - OS: Windows NT Server/2000
Question how to execute dupl.occur in BaanIV

Hi Baanboard,

I'm trying to copy items using afs from session tiitm0101m000.
I haven't found any "stpapi.dupl.occur("...")" command to do this.

I guess I should do something like this:

Code:
stpapi.put.field("tiitm0101m000","tiitm001.item","TEMPLATEITEM")
ret = stpapi.find("tiitm0101m000")
if ret = 1 then
    stpapi.handle.subproc("tiitm0101m000","tiitm0202s000","add")
    stpapi.dupl.occur("tiitm0101m000")  (this is what I can't find in manual)
    stpapi.put.field("tiitm0202s000","copy.item","NEWITEM")
    stpapi.continue.process("tiitm0202s000")
    stpapi.end.session("tiitm0202s000")
endif
anyone can help?
Thanks, Guilmor.
Reply With Quote
Sponsored Links
  #2  
Old 3rd January 2003, 16:54
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,924
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Never seen.

I have never seen a stpapi command to duplicate or copy a record. Have you tried just doing a find of the item you want to copy, then put the new item, then just do a save or insert. Not sure what would happen to all of the other fields, but it is something to try.

Mark
Reply With Quote
  #3  
Old 29th September 2005, 20:28
cherokee's Avatar
cherokee cherokee is offline
Senior Member
 
Join Date: Jan 2003
Location: Montreal, Canada
Posts: 290
cherokee is on a distinguished road
Baan: Baan IVc3 A&D - DB: Oracle - OS: IBM AIX
Question FS copy items

Hello there,

I just tried this suggestion. When I try the insert it, it gives me "Item Type Not allowed"... I think is validating every field again. I do not know if when I put the new item code it blanks out all other fields.

Code:
        stpapi.put.field("tppdm0110m000","tiitm001.item",i.item)
        if stpapi.find("tppdm0110m000") = 1 
                stpapi.put.field("tppdm0110m000","tiitm001.item",copy.item)
                stpapi.insert("tppdm0110m000",true,err.mesg)
                if not isspace(err.mesg) then
                       stpapi.recover("tppdm0110m000", err.mesg)
                       stpapi.end.session("tppdm0110m000")
                       return(false)
                endif
               stpapi.end.session("tppdm0110m000")
                return(true)
        endif
Reply With Quote
  #4  
Old 29th September 2005, 20:52
cherokee's Avatar
cherokee cherokee is offline
Senior Member
 
Join Date: Jan 2003
Location: Montreal, Canada
Posts: 290
cherokee is on a distinguished road
Baan: Baan IVc3 A&D - DB: Oracle - OS: IBM AIX
Hello again,

Actually it works only if you enter the item type and Item group, then It only creates the Item based on the Default Item Data. The down side of this is that, you are not copying all data from your source Item, you are just creating new item with a different code. The rest of the data isn't copied over to the new item.

Code:
       stpapi.put.field("tppdm0110m000","tiitm001.item",i.item)
        if stpapi.find("tppdm0110m000") = 1 then        
                stpapi.put.field("tppdm0110m000","tiitm001.item",copy.item)
                stpapi.put.field("tppdm0110m000","tiitm001.kitm",str$(tiitm001.kitm))
                stpapi.put.field("tppdm0110m000","tiitm001.citg",tiitm001.citg)
                stpapi.insert("tppdm0110m000",true,err.mesg)
                if not isspace(err.mesg) then
                        stpapi.recover("tppdm0110m000", err.mesg)
                        stpapi.end.session("tppdm0110m000")
                        return(false)
                endif
                stpapi.end.session("tppdm0110m000")
                return(true)
        endif
        return(false)
It is a step forward for me at least.

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
Copy (option dupl.occur) with AFS ?? Guillaume.G AFS/DDC/OLE: Function servers 10 11th March 2017 17:34
BaanIV web client NvanBeest Third Party Products 40 3rd November 2003 18:53
File-Browser in BaanIV roge544 Tools Development 2 4th April 2003 16:58
Does Baan support BaanIV on AS/400 environment? baanfin Operating Systems & Databases 1 27th February 2003 07:37


All times are GMT +2. The time now is 03:48.


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