Creating Entities as an account.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thodr4
    Junior Member
    • Nov 2019
    • 3

    Creating Entities as an account.

    Hi,

    I am writing a custom frontend for our customer support Case system. I am able to create Cases, linked to the right Account. But i would like to add a note as if it was created by the Account associated with the Case. Right now, if i add any notes via the API, they are always created by the API user:


    Code:
            // This creates a note, but the creator is the API user, not the account...
            $newnote = $this->espo_request("POST", "Note", [
                "post" => $message,
                "attachmentsIds" => [],
                "type" => "Post",
                "isInternal" => false,
                "parentId" => $newcase["id"],
                "parentType" => "Case",
                "createdById" => $foundsystem["id"] // this does not work.
            ]);
    In the above code example, setting createdById does not work. I am trying to avoid using different api keys for every Account, as this adds a lot of complexity.

    Any way to achieve this. I couldn't find a solution in the API docs.

    Thanks,
    Tho
  • yuri
    Member
    • Mar 2014
    • 8444

    #2
    createdBy field is not available for writing. It's set automatically.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...