greasedman
6th May 2005, 12:59
Today I'M REALLY REALLY disappointed with BaaN!
Please help me 'cause I'm going to burning it :mad:
In some circumstances I have to disable ANY input for ALL fields in a session (tipcs2150s000); so, i wrote something like this:
field.all:
before.input:
select tipcs021.csig.c
from tipcs021
where tipcs021._index1 = {:tipcs022.cprj,
:tipcs022.mitm}
selectdo
if strip$(tipcs021.csig.c) = "OK" then
attr.input = FALSE
endif
endselect
So, the program script correctly puts the correct value for attr.input, but in some before.input.<field.name> (that are excetuted after before.input of field.all) my script gets some values and I see that when it uses refresh() or just display("field") attr.input takes immediately its default value.
HOW THE HELL could I do to solve this simpy customization that is wasting my time!?!??!! :mad:
mark_h
6th May 2005, 15:32
attr.input means that the user can not input into the field. It does not mean that you can not set the field to have a values(or default values). If you want the fields empty then on the field in question do something like this:
field.xxx:
before.input:
if attr.input then
field = somevalue
else
field = ""
endif
greasedman
6th May 2005, 15:45
I know, my english is really poor, but I mean exactly that I don't wanna have this field on input... fields are too much, i can't replicate this control in all fields...
So I don't wanna the program script changes the value for predefined variable "attr.input", but it does it everytime use refresh() or display() :mad:
Someone knows something that could help me?!?
Tnx
advrij
6th May 2005, 16:13
Hi,
Are you sure attr.input is set? Can you see that the line is executed when you run this in debug mode?
Andre
greasedman
6th May 2005, 17:17
Hi,
Are you sure attr.input is set? Can you see that the line is executed when you run this in debug mode?
Andre
Of course, it is.
Tracing attr.input in debug mode I can see its value is correct until the program ecnounter some display function that reset its value :(
Try to change before.input to before.field -
field.all:
before.field:
select tipcs021.csig.c
from tipcs021
where tipcs021._index1 = {:tipcs022.cprj,
:tipcs022.mitm}
selectdo
if strip$(tipcs021.csig.c) = "OK" then
attr.input = FALSE
endif
endselect
Doing this check for all the fields hit performance. You can change it to set a flag on/off when the check gets triggered.
Please post the complete code for others to help you.
greasedman
9th May 2005, 12:33
This is not a solution, cause program script executes it before doing event field for each field.
It runs the field.all:before.field BEFORE running field.fieldname:before.field and field.fieldname:before.input, so the attr.input value may change.
I solved this problem using before.choice:modify.set
choice.modify.set:
before.choice:
select tipcs021.csig.c
from tipcs021
where tipcs021._index1 = {:tipcs022.cprj, :tipcs022.mitm}
selectdo
if strip$(tipcs021.csig.c) = "OK" then
choice.again()
endif
endselect
but i'm still angry with baan :mad:
Thanks anyway
Evert-Jan Bosch
17th May 2005, 13:42
Is this what you want to reach?: Nobody can change the value of the fields. Is that right? If so, you can try next code:
choice.modify.set:
before.choice:
select tipcs021.csig.c
from tipcs021
where tipcs021._index1 = {:tipcs022.cprj,
:tipcs022.mitm}
selectdo
if strip$(tipcs021.csig.c) = "OK" then
choice.again()
endif
endselect
NPRao
25th May 2005, 21:52
Check if you have this library in your BaaN Version -
tccom.dll0000.disable.table
void tccom.dll0000.disable.table( domain tcmcs.st20 i.table.name, ... )
Expl. : Disables all fields from a specified table at the form.
Pre : -
Post : -
Input : i.table.name - Name of the Table (string).
Output : -
Returns : -
keep Cool :)