tgs100
22nd October 2002, 11:04
Hi,

I am giving below one of my users requirement.

Our BaaN set up is BaaN 4c4, OS is Unix and windows client.

We have one customised update session inwhich there are
around 20 fields. If any of the field contains the value "1" then
no updation is allowed. I did this also (attr.input = false ).

What the user wants is, if the field value is "1" ( can not be
updated ) then the color of the field should be different from
other fields.

In short, I need to change the color of the field at runtime.

Any possibilities ?


Best Regards

Saravanan

dbclark79
11th November 2002, 16:47
Saravanan,

It is not possible to change the color of a label or form field via Baan programming language when the BW Client is being used in Baan IV & BaanERP 5.0b/c. The next version of Baan (code named "Gemini") will have this functionality.

Your alternatives at this point include:
* Use BA (Baan ASCII) interface.
* Display a graphic (such as a red checkmark or similar) next to the form field when your condition is met.
* Diplay another form-field message (such as "NOTICE!!!!") next to the indicated field when the condition is met.


David

NPRao
11th November 2002, 19:47
You might have to create your own objects -

create.object() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_user_interface_objects_create_object)

or try to explore with -

DsCcolorCell (http://www.baanboard.com/programmers_manual_baanerp_help_functions_user_interface_objects_dsccolorcell)

vineetu1
9th February 2007, 09:56
Hi All,

I have been searching various threads/posts to find a solution for my requirement, but have not found any specific answer...

my requirement:

On a multiocurrance form (with view field), if the available stock is less, I need to highlight that particular occurence. i.e. say make the whole row red, or make the available stock field red...etc.

Baan has a predefined variable attr.color

attr.color R/W color of current field
The following colors are available:
0 - CW.BLACK
1 - CW.RED
2 - CW.GREEN
3 - CW.YELLOW
4 - CW.BLUE
5 - CW.MAGENTA
6 - CW.CYAN
7 - CW.WHITE
8 - CW.GRAY

how and where is this used. Can this be used to fulfill my requirement ?

Also want to know how to use create.object() on a multiocc form, to answer my requirement ? (codes would be helpful)

vineetu1
12th February 2007, 05:24
Hi Guys,

Any suggestions ?

mark_h
12th February 2007, 14:57
I could never get the colors to work and I did not want to do all the work or coding required with create.object(would have actually had to figure it all out). What I did for my user was to put another field on the multioccurence form. When a condition was met it would put an "*" next to the field. This way they knew which records they needed to address.

vineetu1
13th February 2007, 09:07
Hi Mark,

Actually I have already incorporated the concept of printing "*" to highlight any particular row.

It's just that colour would be more colourful ??? ;)
What do u say ?

mark_h
13th February 2007, 15:15
The only other thing I can think of is to use create.object like NPR suggests. Or you can try this (http://www.baanboard.com/baanboard/showthread.php?t=16616&highlight=color+form). Maybe just draw a red or blue square on the session where you want it.

vineetu1
14th February 2007, 08:01
In that case, how can I achieve,

1) Print multiple objects for various occurance. For this how do i get the appropriate co-ordinates.

2) How to print the box-object which is transperent or translucent so that if it overlaps any existing field the underlying field is visible.

mark_h
14th February 2007, 15:20
Well for #1 you would have to map them out so as the user scrolled the boxes or such would move with the record. As for #2 I really do not know - the only thing I can recommend is reading on create.object and all of its options.

NPRao
14th February 2007, 22:30
Vineet,

Refer to the link - change.sub.object (http://www.baanboard.com/programmers_manual_baanerp_help_functions_user_interface_objects_change_sub_object)

Also note -
Deprecated. This function is only supported for Baan Windows and its usage is therefore deprecated.

You have to make a cost-benefit analysis if this requirement is critical for you or just a fancy desired feature.

All these functions will not be compatible in WebTop.

shah_bs
15th February 2007, 19:42
Here is the next best thing to color:


field.field:
before.display:
if field = 1
then
attr.cf = ATTR.CF.NORMAL
else
attr.cf = ATTR.CF.REVERSE
endif


You can replace the "if field = 1" with whatever applies to your situation.

It should have the visual impact you are trying to achieve, but, unfortunately, no colors.

vineetu1
21st February 2007, 17:05
Are
attr.cf = ATTR.CF.NORMAL & attr.cf = ATTR.CF.REVERSE

valid and applicable in Baan IV C4. I Ttried it but it does not work.

shah_bs
21st February 2007, 19:46
Please add the following defines at suitable place in the code:


#define ATTR.CF.NORMAL 0
#define ATTR.CF.REVERSE 4


My apologies ...

Gwehles
22nd February 2007, 14:33
Bonjour,
Pourquoi pas dessiner devant les champs à remplir un object qui change de couleur suivant la valeur.

Gwehles
22nd February 2007, 14:38
Sorry, posted in frensh.
My suggestion is to draw a object before each field and update the color of the field following the value.

en@frrom
23rd March 2007, 17:32
Hello,

I am trying to also show fields in a specific way conditionally (based on their value). Preferebly I would like to change the color, if colour cannot be changed (without programming the whole form with 25 fields in 3GL using create.object(), which is crazy work), at least I would like some other way of marking, a bit less old fashioned than adding '*' or so next to the fields.

As mentioned, my form has approx. 25 fields, and all fields should change conditionally, so I do not want to start programming x,Y positions of color objects next to each field....

I tried using attr.color and attr.cf, however, unfortunately it does not seem to have any effect...

Any input would be highly appreciated!

Regards,
Eli Nager

Hitesh Shah
25th March 2007, 08:03
Hello,
I tried using attr.color and attr.cf, however, unfortunately it does not seem to have any effect...

Any input would be highly appreciated!



I remember having used successfully attr.cf = 4 (for reverse font) . Have u tried that.

en@frrom
26th March 2007, 09:56
I have tried to use attr.cf (and attr.color) in before.diesplay field-sections, and even in before.form and before.program sections. No results...

Hitesh Shah
26th March 2007, 19:40
For us attr.cf = 4 in before display section of a display field gives the display in reverse in GUI BW interface . Making fonts bold does not work (attr.cf = 1 and others ) .

Attr.color and attr.cf works completely only in BA interface (which of course very few would have it ) .