Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8526

Re: SP to Restrict Other Users to POST Journal Voucher

$
0
0

Hi,

 

Try adding  Convert(datatype,field)

 

ex:

 

IF (@object_type = '28') and (@transaction_type IN ('A', 'U'))

BEGIN

          IF EXISTS (SELECT T0.BatchNum from OBTD T0

          where T0.BatchNum = convert(int,@list_of_cols_val_tab_del) and T0.[UserSign]=1)

          BEGIN

                    Select @error_message = 'Your are not allowed to add the document'

          END

END

 

or try the one below.

 

IF (@object_type = '28') and (@transaction_type IN ('A', 'U'))

BEGIN

          IF EXISTS (SELECT T0.BatchNum from OBTD T0

          where convert(int,T0.BatchNum) = @list_of_cols_val_tab_del and T0.[UserSign]=1)

          BEGIN

                    Select @error_message = 'Your are not allowed to add the document'

          END

END

 

 

please take note if the BatchNum field datatype is nvarchar you should use the nvarchar(character size) ex: nvarchar(20) as datatype instead. same with the @list_of_cols_val_tab_del both field/parameter should be the same datatypes.

 

jim


Viewing all articles
Browse latest Browse all 8526

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>