cancel
Showing results for 
Search instead for 
Did you mean: 

How to block journal entry posting

Former Member
0 Kudos

How to block journal entry posting 

Accepted Solutions (1)

Accepted Solutions (1)

KennedyT21
Active Contributor
0 Kudos

Hi Rajeesh...

Can you explain in detail  what  case you need to block the Journal..

sample for the dimensions...

IF @object_type = '30' AND @transaction_type = 'A'

  BEGIN

    IF EXISTS (SELECT

        TransId

      FROM jdt1 t1     

      WHERE @list_of_cols_val_tab_del = TransId AND (ISNULL(t1.ProfitCode, '') = '' OR ISNULL(t1.OcrCode2, '') = ''))

    BEGIN

      SET @error = -2

      SET @error_message = 'Select the Dimensions and Departments'

    END

  END



Regards

Kennedy

Former Member
0 Kudos

This is our old db. I want to stop new posting from 2014-07-10

KennedyT21
Active Contributor
0 Kudos

Try  This

IF @object_type = '30' AND @transaction_type = 'A'

  BEGIN

    IF EXISTS (SELECT

        TransId

      FROM OJDT t1    

      WHERE @list_of_cols_val_tab_del = TransId AND   t1.CreateDate>='20140710'  )

    BEGIN

      SET @error = -2

      SET @error_message = 'Posting Not allowed'

    END

  END


Former Member
0 Kudos

we have to punch some details  <=2014079. kindly help

Former Member
0 Kudos

Dear Kennedy

below query is working for me.

IF @object_type = '30' AND @transaction_type = 'A'

  BEGIN

    IF EXISTS (SELECT

        TransId

      FROM OJDT t1   

      WHERE @list_of_cols_val_tab_del = TransId AND   t1.RefDate>='20140710'  )

    BEGIN

      SET @error = -2

      SET @error_message = 'You are not authorize to add.No new posting is allowed in WILLIAMPENN!'

    END

  END

Answers (2)

Answers (2)

Former Member
0 Kudos

How do I block same way other transactions too?

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this:

IF (@object_type = '30') and (@transaction_type IN (N'A'))

BEGIN

IF EXISTS (

SELECT TRANSID FROM OJDT A WHERE  TransId = @list_of_cols_val_tab_del)

BEGIN

Select @error = 10, @error_message = N'You are not authorize to add this JE'

END

END

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Nagaraj kindly specify the date range which i was given