This topic contains 9 replies, has 4 voices, and was last updated by Bhavesh Tailor 7 years, 2 months ago.
- Topic
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:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105definitions: # List of definitionsinstore_customer_creation: # name of process definitionlabel: 'Create Account and Contact for In-Store Customer'enabled: trueentity: Acme\Bundle\PhysicalStoreBundle\Entity\OroPhysicalStoreAccountsorder: 10exclude_definitions: [instore_customer_creation]actions_configuration:- @tree: # set Contactconditions: # if Contact not exists@empty: $source.contactactions:- @create_entity: # create Contactclass: OroCRM\Bundle\ContactBundle\Entity\Contactattribute: $contactdata:birthday: ''email: $emailfirstName: $contactgender: ''lastName: 'N/A'middleName: ''namePrefix: ''nameSuffix: ''owner: $ownerorganization: $organization- @tree: # add Contact Emailconditions:@not_empty: $emailactions:- @create_entity: # create Contact Emailclass: OroCRM\Bundle\ContactBundle\Entity\ContactEmailattribute: $emaildata:email: $emailprimary: true- @call_method: # add Contact Email to Contactobject: $contactmethod: addEmailmethod_parameters: [$email]- @unset_value: [$email]- @create_entity: # create Contact Addressclass: OroCRM\Bundle\ContactBundle\Entity\ContactAddressattribute: $contactAddressdata:street: $address1street2: $address2city: $citypostalCode: $zipcountry: $countryorganization: $organizationfirstName: $contactlastName: 'N/A'- @call_method: # add Contact Address to Contactobject: $contactmethod: addAddressmethod_parameters: [$address1]- @tree: # add Contact Phoneconditions:@not_empty: $phoneactions:- @create_entity: # create Contact phoneclass: OroCRM\Bundle\ContactBundle\Entity\ContactPhoneattribute: $phonedata:phone: $phoneprimary: $phone- @call_method: # add Contact Phone to Contactobject: $contactmethod: addPhonemethod_parameters: [$phone2]- @automatic_discovery:conditions: # if Account not exists@empty: $accountparameters:entity: $.dataattribute: $.matchedEntity- @assign_value: # check matched entity and its accountconditions:@not_empty: $.matchedEntity@not_empty: $.matchedEntity.accountparameters: [$account, $.matchedEntity.account]- @tree: # set Accountconditions: # if Account not exists@empty: $accountactions:- @assign_value: # check and generate N/A Account nameconditions:@and:- @empty: $contactparameters: [$contact, 'N/A']- @create_entity: # create Accountclass: OroCRM\Bundle\AccountBundle\Entity\Accountattribute: $accountdata:defaultContact: $contactname: $contactowner: $ownerorganization: $organizationtriggers:instore_customer_creation:-event: createpriority: 5queued: true123Process job 987806 failed: Neither the property "firstName" nor one of the methods "getFirstName()", "firstName()", "isFirstName()", "hasFirstName()", "__get()" exist and have public access in class "Acme\Bundle\PhysicalStoreBundle\Entity\OroPhysicalStoreAccounts".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
The forum ‘OroCRM’ is closed to new topics and replies.