OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions How to create LEAD with Custom Entities via API ?

This topic contains 8 replies, has 3 voices, and was last updated by  Alexandr Romanov 9 years, 7 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #28139

    Alexandr Romanov
    Participant

    Hi,
    I try to create new lead with api.
    When I post this

    everything works fine.

    In Entities/Lead I’ve field ‘provided_services’, type:text.
    When I post this

    I’ve got

    Can some one help me with a working example ?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #28140

    Alexandr Smaga
    Participant

    Hello!

    Extended fields should be placed in additional sub-array.
    Example

    #28141

    Alexandr Romanov
    Participant

    Thanks, that works fine.
    Second question:
    when I also have another entity with type ‘optionSet’, how can I add it during the creation request?

    I’ve tried to enter the same text, as in option, but got

    #28142

    Dima Soroka
    Keymaster

    Did you use existing option or expect to have new option created?

    #28143

    Alexandr Romanov
    Participant

    I’ve made entity in Lead.
    With type ‘Option set’ and set 5 ‘options’ like this ‘1 – 10′,’11 – 20’, etc.

    #28144

    Alexandr Smaga
    Participant

    Hello!

    We are working on new improved implementation of option sets. Hopefully it will be available in the nearest release.

    For now you can create entity with options set, but there are some limitations.
    First you need id of option to pass through API, but we don’t have API method for this, and 2nd is that option sets are not included in get/getList responses.

    #28145

    Alexandr Romanov
    Participant

    Thanks, I’ve also tried to find ID through API, and saw nothing in get responses.

    So how can I get option ID ?
    Somewhere in web page, or mysql DB ?

    #28146

    Alexandr Smaga
    Participant

    You can take them from select element on “edit lead form” or from database table oro_entity_config_optionset

    #28147

    Alexandr Romanov
    Participant

    So which ID exactly I have to use as OPTION_ID ?

    “test4″,”firstName”: “test4_fn”,”lastName”: “test4_ln”,”email”:”test4@example.com”,”phoneNumber”:”18009001212″, additional:{“YOU_FIELD_NAME” : OPTION_ID}}})

    I’ve tried 2, “2”, [ 2 ], [ “2” ], “784_2” – error. Every time I’ve got

    Please help me with it.
    Thanks.

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

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

Back to top