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 16th September 2004, 17:32
alibaba's Avatar
alibaba alibaba is offline
Junior Member
 
Join Date: Jan 2003
Location: Earth
Posts: 26
alibaba is on a distinguished road
Baan: IVc2/IVc4/V -
Unhappy how to insert record in type3 form via AFS???

hi guys:
I was tried insert a BOm record into tibom1501m000 via AFS, in AFS manual,insert a record to type3 form I must set stpapi.change.view first,
but I want insert a new line of record into bom , execute stpapi.change.view return value equal "2"(Another view found (err.mesg is empty)).and other stapi.insert/stpapi.syna...can't be execute!
Code:
  example in the manual:
  stpapi.put.field("dtfsa1502m000", "dtfsa102.seno", str$(i.seno)
  ret = stpapi.change.view("dtfsa1502m000", error.msg)
  if ret = 1 then
  ret = stpapi.synchronize.dialog("dtfsa1502m000", "add", error.msg)
  if ret then
  stpapi.put.field("dtfsa1102s000", "dtfsa102.pono", str$(new.pono)
  stpapi.put.field("dtfsa1102s000", "dtfsa102.name", new.name)
  ret = stpapi.insert("dtfsa1502m000", true, error.msg)
  if not ret then
  ret = stpapi.recover("dtfsa1102s000", error.msg)
  endif  
  endif
  stpapi.end.session("dtfsa1502m000", error.msg)
if insert a new record into "dtfsa1502m000"."ret = stpapi.change.view("dtfsa1502m000", error.msg)" return 2!

why?
and how to insert a new record into a type3 form?
thank a lot!
__________________
----------------------------------------

Last edited by patvdv : 16th September 2004 at 18:48. Reason: Added CODE tags
Reply With Quote
  #2  
Old 16th September 2004, 18:17
lbencic's Avatar
lbencic lbencic is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, IL, USA
Posts: 1,148
lbencic will become famous soon enough
Baan: 2.2d - LN - DB: most - OS: most
This setup has worked for me several times. Sometimes I have a problem with the change view but usually only if there are multiple fields on it. The tibom1510m000 session only has the item as the main field.

Can you post your code that is not working? Did you fill the item right in accordance with the wacky Baan V rules (Segmented Domain / AFS post )
Reply With Quote
  #3  
Old 16th September 2004, 19:14
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
stpapi.change.view

I think that the function stpapi.change.view has a problem or bug.

try don´t make your validation about de stpapi.change.view with the return value.

stpapi.put.field("dtfsa1502m000", "dtfsa102.seno", str$(i.seno)
ret = stpapi.change.view("dtfsa1502m000", error.msg)
| if ret = 1 then | OLD LINE
if not isspace(strip$(error.msg)) then | NEW LINE


regards

Gerard
Reply With Quote
Sponsored Links
  #4  
Old 16th September 2004, 19:23
lbencic's Avatar
lbencic lbencic is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, IL, USA
Posts: 1,148
lbencic will become famous soon enough
Baan: 2.2d - LN - DB: most - OS: most
Right, with the change view and the finds as well. I would just add that if you are going to ignore the return value, which I certainly have, I would do a 'get.field' on the key fields and validate that it is in fact on the record you expect.
Reply With Quote
  #5  
Old 16th September 2004, 19:40
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
Quote:
Originally Posted by lbencic
Right, with the change view and the finds as well. I would just add that if you are going to ignore the return value, which I certainly have, I would do a 'get.field' on the key fields and validate that it is in fact on the record you expect.
a good idea!!

Gerard
Reply With Quote
  #6  
Old 17th September 2004, 05:19
alibaba's Avatar
alibaba alibaba is offline
Junior Member
 
Join Date: Jan 2003
Location: Earth
Posts: 26
alibaba is on a distinguished road
Baan: IVc2/IVc4/V -
Smile

thanks garias and thanks lbencic

I was wrong write code for form field!

in AFS.log,I found error because field error

so , It's worked now !

garias: you right! the stpapi.change view have a BUG, if insert a new reocrd of primary key , the return value equal 2 ! but other stpapi.* can be execute.
__________________
----------------------------------------
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
Insert using Horizontal Form jholdrid Tools Development 2 6th August 2004 20:55
Mutli Occ Form Type3 FOrm sant123 Tools Development 1 7th October 2003 10:35
tfacp9450m000 FIBU Brush Up Kai's Forum Users Deutsches Forum 1 16th November 1999 01:00
Herstellkostenberechnung in BaaN 4c Kai's Forum Users Deutsches Forum 4 5th July 1999 01:00


All times are GMT +2. The time now is 09:00.


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