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
18%
200 - 500 GB
26%
500 - 800 GB
3%
800 - 1200 GB
9%
1200 - 1500 GB
12%
1500 - 2000 GB
12%
> 2000 GB
21%
Total votes: 34

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 2nd May 2018, 21:45
metropoj metropoj is offline
Senior Member
 
Join Date: Feb 2004
Location: Oshawa
Posts: 225
metropoj is on a distinguished road
Baan: LN FP7 - DB: MSSQL - OS: Win 7
Question Capture current field values before change.
Baan: Other/Unknown
C/S: None/Unknown

I am looking for some approaches to capture a specific field value BEFORE I actually change it.

Example: an Item Description.

I want to capture the current unmodified value and then also write the changed value.

I currently write my changed values via dal.set.field() without issue in the appropriate places within ueDLL's and DAL scripting.

Just wondering best way to grab the 'previous' value before i made a change.

Thanks !
Reply With Quote
  #2  
Old 3rd May 2018, 12:00
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 438
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi,

the standard function with.old.object.values.do() is the one which I would use in UeDLL or DAL.

You could do something like the following:

Code:
	table	ttcibd001	|Item Base data
	
	domian	tcdsca		old.dsca


function extern long ue.before.before.save.object(long mode)
{
	on case mode
	case DAL_NEW:
		break
	case DAL_UPDATE:
		with.old.object.values.do(get.old.values)
		break
	endcase
	return(0)
}

function extern long ue.after.after.save.object(long mode)
{
	on case mode
	case DAL_NEW:
		break
	case DAL_UPDATE:
		if tcibd001.dsca <> old.dsca then
			|Description is just being changed!!
			do.something.with(	tcibd001.dsca,
						old.dsca)
		end	
		break
	endcase
	return(0)
}

function get.old.values()
{
	old.dsca = tcibd001.dsca
}

function do.something.with(...)
{
...
}

Greetings from Cologne to Canada!
__________________
May the force be with you!

Last edited by vahdani : 3rd May 2018 at 12:10.
Reply With Quote
Sponsored Links
  #3  
Old 3rd May 2018, 14:38
metropoj metropoj is offline
Senior Member
 
Join Date: Feb 2004
Location: Oshawa
Posts: 225
metropoj is on a distinguished road
Baan: LN FP7 - DB: MSSQL - OS: Win 7
Interesting !

Ahhh, thanks for that functionality to look at.
That looks great.
This morning I thought about using a select statement in before.program: to grab my current unedited values and then when a change actually happens, write my record of current select first, then proceed to re-select the new values from the table before writing them as well.

Cheers.
Reply With Quote
  #4  
Old 3rd May 2018, 15:10
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 438
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi again!

I forgot: If you don't want to use DAL or UE you can use the function on.old.occ() in your session script which basically does the same thing. Something like:
Code:
declaration:
	domain	old.dsca

main.table.io:
before.rewrite:
	on.old.occ(get.old.values)
	if tcibd001.dsca <> old.dsca then
		...
	endif

functions:
function get.old.values()
{
	old.dsca = tcibd001.dsca
}
__________________
May the force be with you!
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
Script to change standard field value kantidas40 Tools Development 0 7th March 2015 10:36
How to capture a key stroke when leaving a field in a GUI session? BaaNovva Tools Development 5 20th February 2013 16:37
Change the default display of a field? athencke Tools Administration & Installation 2 11th July 2012 09:35
Default values for a range parameter field baan_fun Third Party Products 0 16th August 2004 15:04
pushing field values from one session to another when button clicked outra9e Tools Development 7 10th March 2003 11:46


All times are GMT +2. The time now is 02:59.


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