title: Alfresco JavaScript - How to get list of allowed values of a node property?
body: <p>I'm doing something like this:</p>
  
  <pre><code>document.properties["my:customProperty"] = getSomehowTheProperty(document);
  </code></pre>
  
  <p><code>my:customProperty</code> is a string, which has some allowed values in the content model.</p>
  
  <p>How can I get the allowed values from the content model, so that I don't have to store them in a JavaScript array inside the script?</p>
  
  <p>Or how else can I check, that the function <code>getSomehowTheProperty</code> returned an allowed value?</p>
  
  <p>I tried to wrap it with try-catch:</p>
  
  <pre><code>    try {
        document.properties["my:customProperty"] = getSomehowTheProperty(document);
        document.save();
      } catch (e) {
        document.properties["my:customProperty"] = "Default Value";
        document.save();
      }
  </code></pre>
  
  <p>But it looks like integrity is checked and th error is thrown at the end of executing the script, not inside the try block.</p>
  
  <p>Googling "alfresco js allowed values of node properties" and similar queries gives me nothing.</p>