nehagarg
16th December 2016, 12:43
Hi,
I am trying to disable add.set standard command using 'standard.command.is.allowed' and also I included <bic_4gl2> in the program script, but still 'add.set' is not getting disabled even function is not getting called. Is there any issue with TIV?. Kindly help
function extern boolean add.set.is.allowed()
{
some condition
return(false)
else
return(true)
endif
}
bdittmar
16th December 2016, 19:18
Hello,
from dev guide:
function extern boolean mark.delete.is.allowed()
{
domain fmfoc.oorg origin.of.order
fmfoc.dll0100.get.origin.of.order(fmfoc200.orno, origin.of.order)
if origin.of.order <> fmfoc.oorg.man then
return(false)
endif
return(true)
}
function extern boolean add.set.is.allowed()
{
if <your condition> then
return(false)
endif
return(true)
}
When called
The 4GL engine will call one or more of these hooks just before the following event sections are executed:
before.display.object
Here commands are handled whose enabling depends on values of the whole occurrence. E.g. based on a status field the occurrence should be disabled and may not be deleted.
For editable overview sessions the MODIFY.SET command is handled.
For details session the MODIFY.SET, MARK.DELETE and TEXT.MANAGER commands are handled.
(MODIFY.SET influences whether the whole occurrence will be disabled).
read.view subevent of the main.table.io event
Here commands are handled whose enabling depends on the current view. E.g. a closed order does not allow lines to be added, or deleted. The order number field can be in the view.
For overview sessions the ADD.SET and GLOBAL.DELETE commands are handled.
For details sessions the ADD.SET command is handled.
For both types of sessions, the disabling of the DUPL.OCCUR command will be based the ADD.SET command, since DUPL.OCCUR is actually adding a record with default values.
after.choice subevent of the choice.mark.occur event
Here commands are handled whose enabling depends on whether records are marked. If one record is marked the DUPL.OCCUR, MARK.DELETE and TEXT.MANAGER commands are handled. DUPL.OCCUR is only handled in case the session has view fields, because the view may forbid lines to be added.
Regards
nehagarg
19th December 2016, 06:39
I tried, but add.set.is.allowed is not getting called.
sachinbaan
19th December 2016, 09:54
Hi,
You can try , disable.commands(ADD.SET)
kevalghelani
19th December 2016, 14:10
Hi Neha,
I am not sure about your session design. But as per the programmer guide:
read.view subevent of the main.table.io event
Here commands are handled whose enabling depends on the current view. E.g. a closed order does not allow lines to be added, or deleted. The order number field can be in the view.
For overview sessions the ADD.SET and GLOBAL.DELETE commands are handled.
For details sessions the ADD.SET command is handled.
For both types of sessions, the disabling of the DUPL.OCCUR command will be based the ADD.SET command, since DUPL.OCCUR is actually adding a record with default values.
So, I guess, session must have view field in order to execute add.set.is.allowed().
-Keval Ghelani