Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 15th March 2005, 21:26
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
clear old occurrences

I have a type3 form with 12 occurences.
Through query extension, the number of actual occurrences differs based on the view part of the form.
So the first record may have 1 occurrence, the next 15, the next 2, etc.

Works great, but when I go from record 2 to record 1, (unused) occurrences 2-12 still display the values of record 2.

What is the proper way to clear these unused occurrences?
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas

Last edited by Francesco : 16th March 2005 at 10:54.
Reply With Quote
  #2  
Old 15th March 2005, 21:49
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
Visuals

To compensate for my confusing description of the issue, here are some screenshots.
Attached Files
File Type: doc occurrences.doc (88.0 KB, 143 views)
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
Sponsored Links
  #3  
Old 16th March 2005, 02:33
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Let me see if I understand correctly - in this session when you hit next and previous you rebuild and re-execute the query.extension to get the correct set of records - right? This form field is a table field? Not knowing what you have tried(equates to not knowing the answer) have you tried the typical refresh? I think there is something like refresh.all.mocc() - or is that a Baan V command. I wish I could remember where I was having something leftover in the form like this, but not with query.extension, and I had to do execute to get it to rebuild the info on the form correctly. I think I used execute(find.data) - I will try to look for this tomorrow, because I really can not remember what I did.

Mark

Go CARDS!
Reply With Quote
  #4  
Old 16th March 2005, 02:54
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
comforting

Quote:
Originally Posted by mark_h
Let me see if I understand correctly - in this session when you hit next and previous you rebuild and re-execute the query.extension to get the correct set of records - right?
Right.

Quote:
Originally Posted by mark_h
This form field is a table field?
Yep.

Quote:
Originally Posted by mark_h
have you tried the typical refresh? I think there is something like refresh.all.mocc() - or is that a Baan V command.
It's refresh.all.occs() and it doesn't work. Neither does the regular refresh.


I didn't think this was going to be such a hard question. I'm painfully reminded of the fact that in 10 years of Baan programming I have done precious little 4GL.

In a twisted way it is comforting that the solution is not as trivial as I thought it would be
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #5  
Old 16th March 2005, 09:56
kbartelds kbartelds is offline
Senior Member
 
Join Date: Feb 2003
Location: Netherlands
Posts: 264
kbartelds is on a distinguished road
Baan: B40c4 - DB: Oracle 7 - OS: Sun Solaris
As I can remember I once had the same problem as described, I think it was caused by the query extension. A refresh doesn't do the job, because it probably only looks at the actual occurrences. In my case a execute(first.set) in the after.choice of:
choice.prev.set
choice.next.set
choice.prev.view
choice.next.view
choice.start.set
choice.def.find
definitetly solved this problem.

Regards,
Klaas
Reply With Quote
  #6  
Old 16th March 2005, 11:20
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
no cigar

That didn't work either.

This is a persistent little bugger
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #7  
Old 16th March 2005, 17:12
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
You have what you want as a single occurance on the bottom, and, am I correct, when you add a tracking number you want it to go to the top and display in the mutli-occurance section, right?

I think you are trying to accomplish something like the Sales Order Lines session, but those are actually 2 different sessions in Baan IV, and that type of screen layout was removed all together in V+. It's not standard Baan 4GL, and if you try to do something not standard according to Baan, you will be fighting the 4GL engine.

Should be possible though, with lots of experimenting - I see you are up for that

What type of form have you declared this as, and what fields are those on the form vs. on the main table...is there an Order Number / Tracking Number relationship in the main table? I am thinking you would want a Type 3 form if that's possible with your table structure....?

If possible, post the code for the the queries and refreshes that you have running, and maybe background on the table relationships and session / form setup.
Reply With Quote
  #8  
Old 16th March 2005, 17:20
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
I should add, since you are this far, maybe if you put in a call to reset all the values before you re-issue the queries. something like

Code:
do.all.occ(reset.values)

....

functions:
function reset.values()
{
   form.field = ""
}

Probably need this in several sections, as Klaas suggests, but in the 'before.choice' sub section. Just be careful nothing gets saved as blanked over.
Reply With Quote
  #9  
Old 16th March 2005, 18:08
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
The dirty details

The case: Baan sales orders only have a single field to hold a tracking number. When shipping FedEx (and potentially other carriers), each box in an order has its own tracking number. Although there is one 'master' number, there is no way to recover shipping status of individual items from the FedEx website without knowing the individual tracking numbers.

My mission: Create a table in Baan that holds all tracking numbers per customer order. Then create a session where the warehouse staff can scan the FedEx labels into the new table.

Famous last words: I'll have that done tomorrow.

I started out writing a synchronized session (like sales orders), but it didn't work right because I am really only using a single table and with the pointers bouncing all over the place it became impossible to keep the two sessions in sync.

