AnsweredAssumed Answered

reading form structure

Question asked by hkır on Mar 16, 2011
Latest reply on Mar 17, 2011 by hkır
I want to edit metadata of documents from an external application, hence I need to read form structure from share-config-custom.xml. But I can't even get the form configuration. I tried

   var formsConfig = config.scoped["cm:content"]["forms"];
   var form = formsConfig.defaultForm;
  //or var form = formsConfig.getForm("custom-metadata-form");
   var visibleFields = form.visibleViewFieldNames;

but I get "Cannot read property \"visibleViewFieldNames\" from null".

my config file is regular:

   <config evaluator="node-type" condition="cm:content" replace="true">
         <form id="custom-metadata-form">
               <show id="cm:name" />
               <show id="cm:title" force="true" />

Thanks in advance for your help.