pralash
5th January 2018, 13:10
Hi,

I'm new for LN Programming.... I have seen the term DALHOOKERROR while refer some of the existing script. But I don't have the proper idea about it. Hence could you please explain in detail about DALHOOKERROR with some example script?

Thanks in Advance!
Regards,
Pralash

bhushanchanda
5th January 2018, 13:24
Hi,

DALHOOKERROR can be used as a return value. It is mostly used for field validations and transaction validations.

Say, if you want to throw an error message from your DAL if a field has an invalid value, you can use something like this -

if some_condition_not_met then
dal.set.error.message("@Error condition message")
return(DALHOOKERROR)
endif

Like the way, you can use set.input.error()/skip.io()/abort.io() in your 4GL scripts, you can use DALHOOKERROR in your DAL scripts.

Here's an example field hook -

function extern long tdsls040.oqua.check(long has_changed)
{
if has_changed <> 0 and tdsls040.stat = tdsls.stat.invoiced then
dal.set.error.message("tdsls44041")
| Order is already invoiced, cannot change
| quantity
return(DALHOOKERROR)
endif
...
return(0)
}

pralash
5th January 2018, 15:18
Hi Bhushan,

Thanks a lot for your information...
Regards,
Pralash

bdittmar
5th January 2018, 15:48
Hello,

refer to Infor - Guide, please.
Publication Information
U8883O US
Document code
10.4.1 (76a)


Regards