cancel
Showing results for 
Search instead for 
Did you mean: 

reading form structure

hkır
Champ in-the-making
Champ in-the-making
Hi,
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">
      <forms>
         <form id="custom-metadata-form">
            <field-visibility>
               <show id="cm:name" />
               <show id="cm:title" force="true" />
                                        …

Thanks in advance for your help.
1 REPLY 1

hkır
Champ in-the-making
Champ in-the-making
I found the problem, my form configuration is problematic. I don't know why but when I changed evaluator="node-type" to evaluator="model-type", it worked as expected.