Skip to Content
avatar image
Former Member

FMS help

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Dec 29, 2014 at 07:04 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Dec 29, 2014 at 09:08 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • It  will work as per your requirement. To understand,

      1. Create new Employee with UDF = YES

      2. In this condition, not possible to update department.

      3. Chagen YES to NO, then you can update department.

  • avatar image
    Former Member
    Dec 29, 2014 at 10:25 AM

    Hi,

    check the IF end block and add your code to '  Add your Code Block'

    Regards,

    Tausif

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 29, 2014 at 11:17 AM

    Hi,

    Make the reply is correct/helpful.

    Regards,

    Tausif

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Tausif

      i have already send the query yesterday to the said mail id,,

      Hope u have received,, any further updates on the same

      Regards