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 25th March 2015, 16:41
joanfuentes joanfuentes is offline
Junior Member
 
Join Date: Jul 2008
Posts: 11
joanfuentes is on a distinguished road
Baan: baan Iv, V, Ln - DB: baan Iv, V, Ln - OS: Windows 8.1
AFS don´t work with cutomized field

Hi,

We work in baan4 c4 with one client, they have a customized fields in table tdpur040, when we tried execute afs, the value for the customized field is always empty.

We check with afs.log, but we don't found anything strange, also I tried changing the code, from check.input section to before.input section, but the before.input section is not executed

Anybody, have any idea why the afs code can't put the value?

Thanks

stpapi.put.field("tdpur4101m000", "tdpur040.orno", str$(tdsls998.ornc))
stpapi.put.field("tdpur4101m000", "tdpur040.suno", x.suno)
stpapi.put.field("tdpur4101m000", "tdpur040.cotp", tdsls998.cotc)
stpapi.put.field("tdpur4101m000", "tdpur040.refa", str$(tdsls933.invn))
stpapi.put.field("tdpur4101m000", "tdpur040.cdel", cdel)
stpapi.put.field("tdpur4101m000", "tdpur040.nspr", str$(x.nspc)) (this is the field with the problem)
sw = stpapi.insert("tdpur4101m000", true, err)

Last edited by joanfuentes : 25th March 2015 at 16:47.
Reply With Quote
  #2  
Old 25th March 2015, 19:40
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,930
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I have seen this happen - with a standard baan field. I am not sure why it happens or what causes. I am assuming you have the right table field, data and domain for the field. In my case what I did was a select table for update for the field - and guess what? It is the very same session you have - but the field is buyer. A snippet of my code is below. I know I have seen this on a couple of other sessions, but this is the one that popped into mind with your post. The buyer never gets updated on the form.

Code:
	stpapi.get.field( "tdpur4101m000", "tdpur040.orno", dummy )
	created.po = val(dummy)
| IF buyer did not update correctly update it here.
	stpapi.get.field( "tdpur4101m000", "tdpur040.ccon", dummy )
	buyer = val(dummy)
	if(tipgc520.buyr <> 0 and buyer = 0) then
		db.retry.point()
		select	tdpur040.*
		from	tdpur040 for update
		where	tdpur040._index1 = {:created.po}
		as set with 1 rows
		selectdo
			tdpur040.ccon = tipgc520.buyr
			db.update(ttdpur040,db.retry)
		endselect
		commit.transaction()
	endif

| Close the session.
	stpapi.end.session( "tdpur4101m000" )
__________________
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
  #3  
Old 25th March 2015, 21:32
vinceco252's Avatar
vinceco252 vinceco252 is offline
Guru
 
Join Date: Mar 2002
Location: Frederick, CO
Posts: 393
vinceco252 is on a distinguished road
Baan: Baan IVc3, IVc4, 5b, 5c, ERP LN 6.1, Infor ERP 10.x - DB: SQL Server, Oracle - OS: Windows, Linux, HPUX, AIX, (a little bit of) Solaris
Just to check: is tdpur040.nspr on one of the forms for session tdpur4101m000? AFS is based on interacting with the form definition, not the table definition...

Vince
__________________
Vincent Murphy
---------------
Senior ERP Consultant
OST
vmurphy@ostusa.com
Reply With Quote
  #4  
Old 25th March 2015, 21:52
joanfuentes joanfuentes is offline
Junior Member
 
Join Date: Jul 2008
Posts: 11
joanfuentes is on a distinguished road
Baan: baan Iv, V, Ln - DB: baan Iv, V, Ln - OS: Windows 8.1
Hi Vinceco252,

Yes, tdpur040.nspr is a field in form.

Regards
Reply With Quote
  #5  
Old 25th March 2015, 22:02
joanfuentes joanfuentes is offline
Junior Member
 
Join Date: Jul 2008
Posts: 11
joanfuentes is on a distinguished road
Baan: baan Iv, V, Ln - DB: baan Iv, V, Ln - OS: Windows 8.1
Thanks Mark for your answer, but the field not take value, have validations in the script, thats the reason that i cant use your example, but realy tks
Reply With Quote
  #6  
Old 26th March 2015, 14:19
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,930
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Quote:
Originally Posted by joanfuentes View Post
Thanks Mark for your answer, but the field not take value, have validations in the script, thats the reason that i cant use your example, but realy tks
How complicated are the validations? Make it a library and just run them in the afs script also. Or just put the validations in itself in the script. Pretty much all my api code is in libraries.

Some of my sessions have hundreds of lines of data validation before I ever start the AFS code. In some cases the sessions will do the validation, but I do not want to get 2 or 3(or more) sessions deep before I run into an error. Backing out the other sessions would probably be more code that the validations themselves.
__________________
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
Sponsored Links
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 fail to update table field ppchong AFS/DDC/OLE: Function servers 5 26th June 2012 15:38
Compilation Error baansavvy Tools Development 4 20th April 2010 17:25
default cursor on form field Agus Mujtahid Tools Development 9 29th October 2009 13:13
Main and sub work center setup FransG Manufacturing & Supply Chain 4 20th September 2006 12:56
form field not updating table field ! rohan_rege AFS/DDC/OLE: Function servers 1 7th May 2003 21:41


All times are GMT +2. The time now is 17:44.


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