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
30%
500 - 800 GB
3%
800 - 1200 GB
7%
1200 - 1500 GB
10%
1500 - 2000 GB
13%
> 2000 GB
20%
Total votes: 30

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 14th May 2003, 21:50
trchandra trchandra is offline
Member
 
Join Date: Sep 2001
Location: Orange County
Posts: 99
trchandra is on a distinguished road
Baan: 5.0b - DB: Oracle 8i - OS: HP-UX 11.0
Question excuting before.program()

Hi,
I am trying to do something similar to Filter option available in every session. Basically I want to filter the records on a session based on input from the user. It is like dynamically building query.extend.where() function on fly. But I cannot use this function in any other sections except before.program. I am wondering is there any way to trigger before program from any part of the script.

Structure of program is like...

Code:

   table  twhinr140
   extern  domain tcitem item
   
  string  query(80)
   long    fire.query

before.program:
   if fire.query then
       query.extend.where("whinr140.item like " & query)
   endif

field.item:
when.field.changes:
     if not isspace(item) then
         query = ".*" & item & ".*"
         fire.query=1
     else
         fire.query=0
     endif
|Here I should be able to reexcute before.program 
|so that the records will be filtered with query.extend.where()

I created session of type multi-occ display session.

I appreciate your help

regards
__________________
ravi
Reply With Quote
Sponsored Links
  #2  
Old 14th May 2003, 22:17
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,070
NPRao will become famous soon enough
Baan: Baan 4-5,5.2(Reger),LN-6.1,Infor LN-10.x - DB: Oracle,MS-SQL - OS: HPUX, Linux, Windows
After you use query.extend.where() execute - rebuild.query()
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #3  
Old 14th May 2003, 22:21
dnnslbrwn's Avatar
dnnslbrwn dnnslbrwn is offline
Senior Member
 
Join Date: Jan 2003
Location: Toronto
Posts: 149
dnnslbrwn is on a distinguished road
Baan: IVc4 - DB: Informix - OS: Unix
Just curious... do the sections in 'on.main.table:' still exist in BAAN V? Not a good solution at all, but would it work to use skip.io() in 'after.read:'?

Cheers,

-Dennis
Reply With Quote
  #4  
Old 15th May 2003, 10:35
klixy23's Avatar
klixy23 klixy23 is offline
Senior Member
 
Join Date: Feb 2002
Location: Germany
Posts: 116
klixy23 is on a distinguished road
Baan: BaaN IVc4 - DB: Informix - OS: Windows Sever 2003
I'm on IVc4 and can only use the variable query.extension. Just this week I look for a solution to change the query.extension dynamically. I solve my problem as follow:

Code:
before.program:
	if strip$(argv$(1)) = "in.prod" then
		query.extension = "tisfc001.osta > tcosta.printed and tisfc001.osta <= tcosta.ready"
	else
		query.extension = "tisfc001.osta <= tcosta.printed"
	endif

...
| in a choice.section
before.choice:
	if background then
		execute(end.program)
	else
		if strip$(argv$(1)) = "in.prod" then
			p_id = wait.and.activate(prog.name$, "")
		else
			p_id = wait.and.activate(prog.name$, "in.prod")
		endif
	endif
	choice.again()

If the user select the choice, the session starts again with an argument.
If the user select the choice in the restartet session the restartet session exits.
The first session can also start with the argument, then the session restarts without argument.
In the sample above there is a separation of planned and active production orders.
I think, the query.extension method is faster then to use skip.io() in main.table.io section.

Hope this help others too.

Have a nice day!
Reply With Quote
  #5  
Old 15th May 2003, 19:44
lbencic's Avatar
lbencic lbencic is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, IL, USA
Posts: 1,148
lbencic will become famous soon enough
Baan: 2.2d - LN - DB: most - OS: most
Thanks for the posts guys, I had this same problem. Klixy that did work, but I guess not happy to have the second session pop up & have 2 sessions open, etc.

