User Exit DLL does not restrict system from saving data.
I have an User Exit DLL on tfacp200. I have added some simple business logic which is executing properly. Even though system sets an error message in the execution and returns dalhookerror, data is getting saved in the session.
I have tried below simple code to re-check:
function extern long ue.before.before.save.object(long mode)
on case mode
Even this does not restrict system from updating record.
Thank You in advance!!
Table tfacp200 probably doesn't have a DAL - in 10.2.1 it doesn't. Depending on your enterprise server level, the UE may not execute since the DAL is not present or the standard session uses db.update instead of dal.* to update the record.
Prior to ES 10.3.1 - UE DLL executed when table has a DAL referenced and dal.save used to update OR when table doesn't have DAL referenced and dal.save used to update. Not executed when table has a DAL referenced and db.update used to update OR when table doesn't have DAL referenced and db.update used to update.
The rules slightly changed in ES 10.3.1 onward where the UE DLL is also executed when db.update is used to update. More changes introduced in ES 10.5 where a UE DLL may not execute when the table has an extension present.
If you're using ES 10.4, you might want to check solution 1687005, where the DALHOOKERROR status was ignored and still updating the record.
You can check if tfacp200 uses a DAL by looking at the initial page in ttaad4100 after entering the table. "DAL not active" means it's present. "DAL not available" otherwise. Can also check the 'scripts' tab in the standard table definition.
Are you sure it saves the data? Try changing some field like amount, save and then exit the session after you see the message and open it again. What value do you see on the amount field?
I tried it on 10.2.1 and it works fine. It does not revert the new value on the form after the error message, but it does not save the new value either. It does not let me update the field.
Please share your results.
Thank You guys for answering query.
@BaanInOhio, yes table tfacp200 has DAL. Solution you have mentioned is already installed on the server.
Yes system saves the data even after executing dalhookerror.
return(DALHOOKERROR) should return non zero value, if the value of DALHOOKERROR is zero, the record will get saved,
If you want assign, DALHOOKERROR as -1 and then return the value
I am not sure about this but you could give it a try..
Is your code executed at all? (Debugger is starting?) Most sessions will disable the DAL of tfacp200 and / or not make use of the DAL during inserts. So user exits on tfacp200 are usually not working: Either they don't get executed (older Enterprise server versions) or the will throw an error 205 making the session crash.
Best is just put it in debug in UI and check whats what??
I also faced same issue few months back and fixed by installing latest tools solution. Log incident with Infor.
|All times are GMT +2. The time now is 07:18.|
©2001-2017 - Baanboard.com - Baanforums.com