Write-protect Item as sample

Hi
I'd like to write protect some Items that I have created as sample for different types of items with different settings.
This makes it easy for users to create new items because they can use the sample and make a copy of it and most of the settings com along from the sample.
Is there way to write-protect items?

I ended up with this:
-- Start: Schreibschutz für Artikel via Eigenschaft 64
IF @object_type = '4' AND @transaction_type = 'U'                                             -- Artikelstamm 'Aktualisieren'
BEGIN
     IF EXISTS (SELECT T0.ItemCode FROM dbo.OITM T0
          WHERE T0.ItemCode = @list_of_cols_val_tab_del AND T0.QryGroup64='Y')          -- Schreibschutz abfragen
          BEGIN     
               IF EXISTS (SELECT T1.ItemCode FROM dbo.AITM T1                                   -- um Schreibschutz zu setzen
                    WHERE T1.ItemCode = @list_of_cols_val_tab_del AND T1.QryGroup64='Y' -- muss in der History der neuste eintrag geprüft werden
                    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
-- Ende: Schreibschutz für Artikel via Eigenschaft 64
Basically works, except that it does not detect changes to the ItemCode itself.
Any suggestions?
Thanks
Franz

Similar Messages

  • Write protecting Item

    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

    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

  • Can't un-write protect TDM files

    I am using the storage VIs to manipulate a TDM file that was created using the TDM header writer API. When I try to do any operations on it (specifically, deleting a channel), i get error -2561 "Data storage is write-protected.". I have checked the permissions on the file and they should be correct.
    I ran some tests and found that i can create a TDM file using the storage VIs and delete a channel without any issues. According to LabVIEW, the file created using this method has the same permissions of the problem file.
    Do you think this could be a bug with the TDM header writer VIs? Or am i missing something obvious?
    I have attached  files showcasing the issue.
    Thanks in advance for any help.
    Attachments:
    TDM test.zip ‏131 KB

    Bazookazuz-
    The standard is described in the Developer Zone described above.  TDM files are binary files written such that it follows a particular pattern.  That way the data can be easily retrieved and interpreted later.  It is written in the fashion to save disk space and to be created/modified quickly.  All TDM files acquiring data from multiple channels follow the same format alternating between each channel taking each sample (also described in the Developer Zone article).  By converting the data to End-to-End, it makes all the data for each channel together. 
    In order to distinguish between the modified and unmodified tdm files, there is no way to just look at the file type and know without a naming scheme.  Programmatically, you can parse out the first few data sets and see if they are the same channel and then you can determine from there. 
    Regards,
    Mike S
    NI AE

  • Error: Attempted to read or write protected memory. Memory is corrupt

    2005A SP1 PL4
    I have added a user field with B1 in Items with success.
    Therefore I have started the addon and I have the following error at  SAPbouiCOM.SboGuiApiClass.Connect(String ConnectionStr):
    "Attempted to read or write protected memory. This is often an indication that other memory is corrupt"
    I have restart B1, and I have restart the PC, but the problem persist.
    Before I added user field, the addon worked
    Now if I open items system form, the user field not exists , not even I press CtrlShiftU
    It seems that the user fields are not record correctly
    Now I re-add a new second user field in items. Now there are all user fields in system form Items, but i have the same error with my addon.
    This is the second company that occorr this problem
    Is this a 2005A SP1 PL4 problem? Must I convert the company to 2005A SP1 PL11? Or are there other solution? 
    Help me
    Thank you

    I would strongly recommend to go up to PL11 - and then re-check the issue.
    If it still doesn't work:
    The minimum information to provide here would be the definition of the UDF! Since UFDs work in general there must be some issue with your specific UDF (or some combination of settings).
    Check table CUFD + the actual definition of the UDF in the SQL table as well.
    ...or just involve SAP Support...
    HTH,
    Frank

  • Attempted to read or write protected memory....Management Studio 2012

    I'm getting that error when I select "Edit Top 200 Rows" on a table. The SMSS will crash. This is running on Windows server 2012 R2. Is there a fix, SP update, something? I did not have this problem on Windows Server 2012.
    TITLE: Microsoft SQL Server Management Studio
    Exception has been thrown by the target of an invocation. (mscorlib)
    ADDITIONAL INFORMATION:
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (Microsoft.VisualStudio.OLE.Interop)
    BUTTONS:
    OK
    Lee

    Hi Lee,
    According to your description, it is a known issue that has been submitted to Microsoft. I recommend you voting in the following connect items, your feedback is valuable for us to improve our products and increase the level of service provided.
    http://connect.microsoft.com/SQLServer/feedbackdetail/view/952483/getting-error-when-right-click-table-of-sql-server-2014-db-and-click-edit-to-200-rows-in-ssms-2012
    https://connect.microsoft.com/SQLServer/feedback/details/817241/for-sql-2014-ctp-2-cu4-edit-top-200-rows-option-for-a-table-in-ssms-results-in-an-exception-and-tool-hang
    Additionally, I also reproduce the same error message as yours when using SSMS 2012 to connect  to SQL Server 2014 database on Windows Server 2008 R2  and selecting "Edit Top 200 Rows".
    To work around this issue, as Shanky’s post, please use SSMS 2014 to connect  to SQL Server 2014, then you can use the "Edit Top 200 Rows" feature. Or you can write T-SQL to edit data from SQL Server 2014 database in SSMS 2012.
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.

  • SharePoint crashing - Attempted to read or write protected memory

    Hey,
    My corporate intranet keeps crashing and becoming unresponsive. This is resolved by running an IISReset.
    The error reported is the standard SharePoint 2010 error page with a correlation id, an using ULS Deobfuscator the actual exception, which is:
    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Microsoft.SharePoint.Portal.WebControls.LocStringIdLookupTable..cctor()
    Could this be caused by custom code on the server? We have a lot of customizations, so it could be painful to track down. If I need to, are there any tools out there I could use to trace the source of the exception?
    Any help with this would be much appreciated as this is happening a lot and disrupting the companies function.
    Cheers
    M

    Hi All,
    i've been experiencing similar issues on some customer's sharepoint 2010 WFE's. Every few days, sometimes multiple times a day, one of the app pools somehow crashed, with the effect that every attempt to use the foundation search resulted in an unexpected
    error. In the ULS logs, we had the same AccessViolationException at the LocStringIdLookupTable static constructor. After an app pool recycle, the error was gone for a few hours/days and reappeared then.
    We've had another issue that seemed to occur on another farm with similar frequency: Suddenly, all list forms were empty and some (sharepoint internal) ribbon controls like "View Item", "Edit Item", "New Item" and several others. It turned out that several
    type instantiations failed for these ribbon controls (seen in ULS logs).
    After some investigation there seemed to be no real reason why these types couldn't be found, as all sharepoint assemblies have been in place, and after an app pool recycle, everything was running fine again.
    Then i had a look at the certificate revocation list check for authenticode assemblies, and this is what seemed to be the root cause of all my problems. All our servers have no internet connection, and all authenticode signed assemblies are trying to validate
    against the CRL over internet, which leads to long loading delays for all these assemblies (See
    http://support.microsoft.com/kb/936707/en-us).
    I can't prove it, but i suppose that it somehow happens that assemblies sometimes fail to load due to the lack of the internet connection during CRL check.
    After disabling the CRL check for all sharepoint servers (as described in the hotfix), the issues with the AccessViolationException never occured again (environment running fine for more than 6 weeks without any issues).
    I disabled the CRL check for the other environment (where the ribbon issues occured) last weekend, and i hope this will fix it, too.
    As we got a huge amount of servers at different stages, i wrote a powershell script to remotely implement the changes to the machine.config. If someone needs it, i will post it here, too.
    These issues seemed to start with some security patches, but i haven't been able to figure out which one, yet.

  • DIAdem 9.1; Windows2000; right problem; "Configuration-Drive Write Protected" for USER

    Hallo community !
    similar to these threads
    http://forums.ni.com/ni/board/message?board.id=60&message.id=322&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=60&message.id=647&requireLogin=False
    i run into problems working with DIAdem 9.1 on Windows 2000 SP4!
    The Diadem installation went quite well.
    My problem:
    only "Administrator" and "Power User" have the privilige to "WRITE" to the DIAdem install directory.
    Trying to start Diadem as non priviliged USER I get something like:
    DIAdem Configuration-Drive "C:\PROGRAM FILES\ NATIONAL INSTRUMENT\DIADEM 9.10" WRITE PROTECTED!
    I installed & started DIAdem for one
    time with Administrator rights. I activated the Product and exported
    the KEY to a License Server. Everything works fine for Power Users an
    Administrators. Only "simple" USERs are not able to start Diadem due to
    missing WRITE permissions.  i can't grand this permissions to
    normal USERs :-(
    Playing around in Registry -> "RegWriteAccessAllow" ("0","1") (DWORD) (HKEY_LOCAL_MACHINE/Software/National Instruments/Diadem/9.10),
    didn't solved the problem.
    I switched back to "local License" Managment (local Key files) but the Probelm persists.
    thanks in advance
    P.S.
    Quote: "You have to be at least a "Power User" in Windows 2000 to run DIAdem in Windows 2000."
    http://forums.ni.com/ni/board/message?board.id=60&message.id=102&requireLogin=False
    is this right ?
    Message Edited by DirkT on 08-01-2005 03:58 PM
    Message Edited by DirkT on 08-01-2005 04:02 PM

    Hi DirkT,
    Running DIAdem with User rights has different aspects we need to look at.
    1) Registry Write Access
    Launching DIAdem the first time with administrative rights registers some OLE components in the registry. After this step no more Admin rights are necessary for the registry. However running DIAdem as user might result in error messages as DIAdem tries to re-register the components again. You can avoid this by setting the RegWriteAccessAllow Key to 0 (see online help under "Administrator Notes")
    2) File / Folder Write Access to the DIAdem Installation Folder
    DIAdem needs write access to certain files e.g. the error logfile DEM_ERRS.001 or DESKTOP.DDD when saving configurations. You may change the folder where these file are being stored and searched for to a writeable folder by launching DIAdem with the "/d<NewFolder\MyDesktop.ddd>" start parameter or by setting the environment variable "DemDDD" to that folder. Then move the following files from the DIAdem installation folder to your new writeable folder:
    *.ddd
    userpar.par
    dem_errs.*
    3) File / Folder Write Access to other Folders
    There are a number of other folders that DIAdem 9.x needs write access to and which cannot be changed. All of these folders are located by default under "%ProgramFiles%\National Instruments\Shared". Currently you need your Admin to give you write access to that folder and below
    For future versions of DIAdem the team is working to make running under user rights easier.
    Hope that helps,
    Marcus

  • WIN7 x64 Home Basic, 0x80070013 when trying to write or delete files. Disk is write protected.

    Hi,
    My SD card reader is not able to write or delete and format sd cards.
    WIN7 x64 Home Basic, 0x80070013 when I trying to write or delete files. When I trying to format I can see a message that disk is write protected. 
    The card is not locked, it's work in Lenovo Idea Pad s10 without any problem, It's also work in my Pentax camera.
    I'm almost sure that the problem is software, but can't find solution.
    Could Any one help me please?
    Laptop is new, 8 days in use. 

    I have network shutdown 2.0.1 installed and the pcns process normally would be abend in 1 or 2 minute's time. What could be the problem ? Consider to upgrade the network shutdown to 2.2.1 version. Could the problem be resolved in new version ? Any precaution needs to be taken when installing the new version ?
    Terence.

  • How to delete a write protected file from nokia x7...

    There are some files that i need to delete from my nokia x7 phone memory.  ( one mp3 file and a photo). It says that the file is write protected. Pls advice me

    The files MAY be embedded within the Firmware .. Even NCC can't remove them ...
    The cost of Battery may vary according to Region. You may contact Nokia Care or Authorised dealers in your area to know the exact price ...Anyways to get the battery replaced you need to visit Nokia Care ..

  • "The scratch disks are write protected or unavailable" on NEW project on PrE

    I am running PrE 10 on Windows 7 64 bit.  My computer has two internal hard drives (C and E).  I want to put my projects and all scratch disks on E, the non-OS drive.  When I try to create a NEW project and designate a directory I have already created on E, I get the following message from PrE 10:
    "The scratch disks are write protected or unavailable..."
    The program won't let me use E.  However, when I check the drive, it HAS created a .PRV directory in the Preview Files directory and a .prel file in the Encoded Files directory.  So it is actually able to write to drive E.
    What gives?  Thanks.
    Jon

    Thanks, Bill and John.
    I am running from an administrator account, but I wasn't running "as administrator."  I had already changed the permissions to give everybody everything.
    Here is what I discovered.  Running "as administrator" made no difference.  So I ran the program "normally" again.  Then I discovered that although the program was giving me the "The scratch disks are write protected or unavailable..." message, it was actually setting things up properly on my E drive.  When I continued to use the newly created project, the correct directories and files had been set up on my E drive, and I was able to direct my captures to that drive as well.  I haven't done much work on the project yet, but it appears to be working just fine so far.
    I just now created ANOTHER new project on the E drive, and PrE did NOT give me the error message.  Everything got set up properly.  Hmm.  It looks as if that message it put out in error, or, at the very least, unhelpfully!
    By the way, what is Encore, and how would it play a part here?
    Thanks.
    Jon

  • Error message when finalizing...file already open with write protection

    I just created my first movie in i Movie. It's about 9 minutes long. When I tried to finalize it it worked for a couple of hours and then came up with a message "unable to prepare project for publishing because an error occurred (file already open with write protection)". What does this mean? I thought I had closed all the files I was using. There was no error number. I tried it 3 times and got the same message. Any thoughts would be greatly appreciated.

    AppleMan, I just checked that and it looks like Time Machine isn't open. I checked it by going to finder>applications>R click on time machine. It gave me the option to "open" which makes me think it's already closed. Is there somewhere else I need to be looking?
    I made another movie that was just a couple of clips and it finalized fine. On that movie, I had some MTS clips and I converted them to mp4's so iMovie could read them.
    In the one that didn't work I did clip one of the movies before I imported it into iMovie. It saved as a .mov instead of a .mp4. Would that make a difference? I checked all of the files and none of them are listed as locked, so I really don't get the "write protected" aspect of this error.

  • "Attempted to read or write protected memory" error in loading a report.

    Development Environment
    ===
    Windows XP
    Visual Studio 2008 Pro; with Crystal Reports 2008 for Visual Studio
    TagetCPU: 'AnyCPU'
    VB.net 3.5
    Windows dll
    Crystal Reports Runtime SP2 (12.2.0.290)
    Deployment Environment
    ===
    Windows XP
    .net3.5
    Crystal Reports Runtime SP3 (no be confirmed)
    I have created a windows dll with a form with a reportdocument, that loads a report (CrystalDecisions.CrystalReports.Engine.ReportDocument).
    Then we circle through the report setting every table location to point at a specific ODBC and database.
    The Dll can do this process several hundred reports in a day. However a small number (less than 10) of these have the following error:
    "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
    This is normally occurring when the reportDocument.Load function is called. But also happens when going through the setting of table locations: [myTable.ApplyLogOnInfo(TmpTableLogOnInfo)
    The dll is called via COM interop and so i have checked "Register for COM interop".
    Simon@Sanderson

    1) Get to SP 3:
    for dev computer:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    Recompile the app after SP3 is applied.
    for SP3 runtime:
    MSI
    https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
    MSM
    https://smpdl.sap-ag.de/~sapidp/012002523100007123582010E/cr2008sp3_mm.zip
    (You will have to uninstall SP 2 runtime before installing SP 3 runtime)
    2) Do not use "Any CPU". CR2008 is only 32 bit anyhow so use 32 bit.
    3) Make sure you are using .Close and .Dispose once you are done with each report object
    - Ludek

  • Ipod Nano sync error :  Hard disk write protected

    I have a 2nd gen IPod nano 4 GB. I had Itunes 7.1 installed on my PC when I last synced. A week later my disk crashed and in the new disk I installed Itunes 7.2. When I tried to sync, I get a error message which says " disk is write protected. Please remove write protect and sync again "
    Can someone help

    No, you can use a third party program like Yamipod, or XPlay2, etc. But I would advise you to download iTunes anyhow, even if you have to go to another computer and then burn it to a CD or something.
    12" PB, Mac Mini (x2), G3 iMac (x3), G4 iMac, G5 iMac, Centris 610, SE30, Mac+   Mac OS X (10.4.4)   3G iPod, iPod shuffle, iPod nano

  • HP SimpleSave md1000h write protected! - can't initialize drive

    The drive does not show up under windows explorer. Under Disk Management, the drive shows up as Not Initialized and Unallocated. When I try to initialize the drive I get "The media is write protected" Restarted the PC and also the external hard drive and the same thing.
    I am running Windows 7 Professional 32 bit.

    You need to be an admin and also go to Control Panel --> User Accounts and turn off UAC for your account.  You can set the level back later.
    When in Disk Management, did you right mouse click on the new drive and select initialize?
    You might have bad hardware.
    HP DV9700, t9300, Nvidia 8600, 4GB, Crucial C300 128GB SSD
    HP Photosmart Premium C309G, HP Photosmart 6520
    HP Touchpad, HP Chromebook 11
    Custom i7-4770k,Z-87, 8GB, Vertex 3 SSD, Samsung EVO SSD, Corsair HX650,GTX 760
    Custom i7-4790k,Z-97, 16GB, Vertex 3 SSD, Plextor M.2 SSD, Samsung EVO SSD, Corsair HX650, GTX 660TI
    Windows 7/8 UEFI/Legacy mode, MBR/GPT

  • When I try to use the internal hard drive as a scratch disk I get this error "unable to set scratch disk- the selected directory is on write protect or non-writable media.  Any ideas on how to fix this.  It only happens in fcp.

    When I try to use the internal hard drive as a scratch disk I get this error "unable to set scratch disk- the selected directory is on write protect or non-writable media.  Any ideas on how to fix this.  It only happens in fcp.

    By internal, I assume you're referring to your systems (boot) drive. Is it, by chance, a partitioned dive?
    Also…although many people successfully use their systems drives as scratch disks, over time you'll have better results using a dedicated drive for your media.
    Good luck.
    Russ

Maybe you are looking for