Skip to main content
1-Visitor
March 17, 2017
Solved

Is it possible to create/add a dynamic organization(Programatically) in Thingworx

  • March 17, 2017
  • 2 replies
  • 1701 views

I have to create/add Organization programatically. Is that possible to add so.

Best answer by posipova

HI, the following service would create an Organizatio with a Parent and a child unit:

var par = {

   

                topOUName: Parent /* STRING */,

                name: Parent /* STRING */,

};

// no return

Resources["EntityServices"].CreateOrganization(par);

   

    var params = {

  name: Child /* STRING */,

  parentName: Parent/* STRING */

};

// no return

Organizations[Parent].AddOrganizationalUnit(params);

2 replies

1-Visitor
March 17, 2017

Yup

Resources["EntityServices"].CreateOrganization

posipova20-TurquoiseAnswer
20-Turquoise
March 17, 2017

HI, the following service would create an Organizatio with a Parent and a child unit:

var par = {

   

                topOUName: Parent /* STRING */,

                name: Parent /* STRING */,

};

// no return

Resources["EntityServices"].CreateOrganization(par);

   

    var params = {

  name: Child /* STRING */,

  parentName: Parent/* STRING */

};

// no return

Organizations[Parent].AddOrganizationalUnit(params);

jk-31-VisitorAuthor
1-Visitor
March 17, 2017

Thanks