cancel
Showing results for 
Search instead for 
Did you mean: 

Need to block editing, deleting adding the Global Location Number Field in Business Master data

Former Member
0 Kudos

Hi experts

i have some data in Business partner Data >> Global Local Number

the data what has been enter in that field should not be Removed for Edited by any of the End user, same time selected Super user only should be able to edit or delete or add

in that fields,

pls any one could share me the SPT code.

Regards

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

Hello,

Did you tried my code?

Thanks

Engr. Taseeb Saeed

Former Member
0 Kudos

Yes, taseeb

its blocking only if partial remove or alter is done

if i try to remove entire data, it will not block

Regards

Former Member

Hello,

Try this now

If @object_type = '2' And @transaction_type in ('A','U')
BEGIN




DECLARE @prvValue NVARCHAR(100)
DECLARE @crValue NVARCHAR(100)
DECLARE @user SMALLINT




SELECT TOP 1  
@prvValue =  ISNULL(T1.LicTradNum,'')  -- Change Field Name here
,@crValue = ISNULL(T0.LicTradNum,'')   -- Change Field Name here
,@user = t0.UserSign
FROM dbo.OCRD T0
LEFT OUTER JOIN  dbo.ACRD T1 ON t0.CardCode = t1.CardCode




WHERE t0.CardCode = @list_of_cols_val_tab_del
ORDER BY t1.LogInstanc DESC




IF @prvValue <> @crValue AND @user IN (1,2,3)  --Give User ID of those which would be restricted
BEGIN
SET @error = '381'
SET @error_message = 'You are not permitted to change ABC field'
END


END 

Thanks

Engr. Taseeb Saeed

Former Member
0 Kudos

Hi taseeb

Now its blocking all and less character, but i also need to the user to block if he try to add a data for the first time

in that field

Regards

Former Member

Hello

Please update previous code and only apply that for Update i.e. @transaction_type in ('U')

and add following code

If @object_type = '2' And @transaction_type in ('A')
BEGIN
DECLARE @Value NVARCHAR(100)
DECLARE @user SMALLINT
SELECT @Value =  ISNULL(T0.LicTradNum,'')  -- Change Field Name here
,@user = t0.UserSign
FROM dbo.OCRD T0
WHERE t0.CardCode = @list_of_cols_val_tab_del
IF  LEN(@Value) > 0 AND @user IN (1,2,3)  --Give User ID of those which would be restricted
BEGIN
SET @error = '381'
SET @error_message = 'You are not permitted to Add ABC field'
END
END 

Thanks

Engr. Taseeb Saeed

kothandaraman_nagarajan
Active Contributor
0 Kudos

Do you want block when field is empty?

Former Member
0 Kudos

No if its empty then don't block, if a data is enter for the first time, then it should not be removed, where here am able to remove if i try to remove the entire data, if it partial its blocking

also the same in Modification should not be allowed

Regards

Former Member
0 Kudos

Hi rajan

yes its blocking and allowing to add, but one more issue, if i try to remove all the data it is allowing, where if i try to remove some character or number it will block

Regards

kothandaraman_nagarajan
Active Contributor
0 Kudos

No, it will not block if GLN field is added first time. Please check it again.

kothandaraman_nagarajan
Active Contributor
0 Kudos

Have you checked my TN?

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this,

IF @transaction_type in ('U') AND (@OBJECT_TYPE='2')

BEGIN

If exists

( SELECT T2.[CardCode]

FROM ACRD T0 left join ACRD T1 on t0.[CardCode] = T1.[CardCode] and t0.loginstanc-1 = t1.loginstanc-1 left JOIN OCRD T2 ON T0.cardcode = T2.CardCode WHERE T2.[GlblLocNum] <> T1.[GlblLocNum]and T2.Cardcode = @list_of_cols_val_tab_del)

Begin

SET @error = 10

SET @error_message = 'Not allowed to update GLN value. Contact sys admin'

End

END

Former Member
0 Kudos

Hi taseeb

This TP works , but if my user try to delete all the Character or Numbers expect one (1) it will block

for example: if i have a data like 'Taseeb'. and if my user try to delete other than 'T' , he will be blocked, where if he delete the entire 'Taseeb', it will allow the user to remove and also allow to add the new one like 'Taseeb 1'

Regards

Former Member
0 Kudos

Hi Shahan,

Go through Edit Form UI

1. Open Business Partner Master Data

2 . Tools ---> Edit FORM UI ---> Right Click on GLN Field ----> Select Disable option ----> save

Thanks

Former Member
0 Kudos

Hi girish

i was not able to find Edit Form UI under Tool after open BP

am using version 9

Regards

Former Member
0 Kudos

Hi Shahan,

This functionality is available from 9.1

go through another options

Thanks

Former Member
0 Kudos

Hello,

You can achieve this by following ways

  1. Active this field only for the user you want deactivate it for others through form settings.
  2. Active this field only for the user you want deactivate it for others through Form UI.
  3. You can write a TN code for this as well.

Thanks

Engr. Taseeb Saeed

Former Member
0 Kudos

Dear Taseeb

This is not a User define Field, and i don't think form setting is Available for this

If you are talking about Form UI, its some kind of Tech, which is not familar with myself

TN code i think is the only possible way, so can u provide me TN if possible

Regards

Former Member
0 Kudos

Hello,

Please replace your relevant field name where i have commented in following code

If @object_type = '2' And @transaction_type in ('A','U')
BEGIN


DECLARE @prvValue NVARCHAR(100)
DECLARE @crValue NVARCHAR(100)
DECLARE @user SMALLINT


SELECT TOP 1  
@prvValue =  T1.LicTradNum  -- Change Field Name here
,@crValue = T0.LicTradNum   -- Change Field Name here
,@user = t0.UserSign
FROM dbo.OCRD T0
LEFT OUTER JOIN  dbo.ACRD T1 ON t0.CardCode = t1.CardCode


WHERE t0.CardCode = @list_of_cols_val_tab_del
ORDER BY t1.LogInstanc DESC


IF @prvValue <> @crValue AND @user IN (1,2,3)  --Give User ID of those which would be restricted
BEGIN
SET @error = '381'
SET @error_message = 'You are not permitted to change ABC field'
END

END 

Thanks

Engr. Taseeb Saeed