I was able to make mine work with the rebuild.query in 1 session.
I have a button to toggle displaying items with signal code = "OBS". The session starts with the toggle not on (not displaying "OBS").

Code:
before.program:
                toggle.on = false
	query.extension = "tiitm001.cont = tcyesno.no"	|** Standard query extension
	query.extension = "tiitm001.csig <> "&chr$(34)&"OBS"&chr$(34)      |** Thanks, Mark H

.....

choice.cont.process:                   |** the Toggle OBS button
on.choice:
	if toggle.on then
		query.extension = ""
		query.extension = "tiitm001.cont = tcyesno.no"	
		query.extension = "tiitm001.csig <> "&chr$(34)&"OBS"&chr$(34)
		toggle.on = false
	else	
		query.extension = ""
		query.extension = "tiitm001.cont = tcyesno.no"	
		toggle.on = true
	endif
	rebuild.query()
	execute(find.data)

Hope that helps
Reply With Quote
  #6  
Old 16th May 2003, 11:14
klixy23's Avatar
klixy23 klixy23 is offline
Senior Member
 
Join Date: Feb 2002
Location: Germany
Posts: 116
klixy23 is on a distinguished road
Baan: BaaN IVc4 - DB: Informix - OS: Windows Sever 2003
Thumbs up rebuild.query() also possible in 4c4

Hi lbencic,

I changed my script to use rebuild.query() and it works great! I don't know about this function, it isn't documented in "Tools Programmer's Manual" manual for 4c4. Until my test I had not hope that rebuild.query() works correctly on 4c4 (Wscite don't display this as function).

Here is my new code:
Code:
|************* FORM SECTION **************
form.1:
init.form:
	if strip$(argv$(1)) = "in.prod" then
		to.form(2)
	endif
before.form:
	query.extension = ""
	query.extension = "tisfc001.osta <= tcosta.printed"
	rebuild.query()
	execute(find.data)

form.2:
before.form:
	query.extension = ""
	query.extension = "tisfc001.osta > tcosta.printed and tisfc001.osta <= tcosta.ready"
	rebuild.query()
	execute(find.data)
The code in the choice section is no more longer needed.
BB have helped me again to learn more about BaaN and find a nice solution.

Have a nice day!
Reply With Quote
  #7  
Old 11th October 2018, 14:41
roysouvik roysouvik is offline
Junior Member
 
Join Date: Feb 2018
Posts: 8
roysouvik is on a distinguished road
Baan: LN - DB: Oracle, SQL Server - OS: Windows
function extern void toggle.filter() | Form command
{
static boolean filter.active

| Toggle the filter
filter.active = not filter.active

| Change the appearance of the form command
set.checked.command("toggle.filter", filter.active)

| The filter implementation...
if filter.active then
...
else
...
endif
}
Reply With Quote
  #8  
Old 11th October 2018, 14:56
roysouvik roysouvik is offline
Junior Member
 
Join Date: Feb 2018
Posts: 8
roysouvik is on a distinguished road
Baan: LN - DB: Oracle, SQL Server - OS: Windows
Thumbs up

Quote:
Originally Posted by roysouvik View Post
function extern void toggle.filter() | Form command
{
static boolean filter.active

| Toggle the filter
filter.active = not filter.active

| Change the appearance of the form command
set.checked.command("toggle.filter", filter.active)

| The filter implementation...
if filter.active then
...
else
...
endif
}
You Can Try This Code
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
db.drop.table() MakamArun Tools Development 30 1st December 2009 22:36
problem in zooming db1969 Tools Development 4 12th November 2003 10:47
Zoom problem SDerrick Tools Development 6 6th October 2003 15:30
button releated novicebaan Tools Development 5 17th July 2003 14:29
before.program popeye Tools Development 1 24th January 2002 23:46


All times are GMT +2. The time now is 16:31.


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