kevalghelani
17th January 2014, 16:36
Thanks
I have one another question
What is alternative of attr.input in ln?
I use disable.fields but it not working
my requirements is below:
I write code as below:
field.name:
before.input:
disable.fields (READONLY,"name")
this work properly but after disabling name field I want focus move to next field instead previous field...
bhushanchanda
17th January 2014, 17:43
Hi,
If you are not letting any input to the field as your code shows, you can just make it as display field.
And, if you want to use disable.fields() try something like this:-
before.display.object:
disable.fields("name")
This is not within the field section.
kevalghelani
18th January 2014, 05:23
Thanks for reply but I want to use it into before. Input actually based on other fields value I want to disable field just like:
field.emno:
before.input:
field.name :
before.input:
if emno = xxx then
disable.fields ( READONLY, " name " )
end if
.....
Similarly each field depends on one or more field. .
and I want after disabling name field focus move to next field(address) instead previous field (emno)
bhushanchanda
18th January 2014, 06:15
Hi,
Try the other ways:-
field.emno:
after.input: | or when.field.changes: or check.input:
if emno = xxx then
disable.fields("name")
end if
Else, you can try before.field: section, not sure though.
field.name:
before.field:
if emno = xxx then
disable.fields("name")
end if
kevalghelani
18th January 2014, 06:51
Thanks but it not working in before. field and if user not follow tab sequence then after. Input not called that means unexpected results. .so there any way to use attr.input in LN actually I am working on migration project from baan 4 to Ln
it works fine in baan 4 with attr.input but in Ln what I do
bhushanchanda
19th January 2014, 10:53
Hi,
I don't have access to my system right now. But, if the pointer doesn't go to the next field, try using to.field("field_name"). Will need to check once I get back.
kevalghelani
20th January 2014, 12:33
Ya but it not working in before. Input or before. Field....so it is worth less...
NPRao
21st January 2014, 00:52
so there any way to use attr.input in LN actually I am working on migration project from baan 4 to Ln
it works fine in baan 4 with attr.input but in Ln what I do
kevalghelani,
As Bhushan, suggested using the disable.fields() in the before.display.object is appropriate. What is the point of upgrading to the new Tools version and trying to use the old style coding?
Also, refer to the programmer's manual -
boolean attr.input 4 D false input disabled
true input enabled
This variable is supported for backward compatibility only. In preference, use disable.fields() and enable.fields() functions.
Also, check for the other function -
field.is.applicable()
Syntax:
function boolean field.is.applicable ( [long mode] [, long element])
Description
Use this hook to indicate whether the field is applicable. If a field is not applicable then the 4GL Engine disables the field and the field will be cleared. Depending on the data type of the field the field's value then becomes:
string ""
double 0.0
long 0
enum The default value as defined in the Data Dictionary
Arguments
[long mode] optional mode flag, one of { 0, DAL_NEW, DAL_UPDATE }
[long element] optional element number in case the field is an element of an array (for non array fields this value is 1)
Return values
The hook should return False in case the field is not applicable. In that case the 4GL engine will disable the field in the UI and the field will be cleared. In any other case the hook should return True (i.e. the field is applicable).
Context
This function is implemented in the 4GL Engine and can be used in DAL script types.
When called
At the time the 4GL engine determines whether fields need to be disabled cq. enabled: this is done just before calling the before.display.object and the when.field.changes sections
At the time of checking the field's value, in case the field is not empty and the field is not never applicable.
In case the field is defined as a DAL2 Field dependencies of another field and that other field changes. See also the field.update() hook.
Note
In this hook you should test on fields belonging to table of the DAL (current record values).
If this hook does not exist, it is assumed that the field is applicable. Note that the field can still be never applicable!
The 4GL engine will show the following message to the end-user in case the field has a value and it appears to be not applicable: The %1$s field must be empty.
It is advised to set an error message with dal.set.error.message() to indicate the reason why the field is not applicable.
Example
function extern boolean whinh200.sfit.is.applicable()
{
if whinh200.ittp <> whinh.ittp.item.transfer then
dal.set.error.message("whinhs0239")
|* The Ship-from Item is not applicable in case the
|* Inventory transaction type is not set to Item Transfer.
return(false)
endif
...
return(true)
}
dhruv_x0
21st January 2014, 16:15
Hi,
You can disable that field in after field section of emno like this
field.emno:
after.field:
if emno = xxx then
disable.fields ( READONLY, " name " )
end if