mick_m
12th June 2002, 15:34
I have a form where the records are in customer number order. Is there a way to seperate customers with a blank line or highlighting the first record for a new customer number?
evesely
12th June 2002, 15:54
Have you thought about creating a type 3 form using customer as the view field? This way, you would have customer at the top of the form and only show the records for that one customer on the screen at any one time. You can then use the "*.view" choices (e.g., <<, >>, |<<, etc.) to move between customers.
If this won't work for whatever reason, you might be able write a script that would determine if a given record is the first for a customer and then set each field as reverse display. I haven't tried this, so I'm not sure if this will work.
However, my preference is for this first option.
mick_m
12th June 2002, 17:09
Thanks for your reply. In this instance it would be better to highlight. Can you give me some insight as to how this is done?
evesely
12th June 2002, 22:03
First, you need to come up with some code to determine if the record is the first for a customer. As an example, let's suppose you are just listing all of the sales orders by customer and sales order number. I would save the customer and lowest order number in fields. If the customer number matches, check the saved order. If not, check for the new customer. When the current order number is the lowest for the customer, set the attr.cf flag.
For example:
field.orno:
before.display:
if is.lowest.order() then
attr.cf = 4
else
attr.cf = 0
endif
...
function domain tcbool is.lowest.order()
{
if cuno <> hold.cuno then
hold.cuno = cuno
select tdsls040.*
from tdsls040
where tdsls040._index2 = {:cuno}
order by tdsls040._index2
selectdo
hold.orno = tdsls040.orno
selectempty
hold.orno = 0
endselect
endif
if orno = hold.orno then
return(true)
endif
return(false)
}
This is probably a very inefficient way of distinguishing orders, but I think it should work.
Good luck.
mick_m
12th June 2002, 22:12
I already had a routine to distinguish the first record of a group but I wasn't familiar with the attr.cf = 4. It works great! Is there something in the help feature that explains the attr.cf? Thanks so much for your time and help.
NPRao
12th June 2002, 22:28
You can look into the help manual -
search for cf$ for more options
donsrini
12th June 2002, 22:40
Prasanth,
Looking at the manual I found:
print cf$(4),"This is reversed printing on the screen",cf$(0)
© 1998 Baan Development B.V. All rights reserved
I put this code into a Baan session and it compiled, but when I run it, nothing happens? How do I use this print command? what am to expect?
regards,
Srini
NPRao
13th June 2002, 00:57
Hi Srini,
those options work for only BaaN-4 series kind of ASCII interfaces only. I didnt work with BaaN-4 after 1997 or so.
spartacus
16th September 2003, 11:09
Hi all,
strange but this example is also in the actual tools - help for BaaN ERP. But I think ERP doesn't support ASCII - Interfaces?