Skip to Content
0

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

Feb 01, 2017 at 01:23 PM

105

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

8 Answers

Taseeb Saeed Feb 02, 2017 at 05:28 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

0

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

0
Girish Patil Feb 02, 2017 at 07:24 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi girish

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

am using version 9

Regards

0

Hi Shahan,

This functionality is available from 9.1

go through another options

Thanks

0
Nagarajan K Feb 02, 2017 at 07:42 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

0
Nagarajan K Feb 02, 2017 at 12:24 PM
0

Have you checked my TN?

Share
10 |10000 characters needed characters left characters exceeded
Nagarajan K Feb 02, 2017 at 12:47 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Nagarajan K Feb 02, 2017 at 01:10 PM
0

Do you want block when field is empty?

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

0
Shahan Shams Feb 02, 2017 at 01:03 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Taseeb Saeed Feb 05, 2017 at 11:47 AM
0

Hello,

Did you tried my code?

Thanks

Engr. Taseeb Saeed

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Yes, taseeb

its blocking only if partial remove or alter is done

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

Regards

0

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

1

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

0

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

1