Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
19%
200 - 500 GB
28%
500 - 800 GB
3%
800 - 1200 GB
7%
1200 - 1500 GB
8%
1500 - 2000 GB
12%
> 2000 GB
23%
Total votes: 74

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 14th August 2019, 18:15
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 645
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Red face Writing your own code in QKey generated script
Baan: Baan IVc4
C/S: Both

Hi Everyone,

Following is the code generated using QKey:
Code:
|***************************************************************************
|* Autogenerated subsections for main.table.io
|***************************************************************************

after.read:
	_pobj_exe1("after.read")

after.write:
	_pobj_exe1("after.write")

after.rewrite:
	_pobj_exe1("after.rewrite")

before.delete:
	_pobj_exe1("before.delete")

	|#end add by QKEY
I want to write some code when a new sales order header record is saved. I know i have to write it in after.write: section but I am not able to recall how I can achieve this as it has been a long time since I touched QKey. There has been a lot of custom code already written by other developers.

Any urgent help will be highly appreciated.

Vishal
Reply With Quote
  #2  
Old 14th August 2019, 19:55
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,336
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Basically you would add in a |#end then add in the code. Kind of like this:

Code:
	|#end add by QKEY

choice.cont.process:
after.choice:
|20060828.st
| Try testing here for production orders with subcontracting operations.
| The production order number is on the PO line table tdpur041.  Any
| production order found with any PO line not fully received should
| not be completed.
| 20060828.end
	if comp.frm = tcyesno.yes then
		select	tisfc010.cwoc, tisfc010.opno, tirou001.kowc
		from	tisfc010, tirou001
		where	tisfc010._index1 = {:tisfc001.pdno}
		and	tirou001._index1 = {tisfc010.cwoc}
		and	tirou001.kowc = tckowc.subcontracting
		selectdo
			select	tdpur041.*
			from	tdpur041
			where	tdpur041._index6 = {:tisfc001.pdno, :tisfc010.opno}
			selectdo
				if double.cmp(tdpur041.dqua, tdpur041.oqua, .0001)>=0
					and double.cmp(tdpur041.bqua, 0.0, .0001)=0 then
					if double.cmp(tdpur041.quap, tdpur041.oqua, .0001)<0 then
						message("Purchase order %d line %d needs maintain approvals."
						,tdpur041.orno,tdpur041.pono)
						choice.again()
					endif
				else
					message("Purchase order %d line %d not fully received."
					,tdpur041.orno,tdpur041.pono)
					choice.again()
				endif
			selectempty
				message("Production order %d operation %d not tied to a purchase order."
					,tisfc001.pdno,tisfc010.opno)
				if ask.enum("ticontactpsa",tcyesno.yes) = tcyesno.yes then
					if ask.enum("tpbop39003",tcyesno.yes) = tcyesno.yes then
|*						message("OK - will continue process")
					else
						choice.again()
					endif
				else
					choice.again()
				endif	
			endselect
		endselect
| 20130617.st - Made it thru the checks lets check for VSS.
		select	tcudi006.*
		from	tcudi006
		where 	tcudi006._index1 = {:tisfc001.cwar}
		as set with 1 rows
		selectdo
		endselect
		if tcudi006.site <> tcudi.site.lsvl then
			|vss.checks = false
			| No VSS checks needed.
		else
			if tcudi006.wuse = tcudi.wuse.logical or tcudi006.wuse = tcudi.wuse.mrb or 
				tcudi006.wuse = tcudi.wuse.parent or tcudi006.wuse = tcudi.wuse.unique then
				|vss.checks = false
				| No vss checks needed.
			else
				select	tdvss001.*, tdvss010.*
				from	tdvss001, tdvss010
				where	tdvss001._index1 = {:tisfc001.mitm}
				and	tdvss010._index1 = {tdvss001.item, :tisfc001.ccot.a}
				as set with 1 rows
				selectdo
				selectempty
					message("Needs VSS PFEP Data.")
					choice.again()
				endselect
				if is.warehouse.vss(tisfc001.cwar) then
					if tdvss001.proc = tcyesno.no or tdvss001.subm = tcyesno.no then
						message("VSS record needs to be submitted.")
						choice.again()
					endif
				endif
				if tdvss010.cwar <> tisfc001.cwar then
					message("PFEP Warehouse does not match production order warehouse.")
					choice.again()
				endif
				if tdvss001.leng = 0 or tdvss001.heig = 0 or tdvss001.widt = 0 then
					message("%s needs PFEP data completed or processed to VSS set.", trim$(tisfc001.mitm))
					choice.again()
				endif
			endif
		endif
	endif
| 20130617.end
	|#call
	|#pobj added by QKEY 3.70
	_pobj_exe1("after.choice.cont.process")
	|#end add by QKEY
| Go set the current status of the order in
| tisfc970.
	update_completed_status()
	|#pobj added by QKEY 3.70

|***************************************************************************
|* Autogenerated subsections for choice.cont.process
|***************************************************************************

before.choice:
	_pobj_exe1("before.choice.cont.process")
__________________
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
unable to add code through QKey VishalMistry Tools Development 4 19th July 2016 12:44
writing a log file from a Unix script pjohns Operating Systems & Databases 8 11th April 2003 21:52
CODE: Removing unwanted items from Baan Francesco Code & Utilities 0 17th January 2003 19:42


All times are GMT +2. The time now is 05:35.


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