cancel
Showing results for 
Search instead for 
Did you mean: 

Block user from changing the field 'Currency' on BP Master Data

Former Member
0 Kudos

Hi,

Can someone tell me how i can use SP Transaction Notification to block user from changing the field 'Currency' on BP Master Data to the value "All Currencies'?

Or if this is possible using UDF + FMS, please explain.

thanks

Accepted Solutions (1)

Accepted Solutions (1)

mikesimpson
Participant
0 Kudos

Maeve,

Had another play with the code and tided it up a little. It does work with an exception. If the user does choose the wrong currency it will lock the record and you will have to come out without saving changes. If the multi currencys is never selected then the code should never activate.

IF @object_type = N'2' and @transaction_type in ('U','A')

BEGIN

IF exists (SELECT OCRD.cardcode

FROM OCRD

WHERE (OCRD.CardCode = @list_of_cols_val_tab_del) AND OCRD.Currency = '##')

BEGIN

set @error = 1

set @error_message ='Please enter correct currency'

END

End

still... give it a good test.

thanks,

Mike

Answers (1)

Answers (1)

mikesimpson
Participant
0 Kudos

Maveve,

Please give the code some propper testing...

IF EXISTS (SELECT OCRD.Currency

FROM OCRD

WHERE (OCRD.CardCode = @list_of_cols_val_tab_del) AND OCRD.Currency = '##')

BEGIN

set @error = 1

set @error_message ='Please enter correct currency'

END

we only have Multi Currency on our system and the short code is '##' if this does not work take a look a the table using a query to see what is being used as a short code instead of '##'

thanks,

Mike

mikesimpson
Participant
0 Kudos

nope that does not work. it will not let you change the code afterwards... will take another look