on 12-29-2014 6:33 AM
Hi Experts
I had created a UDF in Employee Master data ' Guaranteed ' and set the Default value as 'Y' & 'N'.
now what i required is when ever in an employees master data this Field is marked as 'Y' system should not allow to change the Department
and once if the same field is marked to 'N', system should allow to change the Department
same time when it is marked as 'Y', and if the user try to change the Department i need to pop up an msg stating
'Your are not Permitted to change the Department as this employee is a Guarantee '
how could i do this process,, is it possible via Fms or Store Procedure Transaction
pls help me to do it
REGARDS
Hi,
Make the reply is correct/helpful.
Regards,
Tausif
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
check the IF end block and add your code to ' Add your Code Block'
Regards,
Tausif
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try:
IF @transaction_type IN ('U') and @object_type = '171'
BEGIN
IF EXISTS(SELECT T0.[empID] FROM OHEM T0 WHERE T0.empid=@list_of_cols_val_tab_del AND T0.U_Flag='Y')
SET @error=10000
SET @error_message= 'You are not permitted to change the Department'
END
END
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi rajan
i had replaced the Field to my Field Name
The field type is 'AlphaNumeric'
**********************************************************************************************************************
IF @transaction_type IN ('U') and @object_type = '171'
BEGIN
IF EXISTS(SELECT T0.[empID] FROM OHEM T0 WHERE T0.empid=@list_of_cols_val_tab_del AND T0.U_Guaranteed='YES')
SET @error=10000
SET @error_message= 'You are not permitted to change the Department'
END
**********************************************************************************************************************
Regards
Hi,
Tested and working as expected:
IF @transaction_type IN ('U') and @object_type = '171'
BEGIN
IF EXISTS(SELECT T0.[empID] FROM OHEM T0 WHERE T0.empid=@list_of_cols_val_tab_del AND T0.[U_Guaranteed] ='Y')
SET @error=10000
SET @error_message= 'You are not permitted to change the Department'
END
Let me know your exact issue.
Hi rajan
thanks for the support
when am using this query am not able to change the U_Define field also from Y to N
How i need to work is
when the U_Define Field is marked as Y the user should not be able to change the department
but he should be able to change the U_Define Field from Y to N
once it is changed from Y to N the user should be able to change the Department also
hope u understand the process,,
Regards
Hi,
You can do this through Store Procedure.
" IF EXISTS(SELECT empid FROM OHEM T0 WHERE T0.empid=@list_of_cols_val_tab_del AND T0.U_Flag='Y')"
Regards,
Tausif
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Add the below code in transaction Notification.
Change the field name instead of 'U_Flag'
IF @object_type ='171'
BEGIN
IF EXISTS(SELECT empid FROM OHEM T0 WHERE T0.empid=@list_of_cols_val_tab_del AND T0.U_Flag='Y')
SET @error=10000
SET @error_message= 'You are not permitted to change the Department'
END
Regards,
Tausif
Hi Tausif
thanks for the support
as per you given the last SP, i try with the same
but am getting an error
'Could not commit transaction: Error -1 detected during transaction'
and also i could not change the user define field from 'Y' and 'N'
and also not able to change the Department
for both the same error is pop up
Regards
User | Count |
---|---|
99 | |
9 | |
9 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.