ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 2 replies, has 2 voices, and was last updated by  manuel.distefano 1 year, 4 months ago.

  • Creator
    Topic
  • #20788

    manuel.distefano
    Participant

    Hello everyone,

    i’m using oro platform and i add a custom Entity (Alumnus) to my project. It’s a “complex” entity, infact it have a relationship (many-to-one) with others custom entities (e.g. Expertise).

    I’m able to create an Alumnus via web, now i’m try to create it via API. I add a REST API (GET – POST – PUT), and i’m able to create an Alumnus. But when i add an array of “Expertises” to my json i get an error.

    I send my request with another php application. My data is in array and i use json_encode before sent it.

    Some code (as us can see i’m using “oro_collection” to add Expertise to Alumnus):

    My Form Type:

    My Entity (Doctrine configuration it’s by yml):

    My json:

    Can someone help me or get me some documentation?

    Tnx

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #20821

    Yurii Muratov
    Oro Core

    Hi, @manuel-distefano.

    I think that you sent incorrect data for expertises field.

    You should send an array with id’s for this field.

    Please test request with data like:

    Where 1 is id for some record form Expertise

    #21080

    manuel.distefano
    Participant

    Hello Yurii,

    yes that was one problem. In any case i solved it by change oro_collection to collection.

    Need oro_collection type a particular structure in json? I’m just curious at the moment :)

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.