IndoTech
13th June 2016, 14:50
Hi,

Is anyone help to know - In User Exit DLL - How to check the field is modified manually.

function extern long ue.before.before.save.object(long mode)
{
on case mode
case DAL_NEW:
break
case DAL_UPDATE:
if is.manual.change() then
tccom122.cfsg = "abc"
endif
break
endcase
return(0)
}

Regards
Kedar

bhushanchanda
14th June 2016, 11:10
Hi,

You won't be able to capture field change directly using UE as the UE will only cover DB actions on table like Insert, Update and Delete.

You can try creating a wrapper for standard script. If you can provide your requirement, someone might provide an alternate solution.

bbhawesh
14th June 2016, 12:48
If you are on latest tools you can try ue.get.origin (). We have following information in the Programmers guide

Syntax:
function extern long ue.get.origin ()

Description

This function returns the origin of the execution of the User Exit hook.


Return values
This hooks returns: UE_FROM_4GLE in case the hook was executed from the 4GL Engine. UE_FROM_DAL in case the hook was executed from a dal action. UE_FROM_DB in case the hook was executed from a db action.

Context
This function is implemented in the 4GL Engine and can be used in UEDLL script types.

Ajesh
14th June 2016, 13:21
Why dont you just export a variable from when.field.changes section in the UI and then import it in the UE and check.

Something like


declaration:

extern boolean field.has.changed

field.x:
when.field.changes:
field.has.changed = true
export("field.has.changed"",field.has.changed)


and in the UE



function extern long ue.before.before.save.object(long mode)
{
import("field.has.changed",field.has.changed)
if field.has.changed then

endif

}

function extern long ue.after.before.save.object(long mode)
{
field.has.changed = false |Resetting the variable
}

IndoTech
15th June 2016, 09:05
Hi Bhushan

The requirement is we want to restrict change to financial supplier group field tccom122.cfsg in session tccom4122s000 for specific users while changing manually and not while a batch update program.

So how this can be achieved?
wrapper I didn't worked before.

Regards
Kedar

JaapJD
16th June 2016, 12:39
You can use personalize form to make the field readonly for certain users. Of course this only works if those users themselves are not allowed to personalize...

bhushanchanda
16th June 2016, 14:36
Or you can copy to a new session and edit the form to make the field as display only. Now, provide this session to the users who are restricted. This might involve a little more work though.

Other method is to go with Table field data authorization.