Create Document program hangs

I create another document upon creating a document with the below code. I wrote this piece of code for onAfterAdd server event under "Document" type. I could not create any document and the UI hangs. Please suggest how to create a new document while creating a document manually and attach to it.
Innovator myInnovator = this.getInnovator(); Item doc = myInnovator.newItem("Document","add"); doc.setProperty("item_number","Hello Document"); doc.setProperty("classification","Design Document"); doc = doc.apply(); CO.Utilities.WriteDebug("testcreate", "document created"); return this;
Parents
  • Hi,   Use Case 1:
    1. we have no custom document type
    2. create a document
    3. onAfterAdd method we would like to create another document
    4.  link document created in step 2 and step 3
    Use Case 2:
    1. we have custom document types like Design Document & Supplier Document
    2. while we create a Supplier Document there is an event method onAfterAdd
    3. in the onAfterAdd method we would like to create a Design Document
    4. link the document created in step 3 to the document created in Step 2
    I think I explained the requirement. Also would like to know if we can write a scheduler in Aras to run at 1 hour interval to load documents from a remote server.
Reply
  • Hi,   Use Case 1:
    1. we have no custom document type
    2. create a document
    3. onAfterAdd method we would like to create another document
    4.  link document created in step 2 and step 3
    Use Case 2:
    1. we have custom document types like Design Document & Supplier Document
    2. while we create a Supplier Document there is an event method onAfterAdd
    3. in the onAfterAdd method we would like to create a Design Document
    4. link the document created in step 3 to the document created in Step 2
    I think I explained the requirement. Also would like to know if we can write a scheduler in Aras to run at 1 hour interval to load documents from a remote server.
Children
No Data