Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
17%
200 - 500 GB
17%
500 - 800 GB
6%
800 - 1200 GB
6%
1200 - 1500 GB
17%
1500 - 2000 GB
17%
> 2000 GB
22%
Total votes: 18

Baanboard at LinkedIn


Reference Content

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 19th May 2011, 17:27
Eddie Monster's Avatar
Eddie Monster Eddie Monster is offline
Guru
 
Join Date: Nov 2001
Location: Pittsburgh, PA, USA
Posts: 348
Eddie Monster is on a distinguished road
Baan: Baan IVc4 - DB: MS SQL Server 2008 R2 - OS: MS Server 2008 R2
Customized Maintain Session field not updating
Baan: Baan IVc4
C/S: Server

I have a customized maintain session that stores Supplier QMS metadata for various industries (Medical, Aerospace, Automotive, General). Business rules are applied against the data in this session and some data in another session which tracks Supplier Corrective Action Responses (SCARs) to determine a supplier status (Approved, Not Approved, Conditionally Approved, Executive Override). The main table that my session uses is tiobg999. The status fields belong to the main table (tiobg999.scsa, tiobg999.scsb, tiobg999.scsc, tiobg999.scsd), but are able to be modified by the user. Their value is determined by the application of the business rules against the data (coding within my session). My problem…. If I change data in my session or in the SCAR session which would then (through the application of the business rules) change the status of the supplier, the new status value displays on form, but does not change in the database. I’m not sure why this is. Below is the function which applies the business rules and returns the appropriate status. Any assistance would be greatly appreciated!

Code:
tiobg999.scsa = determine.medical.supplier.control.status()

|******************************************************************************
| This function will apply business rules to determine the status of a 
| medical supplier.
|******************************************************************************
function  domain tisupstat determine.medical.supplier.control.status()
{
	domain	tisupstat f.scst

	f.scst = tisupstat.notapprove
		
	|******************************************************************************
	| Application of Business Rules to determine the approval status for Medical Suppliers

		| Determine if Medical Industry is selected
			if tiobg999.inda = tgyenox.no then
				f.scst = tisupstat.notapprove
				return(f.scst)
			endif
	
		| Determine if there is a non-expired executive override
			if tiobg999.exoa = tgyenox.yes and tiobg999.exda >= ws.today then
				f.scst = tisupstat.override
				return(f.scst)
			endif

		| Determine if the Supplier Add/Change/Delete form is completed and on-file
			if tiobg999.sarc = tgyenox.no then
				f.scst = tisupstat.notapprove
				return(f.scst)
			endif

		| Determine if there is a non-expired ISO 9001 certificate
			if tiobg999.isoa = tgyenox.no or tiobg999.expa < ws.today then
				f.scst = tisupstat.notapprove
				return(f.scst)
			endif
		
		| Determine if any commodities have been assigned to determine if supplier is Critical or Major
			if ws.comc = "None" then
				f.scst = tisupstat.notapprove
				return(f.scst)
			endif
				
		| Determine if the supplier provides commidities which are classified as Critical.
			if ws.sccl = ticomclass.critical then
				| Critical commodities require Medical Validation.
				if tiobg999.mval = tgyenox.no then
					f.scst = tisupstat.notapprove
					return(f.scst)
				else
					| If there are non-accepted SCARs, then the supplier is disapproved.
					if ws.stus.disputed <> 0 then
						f.scst = tisupstat.notapprove
						return(f.scst)
					endif
					|If the Supplier no SCARs they are approved.
					if ws.stus.open = 0 then
						f.scst = tisupstat.approve
						return(f.scst)
					else
					| If there are accepted SCARs, then the supplier is conditionally approved.
						f.scst = tisupstat.conditional
						return(f.scst)
					endif
				endif
			else
				| Determine if the supplier provides commidities which are classified as Major.
				if ws.sccl = ticomclass.major then
					| See if any commodities are Testing types
					select	tiobg998.test
					from	tiobg997, tiobg998
					where	tiobg997.comc = tiobg998.comc
					and 	tiobg997._index1 = {:tiobg999.suno}
					and		tiobg998.test = tgyenox.yes
					as set with 1 rows
					selectdo
						| Major Suppliers that we use for Testing must have 
						| (non-expired) A2LA Certification.
						if tiobg999.atla = tgyenox.no or
						(tiobg999.atla = tgyenox.yes and tiobg999.adla < ws.today) then
							f.scst = tisupstat.notapprove
							return(f.scst)
						endif
					selectempty
						f.scst = tisupstat.notapprove
					endselect
		
					| See if any commodities are Calibration types
					select	tiobg998.test
					from	tiobg997, tiobg998
					where	tiobg997.comc = tiobg998.comc
					and 	tiobg997._index1 = {:tiobg999.suno}
					and		tiobg998.catt = tgyenox.yes
					as set with 1 rows
					selectdo
						| Major Suppliers that we use for Calibration must have 
						| (non-expired) ISO 17025 Certification.
						if tiobg999.isoe = tgyenox.no or
						(tiobg999.isoe = tgyenox.yes and tiobg999.expe < ws.today) then
							f.scst = tisupstat.notapprove
							return(f.scst)
							endif
					selectempty
						f.scst = tisupstat.notapprove
					endselect
				endif		
			
			| Major Medical suppliers must have either ISO 13485 or a Site Audit
			if (tiobg999.isob = tgyenox.yes and tiobg999.expb >= ws.today) or
			   (tiobg999.moss = tgyenox.yes and tiobg999.mssd >= ws.today) then
				f.scst = tisupstat.approve
			else
				| If there are non-accepted SCARs, then the supplier is disapproved.
					if ws.stus.disputed <> 0 then
						f.scst = tisupstat.notapprove
						return(f.scst)
					endif
				|If the Supplier no SCARs they are approved.
					if ws.stus.open = 0 then
						f.scst = tisupstat.approve
						return(f.scst)
					else
					| If there are accepted SCARs, then the supplier is conditionally approved.
						f.scst = tisupstat.conditional
						return(f.scst)
					endif
			endif
		endif

		return(f.scst)
}
Attached Images
File Type: jpg screen.jpg (101.8 KB, 20 views)
Reply With Quote
 


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
Issue in new developed maintain session VishalMistry Tools Development 2 12th August 2010 05:59
How to update Slow Moving display field in Maintain Item Data session? cheeyangt Distribution, Transportation & Warehousing 7 13th October 2009 04:07
Find in a Customized Display Session Hiba_t Tools Development 2 11th March 2008 09:12
Maintain session rj1234 Tools Development 1 19th November 2004 14:30
old value of field ??? (maintain session) Smiffy Tools Development 1 26th February 2002 15:13


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


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