Hello experts
I am trying to create SP which achieves the following:
Prevent users from changing 'Main Sales Employee' (OOPR.SlpCode) field unless field is currently "-No sales Employee-"
But SP must not apply to user '6' (User 6 can always change this field)
This is what I have so far but is not functioning correctly:
IF @transaction_type = 'U' AND @object_type = '97'
and exists(select t0.SlpCode from OOPR T0 where T0.SlpCode != "-Main Sales Employee-"
and T0.UserSign != '6')
BEGIN
SET @error = 1
SET @error_message = N'Authorisation required'
END
any help would be appreciated
karen