Baanboard.com

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

Retirement Notice

Baanboard is shutting down on 31-dec-2023. See: http://www.baanboard.com/baanboard/showthread.php?t=76043


User login

Frontpage Sponsor

Main

Poll
What do you expect from your SI Implementation partner for the success of ERP implementation.
Bring best practices - Not to offer more CR's Leveraging standard functions
20%
Need more honesty to work with the Users until their processes are fully mapped & Users are trained
40%
Focus on process automation/ integrations/ Real time data/ BI analytics
13%
Stick to basics
27%
Total votes: 15

Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 6th December 2022, 04:50
zhilenko_myu zhilenko_myu is offline
Junior Member
 
Join Date: Dec 2021
Posts: 11
zhilenko_myu is on a distinguished road
Baan: erpln 10 - DB: oracle - OS: windows 7
tdsls4101m000 does not show errors

hello
when inserting a row, if there are errors in the data, then afs does not show errors.
for example, if there is no such product in the database.
Code:
session = "tdsls4101m000"
		
		stpapi.put.field(session, "tdsls401.orno", orno.o)
		error.msg = get.string.arg(1)
		retval = stpapi.change.view(session,  error.msg)
		put.string.arg(1, error.msg)
		IF retval = 0 THEN
			retval = stpapi.synchronize.dialog(session, "add", error.msg)
			session1 = "tdsls4101m000"
			IF retval THEN
				stpapi.put.field(session1, "tdsls401.item.segment.1", "")
				stpapi.put.field(session1, "tdsls401.item.segment.2", zrsfc121.item(1;38))
				
				SELECT *
				FROM zazir101
				WHERE zazir101.onum = :onum.i
				SELECTDO
					effn.i = zazir101.effn
				ENDSELECT
				stpapi.put.field(session1, "tdsls401.effn", str$(effn.i))
				stpapi.put.field(session1, "tdsls401.cprj", cprj.i)
				stpapi.put.field(session1, "tdsls401.cact", "1")
				stpapi.put.field(session1, "tdsls401.qoor", "1")
|				stpapi.put.field(session1, "tdsls401.odat", str$(ddat))		
				stpapi.put.field(session1, "tdsls401.stbp", stbp)
				stpapi.put.field(session1, "tdsls401.stad", ofad)
				stpapi.put.field(session1, "tdsls401.pric", "10000")
				stpapi.put.field(session1, "tdsls401.oamt", "10000") 
				stpapi.put.field(session1, "tdsls401.ccty", "1")
		      stpapi.put.field(session1, "tdsls401.cvat", cvat)
				retval = stpapi.insert(session1, true, error.msg)
				IF not isspace(error.msg) THEN
		  				print.errors(
									"1",
									session1,
									error.msg,
									trim$(zrsfc121.item),									
									orno.o)
		  
				ENDIF
				IF retval THEN
					session2 = "tdsls4830s000"
					stpapi.put.field(session2, "inventory.short", str$(etol(tdsls.ssop.no.action)))
					stpapi.end.session (session2, error.msg)			
					retval = stpapi.save(session1, error.msg)
					IF not isspace(error.msg) THEN
		  				print.errors(
									"2",
									session1,
									error.msg,
									trim$(zrsfc121.item),									
									orno.o)
		  
					ENDIF	
				ENDIF
			ENDIF
		ENDIF
		stpapi.end.session(session1, error.msg)
		
		stpapi.end.session(session, error.msg)

Last edited by zhilenko_myu : 7th December 2022 at 05:18.
Reply With Quote
  #2  
Old 6th December 2022, 14:13
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I typically validate data before I insert a record. Is there anything in error message when you do the stpapi.synchronize.dialog? From the example in the documentation looks like you put the fields to the session opened and then do an insert on the main session.

