Method is Allowed hook
Use this hook to control whether new records can be inserted, existing records can be updated or deleted. The input argument for this hook is the method.
This tables shows the Method values:
Method |
Description |
---|---|
|
The hook is called to know whether records can be added. There is no current record, but in case of a session with a view, the view fields are available. |
|
The hook is called to know whether the current record can be updated. |
|
The hook is called to know whether the current record can be deleted. |
For more information, see
method.is.allowed()
of the standard Data Access Layer
in the
Infor ES Programmers Guide (Infor
Customer Portal KB2924522).
Note that this hook can only be used to set more restrictions. If the standard
functionality does not allow a certain action, the extension cannot allow it
either.
Example:
function extern boolean method.is.allowed(long method)
{
on case method
case DAL_NEW:
select tdsls400.cdf_blck
from tdsls400
where tdsls400.orno = :tdsls401.orno
as set with 1 rows
selectdo
if tdsls400.cdf_blck = tdcdf______chk.yes then
dal.set.error.message(
"@Order is blocked, you cannot add Lines to it.")
return(false)
endif
endselect
break
case DAL_UPDATE:
break
case DAL_DESTROY:
break
endcase
return(true)
}