on 05-19-2011 4:05 PM
I am having the following code in SP_TN that successfully protects changing Items that are used as sample Items and base to duplicate from.
It only can not detect changing of the ItemCode itself.
IF @object_type = '4' AND @transaction_type = 'U'
BEGIN
IF EXISTS (SELECT T0.ItemCode FROM dbo.OITM T0
WHERE T0.ItemCode = @list_of_cols_val_tab_del AND T0.QryGroup64='Y')
BEGIN
IF EXISTS (SELECT T1.ItemCode FROM dbo.AITM T1
WHERE T1.ItemCode = @list_of_cols_val_tab_del AND T1.QryGroup64='Y'
AND T1.LogInstanc = (SELECT MAX(T2.LogInstanc) FROM dbo.AITM T2 WHERE T2.ItemCode = @list_of_cols_val_tab_del))
BEGIN
SET @error = 1
SET @error_message = N'Dies ist ein schreibgeschützter Musterartikel ! - Fragen? Fragen!'
END
END
END
Any suggestions on how to add that it detects every change, including changing the ItemCode?
Thanks
Franz
Hello
Means you want to say that how can i track item code going to change ? am i correct or any other query ?
Thanks
Manvendra Singh Niranjan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am having some items that are used by the users like templates with predefined settings to create new items. Usually the user should duplicate the template item and then make his changes and then add it.
Since the users sometimes forgot to duplicate before making their changes the templates always have been overwritten.
The current sql posted prohibits updating if the Flag64 is set for all fields, except for the ItemCode itself. That is waht I want to add now.
This is far from the concept/idea.
How would I know that somebody has overwritten the template? There would be some detection logic ... and this logic is exactly what I need to complete the wrtie protection. If I would know that, then I would not need this whole thing.
Second, somebody would then have to fire DTW - obviously not a normal user - to do what?
Sorry, but this is really is far away from simply having a write protected item as a template.
This sounds like a very good idea.
I tried to put that into some SQL ... I seem not to to be able do it right.
Do I have to explicitly use the ItemCodes like 'Template1' in the SP_TN?
I don't get how to check for the QryGroup64 only, without link to the newly created itemcode.
Could you please assist with these lines?
Thanks
IF @object_type = '4' AND @transaction_type = 'D'
BEGIN
IF (SELECT T0.QryGroup64 FROM dbo.OITM T0
WHERE T0.DocEntry = @list_of_cols_val_tab_del) = 'Y'
BEGIN
SET @error = 1
............
Edited by: Franz Leu on May 23, 2011 10:38 AM
The problem is that the SBO_SP_TransactionNotification sees the OITM after the deletion and that there is no entry in the AITM for the deleted item.
You might add some standard text at the end of these item codes (e.g. u2018u2013modelu2019) and forbid the deletion such items:
IF @object_type = '4' AND @transaction_type ='D'
BEGIN
IF @list_of_cols_val_tab_del like '%-model'
BEGIN
SET @error = 1
SET @error_message = N'Dies ist ein schreibgeschützter Musterartikel ! - Fragen? Fragen!'
END
END
Thanks a lot! Great!
This works so far as I could test in some minutes.
Just for my understanding ... to learn for future use: As I could see it does test for the string in ItemCode only, which is perfect.
So, IF @list_of_cols_val_tab_del like '%-model' does test in ItemCode only, not in all data?
Thanks a lot for your help!
Franz
User | Count |
---|---|
105 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.