So plan B was this simple type 3 form (see screenshots above), with 1 master field for the order number, 1 input field for the scanned label, and 1 multi-occurence field for the tracking numbers per order.

My form code currently looks like this:
Code:
declaration:
	table	ttccom979	| Tracking Numbers by Order
	
	extern	domain	tcmcs.str19	tccom979.orno
	extern	domain	tcmcs.str32.l	scan
	extern	domain	tcmcs.long	tio
	extern	domain	tcmcs.long	scanned
	
	string	svia(12)

|****************************** FORM	    SECTION ***************************
before.program:
	
|****************************** TABLE       SECTION ***************************
 main.table.io:
 before.read:
	select	count(*):tio
	from	tccom979
	where	tccom979.orno = :tccom979.orno
	selectdo
	endselect
	
|****************************** CHOICE      SECTION ***************************
choice.first.view:
after.choice:
	execute(first.set)

choice.prev.view:
after.choice:
	execute(first.set)

choice.next.view:
after.choice:
	execute(first.set)

choice.last.view:
after.choice:
	execute(first.set)

choice.first.set:
after.choice:
 	
choice.next.set:
after.choice:
	execute(first.set)

choice.prev.set:
after.choice:
	execute(first.set)

choice.last.set:
after.choice:
	execute(first.set)

choice.start.set:
after.choice:
	execute(first.set)

choice.def.find:
after.choice:
	execute(first.set)
	
| choice.add.set:
| after.choice:
| 	instruction = add.set
| 	switch.to.process(child.id)
| 	
| choice.update.db:
| after.choice:
| 	instruction = find.data
| 	switch.to.process(child.id)
| 	
| choice.change.order:
| after.choice:
| 	instruction = change.order
| 	switch.to.process(child.id)
| 	
| choice.end.program:
| before.choice:
| 	commit.transaction()
| 	instruction = end.program
| 	switch.to.process(child.id, SWITCH.WITHOUT.WAIT)
| 	exit.value = wait(child.exit.id, WTHANG)
| 	
| choice.abort.program:
| before.choice:
|  	instruction = abort.program
| 	switch.to.process(child.id, SWITCH.WITHOUT.WAIT)
| 	exit.value = wait(child.exit.id, WTHANG)
| 	
|****************************** field section *********************************
field.svia:
init.field:
	attr.dorp = 1
	
field.orno:
when.field.changes:
	select	count(*):tio
	from	tccom979
	where	tccom979.orno = :tccom979.orno
	selectdo
	endselect
	query.extension = "tccom979.orno = :tccom979.orno"

field.scan:
after.input:
	svia = scan(17;12)
	db.retry.point()
	select	*
	from	tccom979 for update
	where	tccom979.orno = :tccom979.orno
	and	tccom979.svia = :svia
	as set with 1 rows
	selectdo
		|Record already exists
		scan = ""
	selectempty
		|New tracking #
		if not isspace(tccom979.orno)
		and not isspace(svia) then
			tccom979.orno = tccom979.orno
			tccom979.svia = svia
			tccom979.scan = scan
			db.insert(ttccom979, db.retry)
			scanned = scanned + 1
			tio = tio + 1
		endif
		scan = ""
	endselect
	commit.transaction()
	refresh()
	display.all()
	input.again()

I think the do.all.occ() alternative is the way to go but I was thinking that there should be a more elegant solution since I'm staying well within the boundaries of 4GL (not?).
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #10  
Old 16th March 2005, 18:32
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
Wink

I would say, no, not standard 4GL, because you are writing the insert into the main table yourself, and trying to filter/mimic the Type 3 session with the query extensions. Your main table for this session has Sales Order / Tracking Number as the key, right? Standard would be to just have that sales order number at the top, then when they want to add a box, they just choose 'insert', and go to the multi occurance to insert. If they are scanning, you can program the scanner to auto tab, so they immediatly go to the next field, ready for input of another tracking number. When done they choose 'save'. If you need to filter out what gets scanned with what you want to save...is that what I see there? Do it in the after input section.

If you have the key for your table to be Order / Tracking Number, Baan will take care of checking for duplicates as they enter.

For the query extensions to work mid-code, you need the rebuild.query call, or otherwise you have just modified a string that has no affect on the underlying query. Really, I see no need for your query extension, you are asking for all the records where the orno = the orno. Let the Baan Type 3 Form handle this. When you move to a new order number, it will automatically grab the tracking numbers from that order only (If orno is your view field, all of these are tccom979 fields, and you have a type 3 form...) You need to leverage the 4GL to do your work for you, instead of fighting it by writing your own inserts and data reads.

If you table is just Order Number / Tracking mumber, with that as the primary key, try a standard generate session with a type 3 form and and see what else needs to be changed.

Or try the do.all.occ, if that works
Reply With Quote
  #11  
Old 16th March 2005, 19:59
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
Thumbs up The ZEN of 4GL

