Creating an entry in stream?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tzn1
    Junior Member
    • Dec 2018
    • 11

    Creating an entry in stream?

    Do you have an example how we can create an entry (with links etc) in the stream from JS and PHP?
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello,
    in the stream you can create post only (Note). If you need to create other entity, you can do it with Quick Create button (+ on the top of the page)
    What is the use case of creating another records, except Notes, in Stream? Maybe better to use other panels for this?

    Comment

    • item
      Active Community Member
      • Mar 2017
      • 1476

      #3
      Hi I have a sample exemple but I have not understand all field : if @tanya can explain what is these field :
      data {} = sample ?
      type = Post , ? other type ?
      target_type = ?
      isGobal = ? for ?
      isInternal = ? for users only ?

      $entityManager = $this->getEntityManager();
      $note = $entityManager->getEntity('Note');
      $note->set(array(
      'deleted' => 0,
      'post' => $fileName ." @" .$coUserName,
      'data' => '{}',
      'type' => 'Post',
      'target_type' => null,
      'isGlobal' => 0,
      'isInternal' => 0,
      'parentId' => $contactId ,
      'parentType' => 'Contact',
      'relatedId' => null,
      'relatedType' => null,
      'createdById' => null,
      'superParentId' => null,
      'superParentType' => null,
      ));
      $noteId = $entityManager->saveEntity($note);
      If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

      Comment

      • tzn1
        Junior Member
        • Dec 2018
        • 11

        #4
        Originally posted by tanya
        Hello,
        in the stream you can create post only (Note). If you need to create other entity, you can do it with Quick Create button (+ on the top of the page)
        What is the use case of creating another records, except Notes, in Stream? Maybe better to use other panels for this?
        A note is fine if I can add a link to a Contact there or Lead etc. So how to do that from JS or PHP?

        Comment

        Working...