cancel
Showing results for 
Search instead for 
Did you mean: 

SBO Procedure control to allow a user only to update bill to/ship to address

krishnam_mathur
Explorer
0 Kudos
106

Hi Community,

I need to allow some users to be able to just update/add bill to and ship to address. They should not be able to add new BP either.

As of my understanding, I need to compare values with history.

Here is the code i wrote to block all the options of OCRD update, so it should allow CRD1 update.

if (@object_type = '2') and (@transaction_type IN ('A','U'))

BEGIN IF exists

(select T1.CardCode

FROM OCRD T1

inner join acrd t2 on t2.cardcode=t1.cardcode and t2.loginstanc=(select max(logInstanc) from acrd where cardcode=@list_of_cols_val_tab_del)

where T1.Cardcode =@list_of_cols_val_tab_del and t1.usersign2='71' and

-----Here I am blocking all the other options

( t1.cardname<>t2.cardname or t1.cardtype<>t2.cardtype or isnull(t1.cardfname,1)<>isnull(t2.cardfname,0) or t1.groupcode<>t2.groupcode or t1.currency<>isnull(t2.currency,0) or isnull(t1.lictradnum,1)<>isnull(t2.lictradnum,0) or isnull(t1.phone1,1)<>isnull(t2.phone1,0) or isnull(t1.phone2,1)<>isnull(t2.phone2,0) or isnull(t1.cellular,1)<>isnull(t2.cellular,0) or isnull(t1.fax,1)<>isnull(t2.fax,0) or isnull(t1.e_mail,1)<>isnull(t2.e_mail,0) or isnull(t1.intrntsite,1)<>isnull(t2.intrntsite,0) or isnull(t1.shiptype,1)<>isnull(t2.shiptype,0) or isnull(t1.password,1)<>isnull(t2.password,0) or isnull(t1.projectcod,1)<>isnull(t2.projectcod,0) or isnull(t1.industryc,1)<>isnull(t2.industryc,0) or isnull(t1.cmpprivate,1)<>isnull(t2.cmpprivate,0) or isnull(t1.addid,1)<>isnull(t2.addid,0) or isnull(t1.notes,1)<>isnull(t2.notes,0) or isnull(t1.validfrom,1)<>isnull(t2.validfrom,0) or isnull(t1.validto,1)<>isnull(t2.validto,0) or isnull(t1.deferrtax,1)<>isnull(t2.deferrtax,0) or isnull(t1.vatstatus,1)<>isnull(t2.vatstatus,0) or isnull(t1.groupnum,1)<>isnull(t2.groupnum,0) or isnull(t1.intrstrate,1)<>isnull(t2.intrstrate,0) or isnull(t1.listnum,1)<>isnull(t2.listnum,0) or isnull(t1.discount,1)<>isnull(t2.discount,0) or isnull(t1.creditline,1)<>isnull(t2.creditline,0) or isnull(t1.debtline,1)<>isnull(t2.debtline,0) or isnull(t1.creditline,1)<>isnull(t2.creditline,0) or isnull(t1.dunterm,1)<>isnull(t2.dunterm,0) or isnull(t1.creditline,1)<>isnull(t2.creditline,0) or isnull(t1.housbnkcry,1)<>isnull(t2.housbnkcry,0) or isnull(t1.housebank,1)<>isnull(t2.housebank,0) or isnull(t1.housbnkact,1)<>isnull(t2.housbnkact,0) or isnull(t1.hsbnkiban,1)<>isnull(t2.hsbnkiban,0) or isnull(t1.debpayacct,1)<>isnull(t2.debpayacct,0) ) )

Begin SET @error = 30 SET @error_message = 'You are not allowed to make this change' end END

Accepted Solutions (1)

Accepted Solutions (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Have you tried with standard Authorization for adding and updating BP?

Regards,

Nagarajan

Answers (0)