Code:
ret = stpapi.synchronize.dialog("dtfsa1501m000", "add", error.msg)
if ret then
stpapi.put.field("dtfsa1101s000", "dtfsa101.seno", str$(new.seno)
stpapi.put.field("dtfsa1101s000", "dtfsa101.name", new.name)
ret = stpapi.insert("dtfsa1501m000", true, error.msg)
if not ret then
ret = stpapi.recover("dtfsa1101s000", error.msg)
endif
endif
stpapi.end.session("dtfsa1501m000", error.msg)
__________________
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 7th December 2022, 05:15
zhilenko_myu zhilenko_myu is offline
Junior Member
 
Join Date: Dec 2021
Posts: 11
zhilenko_myu is on a distinguished road
Baan: erpln 10 - DB: oracle - OS: windows 7
Quote:
Originally Posted by mark_h View Post
I typically validate data before I insert a record. Is there anything in error message when you do the stpapi.synchronize.dialog? From the example in the documentation looks like you put the fields to the session opened and then do an insert on the main session.

Code:
ret = stpapi.synchronize.dialog("dtfsa1501m000", "add", error.msg)
if ret then
stpapi.put.field("dtfsa1101s000", "dtfsa101.seno", str$(new.seno)
stpapi.put.field("dtfsa1101s000", "dtfsa101.name", new.name)
ret = stpapi.insert("dtfsa1501m000", true, error.msg)
if not ret then
ret = stpapi.recover("dtfsa1101s000", error.msg)
endif
endif
stpapi.end.session("dtfsa1501m000", error.msg)
that's just the point the error message does not give
Reply With Quote
  #4  
Old 6th December 2022, 14:19
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I recommend searching the AFS/DDC/OLE: Function servers forum for tdsls4101m000. Lots of threads and it appears DAL might be best. Just some sample threads below - one talks dal and the other mentions a main and sub with same name - no solution.

http://www.baanboard.com/baanboard/s...=tdsls4101m000
http://www.baanboard.com/baanboard/s...=tdsls4101m000
__________________
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
  #5  
Old 7th December 2022, 05:16
zhilenko_myu zhilenko_myu is offline
Junior Member
 
Join Date: Dec 2021
Posts: 11
zhilenko_myu is on a distinguished road
Baan: erpln 10 - DB: oracle - OS: windows 7
Quote:
Originally Posted by mark_h View Post
I recommend searching the AFS/DDC/OLE: Function servers forum for tdsls4101m000. Lots of threads and it appears DAL might be best. Just some sample threads below - one talks dal and the other mentions a main and sub with same name - no solution.

http://www.baanboard.com/baanboard/s...=tdsls4101m000
http://www.baanboard.com/baanboard/s...=tdsls4101m000
DAL cannot be used, there are extensions for this session
Reply With Quote
  #6  
Old 11th January 2023, 15:26
OmeLuuk's Avatar
OmeLuuk OmeLuuk is offline
Guru
 
Join Date: Mar 2002
Location: NetherBelgium
Posts: 1,376
OmeLuuk will become famous soon enough
Baan: Infor LN 6.1 10.2.1 > 10.7 - DB: MS SQL2017 - OS: VM WindowsServer2016
Quote:
Originally Posted by zhilenko_myu View Post
DAL cannot be used, there are extensions for this session
And consider to move the extensions on the session to extensions on the table tdsls401, then use the DAL method and the table extension will also work
__________________

Also read Luke 24:4-8

After that you can find many answers on Infor, LN, BaanIV, BaanV, InforLN and ION and even some questions asked here on baanboard.com
Reply With Quote
  #7  
Old 7th December 2022, 15:05
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I still recommend you search the threads. I do not have access to LN and I have never used it. The first thread - shows a where they copied the session and turned something off. That technique might work for you. The next thread has in the final post something that someone else did - not sure it will work on LN I did not look closely.

http://www.baanboard.com/baanboard/s...=tdsls4101m000
http://www.baanboard.com/baanboard/s...=tdsls4101m000
__________________
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
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
Background info for bshell options (BaanIV) victor_cleto Tools Administration & Installation 64 7th April 2020 17:58
Which Set Commands Do You Use? Why? mr_suleyman Tools Development 14 16th January 2014 22:44
BW client parameters lsatenstein Tools Administration & Installation 2 31st January 2012 22:29
bshell6.1 chjagge Tools Administration & Installation 2 12th May 2003 09:38
Running session in background.. r_nagu Tools Development 8 15th February 2003 02:24


All times are GMT +2. The time now is 01:32.


©2001-2023 - Baanboard.com - Baanforums.com