Lock "classification" property in a document

Hi, I have "Document" ItemType with a class structure. When I create a Document through the form, I want that it is possibile to choose the classification property only before first saving. If the user saves the Document, it should be not possible to change classification. How can I get this? Thanks Pierluigi
Parents
  • Hi Yoann, thanks for you reply. I followed your procedure, but I have some problem. I created two methods related to Server Event of Document Itemtype. But when I save (update) the Document Form, I can't get any error message and the form is updated. It seems that two strings  (savedClassification and curClassification) are the identical and both updated to the current classification. What is wrong? I pasted two methods: OnBeforeUpdate:
    RequestState.Add("classification", this.getProperty("classification")); return this;
      OnAfterUpdate:
    string savedClassification = (string)RequestState["classification"]; string curClassification = this.getProperty("classification"); if (savedClassification != curClassification) { return this.getInnovator().newError("Classification is changed!"); } RequestState.Remove("classification"); RequestState.Clear(); return this;
    Thanks Pierluigi  
Reply
  • Hi Yoann, thanks for you reply. I followed your procedure, but I have some problem. I created two methods related to Server Event of Document Itemtype. But when I save (update) the Document Form, I can't get any error message and the form is updated. It seems that two strings  (savedClassification and curClassification) are the identical and both updated to the current classification. What is wrong? I pasted two methods: OnBeforeUpdate:
    RequestState.Add("classification", this.getProperty("classification")); return this;
      OnAfterUpdate:
    string savedClassification = (string)RequestState["classification"]; string curClassification = this.getProperty("classification"); if (savedClassification != curClassification) { return this.getInnovator().newError("Classification is changed!"); } RequestState.Remove("classification"); RequestState.Clear(); return this;
    Thanks Pierluigi  
Children
No Data