cancel
Showing results for 
Search instead for 
Did you mean: 

Classification creation fails with: Missing classification

sufo
Star Contributor
Star Contributor
I'm trying to create my own classification via the WebScript but it fails with the error message: Missing classification: {travel.agency.model}taclassifiable
I have defined my own model (<namespace uri="travel.agency.model" prefix="ta"/>) in which there is this aspect defined:
      <aspect name="ta:taclassifiable">         <title>Travel Agency Classifiable</title>         <parent>cm:classifiable</parent>         <properties>            <property name="ta:categories">               <title>Categories</title>               <type>d:category</type>               <mandatory>false</mandatory>               <multiple>true</multiple>               <index enabled="true">                  <atomic>true</atomic>                  <stored>true</stored>                  <tokenised>false</tokenised>               </index>            </property>                  </properties>      </aspect>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
When I try to execute this code, it generates above mentioned error:
var categoryRoot = roothome.childByNamePath("categories");var props = [];props["view:childName"] = "{travel.agency.model}taclassifiable";var classification = categoryRoot.createNode("taclassifiable", "cm:category", props, "cm:categories");‍‍‍‍‍
Am I missing something?
1 REPLY 1

sufo
Star Contributor
Star Contributor
Found the solution, I replaced last line of the code and removed 'view:childName' property:
var categoryRoot = roothome.childByNamePath("categories");var props = [];var classification = categoryRoot.createNode("{travel.agency.model}taclassifiable", "cm:category", props, "cm:categories", "{travel.agency.model}taclassifiable");‍‍‍
This line also works:
var classification = categoryRoot.createNode("taclassifiable", "cm:category", props, "cm:categories", "ta:taclassifiable");‍