ok, ok, I'm going with the flow now. Wax on, wax off. The way of the least resistance. I am the river. Less is more.

I will do some more experimenting.
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #12  
Old 16th March 2005, 21:29
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
Son of a monk!!

Problem solved.

I followed Lisa's advice and auto-generated a similar session. Much to my surprise it did the exact same thing......after I changed the svia field to 'Display Only'.

I always wondered what the difference was between 'Display' and 'Display only'. Now I know....Diplay Only messes up your form

This was simple after all. Here is the barebone working version:

Code:
declaration:
	table	ttccom979	| Tracking Numbers by Order
	
	extern	domain	tcmcs.str19	tccom979.orno
	extern	domain	tcmcs.str32.l	scan
	extern	domain	tcmcs.long	tio
	extern	domain	tcmcs.long	scanned
	extern	domain	tcmcs.str12	tccom979.svia
	
	string	svia(12)

|****************************** TABLE       SECTION ***************************
 main.table.io:
 before.read:
	select	count(*):tio
	from	tccom979
	where	tccom979.orno = :tccom979.orno
	selectdo
	endselect
	
field.scan:
after.input:
	svia = scan(17;12)
	db.retry.point()
	select	*
	from	tccom979 for update
	where	tccom979.orno = :tccom979.orno
	and	tccom979.svia = :svia
	as set with 1 rows
	selectdo
		|Record already exists
		scan = ""
	selectempty
		|New tracking #
		if not isspace(tccom979.orno)
		and not isspace(svia) then
			tccom979.orno = tccom979.orno
			tccom979.svia = svia
			tccom979.scan = scan
			db.insert(ttccom979, db.retry)
			scanned = scanned + 1
			tio = tio + 1
		endif
		scan = ""
	endselect
	commit.transaction()
	refresh()
	display.all()
	input.again()

Now excuse me while I go cry a bit.
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #13  
Old 16th March 2005, 21:47
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Quote:
I always wondered what the difference was between 'Display' and 'Display only'. Now I know....Diplay Only messes up your form
We do not have the "display only" field type in DFE now, its called "display on demand" field type.

Here is more info about it -

Quote:
Field Type:
Indicates the form field type.
The following options are available:
Display: Normal display field, input not allowed.
Input: Normal input field
Display on Demand: Display is only possible on this form field if the Baan 4GL
function display <field name> is used in the program script.

Input on a form field is also dependent on the input expression. A form field
can be a temporary display field if the attr.input is filled with the value
false in the before input section of the field in your program script.

Which means that is you choose Display on Demand the value in the field is only displayed after the function display("<fieldname>") is called.
Quote:
Suppose we have package te with module tst and table tetst100.
Create a details session tetsttesting with tetst100 as maintable and with
script tetsttesting. In the DFE add all table fields. For field tetst100.dod of
the select field type "Display on Demand".
In the UI script add the following:
function extern dod()
{
display("tetst100.dod")
}

Add a formcommand that runs function "dod".
If you run the session you will see that the field tetst100.dod doesn't display
and value, until you execute the formcommand. If you navigate to another
record, the field tetst100.dod will still display the old value until you
execute the formcommand again. So the the field tetst100.dod is not refreshed
by 4GL Engine, the programmer has to do this him self in the UI script.

Note that this feature is only rarely used.
__________________
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
  #14  
Old 16th March 2005, 22:08
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
Holy Crypes - never use Display only

The meaning is the same as the new description in LN says 'Display on Demand', same thing it looks like, just a (MUCH!) better description. Can't tell you how many people have thought. Hmm.. Display Only, yes, that's what I want, only display.....
Reply With Quote
  #15  
Old 16th March 2005, 22:34
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Looks like refresh worked - good thread. I finally chased down the sessions where I thought I had the problem - in one I used execute(first.set) like Klaas suggested and in another I did a execute(find.data). In the one where I did the execute first.set I had a very ugly query I build to drive the session - I can not remember why query.extension did not work, but I had my reasons. I will have to look at this more - the script was scary.

In the second session I recall processing the records and it leaving something showing and a find move it to the next batch of records. I also recall that when I deleted one record from the end it might leave something showing and the execute find seemed to clear this up.

Glad to see you got it resolved - will have to keep this in mind.

Mark
__________________
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
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
Is there a way to mark all occurences on a form at once? jcook331 Tools Development 4 2nd September 2004 08:34
passwords in clear text and password protected roles bypass petefinnigan Operating Systems & Databases 0 14th March 2004 19:29
one thing is clear : Baan and SSA will buy. (From Information Week) bamnsour General Discussion & Chat 2 13th June 2003 11:52
Clear stock of a warehouse gentercz Distribution, Transportation & Warehousing 2 15th July 2002 15:39


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


©2001-2017 - Baanboard.com - Baanforums.com