Forums OroCRM process.yml – Create Account/Contact for every new entry of a Custom Entity

This topic contains 9 replies, has 4 voices, and was last updated by  Bhavesh Tailor 1 year ago.

  • Creator
  • #27139


    Hi Oro friends,

    I’m trying to modify MagentoBundle (process.yml) to create a new account/contact for every entry of my custom entity. (ERP Users).

    Here is the actual code:

    Indeed, I don’t have the field FirstName inside my custom entity, so why is it complaining? If I understood well, in order to create a contact I should just assign the value “$contact” to Contact\FirstName.

    Can someone please help me to understand it?
    Thank you

Viewing 9 replies - 1 through 9 (of 9 total)
  • Author
  • #27140

    Yevhen Shyshkin

    Hello, Rodolfo.

    I don’t see any issues in your definition that may cause this issue. Possible reasons:

    1) this issue caused not by this process definition, but by another one; please, check the list of processes related to this entity in DB – if you renamed definition then DB might have old outdated definition

    2) definition stored DB is outdated, i.e. you updated file but didn’t uploaded it to DB – you just need to run oro:process:configuration:load command

    If it’s none of these reasons then you can run this process job again from CLI (failed processes don’t removed from DB) and check stacktrace for this exception – it might gave you a clue.

    Please, post results of your investigation in this topic.



    Hi Yevhen! ( @yshyshkin )

    Thanks for your suggestion to debug that Exception. I was able to find some problems.

    I was getting a conflict with the attribute’s name for @create_entity. The same ‘$contact’ name has being used for a field name in my custom entity. So I changed to some different attribute name and the error is gone.

    So, I reduced the process.yml as you can see bellow and now I don’t have error, but the account/contact are not being created.

    Can you please verify if you can see something wrong here?

    In my logs I don’t have errors.

    [2015-11-02 11:22:18] app.DEBUG: Process executed {“definition”:”instore_customer_creation”,”event”:”create”,”entityId”:30895} []

    php app/console oro:process:execute:job –id=987835
    Process job 987835 successfully finished



    Found other problems. Missing many-to-one fields in my custom table. I’m creating some migration files to rename columns and create new fields in order to fix it. I’ll post here the results.




    Hi there, indeed the problem was the missing many-to-one relation with my custom entity and accounts/contacts. All good, but now I have other question:

    If the Account or Contact exists, I want to just assign the account_id to the entity that triggered this process. Do I need to create a custom action for this?

    I’m trying to follow this idea:

    Thank you



    Hi guys.. Anyone with a better idea? I’m creating a custom action and trying to replicate the same idea from @create_entity but only updating it.


    Dmitry Khrysev


    Hi @dkhrysev

    Thanks for your reply.

    Where is the assignment of an existing entity located? Is it here?

    - @call_method: # connect customer with Contact
    @empty: $
    object: $new_b2bcustomer
    method: setContact
    method_parameters: [$]


    Dmitry Khrysev

    There are two possible ways of assignment:
    – specify target field in attribute parameter
    – assign to temporary attribute that is not an entity property and then assign with @call_method action. This way may be used, for example, when you are adding new items to collection


    Bhavesh Tailor

    Hi ,

    I am trying to create contact from embedded web form . When receiving a form submission, the system should search by email for an existing contact record.
    1 : If a contact record is found, a Case should be created and assigned to the existing contact record.
    2: If no contact record is found, a Contact Request record should be created.
    3: From view Contact Request screen: /contact-us/view/1 we add a button for “Create Contact”. Clicking this button will create a contact record and delete the contact request record.


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

You must be logged in to reply to this topic.