Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
14%
200 - 500 GB
32%
500 - 800 GB
4%
800 - 1200 GB
4%
1200 - 1500 GB
11%
1500 - 2000 GB
14%
> 2000 GB
21%
Total votes: 28

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 5th April 2016, 18:27
alokdixt alokdixt is offline
Junior Member
 
Join Date: Aug 2010
Posts: 11
alokdixt is on a distinguished road
Baan: ERPLN6.1 - DB: SQL - OS: microsoft xp
AFS for tihra1101m000 in baan4

Hi,
I am trying to create an AFS script for Hours accounting session but getting error "Start date must be entered". I am getting this error only when tihra100.cwtt = "" otherwise it is going well. please help me here

Below is the script

Code:
stpapi.put.field("tihra1101m000", "tihra100.year", str$(year.al))
	stpapi.put.field("tihra1101m000", "tihra100.week", str$(week.al))
	stpapi.put.field("tihra1101m000", "tihra100.emno", str$(emno.al))
	ret.val = stpapi.find("tihra1101m000",gapi.error.code)
	
	stpapi.get.field("tihra1101m000", "tihra100.year", year.p)
	stpapi.get.field("tihra1101m000", "tihra100.week", week.p)
	stpapi.get.field("tihra1101m000", "tihra100.emno", emno.p)
	
	stpapi.put.field("tihra1101m000", "tihra100.hrdt", str$(hrdt.al))
	stpapi.put.field("tihra1101m000", "tihra100.dayn", str$(etol(dayn.al)))
	stpapi.put.field("tihra1101m000", "tihra100.koht", str$(etol(koht.al)))
	stpapi.put.field("tihra1101m000", "tihra100.cprj", str$(cprj.al))
	stpapi.put.field("tihra1101m000", "tihra100.pdno", str$(pdno.al))
	stpapi.put.field("tihra1101m000", "tihra100.opno", str$(opno.al))
	stpapi.put.field("tihra1101m000", "tihra100.cact", str$(cact.al))
	stpapi.put.field("tihra1101m000", "tihra100.tano", str$(tano.al))
	stpapi.put.field("tihra1101m000", "tihra100.cwoc", str$(cwoc.al))
	stpapi.put.field("tihra1101m000", "tihra100.cwtt", str$(cwtt.al))
	stpapi.put.field("tihra1101m000", "tihra100.stdy", str$(etol(stdy.al)))
	stpapi.put.field("tihra1101m000", "tihra100.sttm", str$(sttm.al))	
	stpapi.put.field("tihra1101m000", "tihra100.endy", str$(etol(endy.al)))
	stpapi.put.field("tihra1101m000", "tihra100.entm", str$(entm.al))
	stpapi.put.field("tihra1101m000", "tihra100.hrea", str$((hrea.al * -1)))

	stpapi.put.field("tihra1101m000", "tihra100.ckow", str$(ckow.al))
	stpapi.put.field("tihra1101m000", "tihra100.htst", str$(etol(htst.al)))
	stpapi.put.field("tihra1101m000", "tihra100.pccp", str$(pccp.al))
	stpapi.enum.answer("tihra1101m000", "tihras0029", tcyesno.no)
	inserted  = stpapi.insert("tihra1101m000", 1, gapi.error.code)
	
	if not inserted then
		while true
			error.code = stpapi.get.mess.code("tihra1101m000", gapi.error.code)
			if (isspace(gapi.error.code)) then
				break
			endif
			message(gapi.error.code)
			ret = stpapi.recover("tihra1101m000", dummy.msg)
		endwhile									
	else
	endif
// Again putting dayn value as it was returning zero after insert//
	
	stpapi.put.field("tihra1101m000", "tihra100.dayn", str$(etol(dayn.al)))
	stpapi.put.field("tihra1101m000", "tihra100.stdy", str$(etol(stdy.al)))	
	stpapi.put.field("tihra1101m000", "tihra100.endy", str$(etol(endy.al)))
	
	
	if not stpapi.save("tihra1101m000", gapi.error.code) then
		stpapi.get.field("tihra1101m000", "tihra100.dayn", dayn.al.p)
		  while true
			error.code = stpapi.get.mess.code("tihra1101m000", gapi.error.code)
			if (isspace(gapi.error.code)) then
				break
			endif
			message(gapi.error.code)
		endwhile
		ret = stpapi.recover("tihra1101m000", dummy.msg)
		stpapi.end.session("tihra1101m000")
		return(false)
	else
		stpapi.get.field("tihra1101m000", "tihra100.dayn", dayn.al.p)

	
	 endif 
	
	stpapi.end.session("tihra1101m000")
	 return(true)
Reply With Quote
Sponsored Links
  #2  
Old 5th April 2016, 22:53
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,135
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
You can search for other threads in this forum - there are several and this is just one http://www.baanboard.com/baanboard/s...ead.php?t=5800. Now maybe is cwtt is always set, but other threads exist. Do you own source code to tihra1101 where you can debug it to see what is happening?
__________________
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 8th April 2016, 20:50
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 531
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Looks like cwtt is a mandatory field if cwtt is indeed the "Start date".
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 waiting timed out (frozen) jp.aalders AFS/DDC/OLE: Function servers 4 20th December 2011 21:48
AFS for tfacr4410m000 and Credit Notes Neal Matthews AFS/DDC/OLE: Function servers 7 12th April 2011 21:48
Steps to create AFS indian_sumesh AFS/DDC/OLE: Function servers 1 6th November 2008 18:32
AFS hangs in stpapi.put.field garias AFS/DDC/OLE: Function servers 1 30th January 2005 23:13
AFS - Print Order Documents BurghMan AFS/DDC/OLE: Function servers 5 29th October 2004 22:07


All times are GMT +2. The time now is 21:52.


©2001-2018 - Baanboard.com - Baanforums.com