I am trying to convert a lead to an account using workflow. I have also added an Account field in Lead entity to keep a relation between the two. One account can have many leads. The requirement is something like that. I am reusing the Lead entity instead of creating another entity for my requirement.
I have changed the Lead Status to have more options that just the New, Qualified and Cancelled. So lets consider that I have the following lead status options: New, BDC Follow up, Sales Won and Lost.
When the Sales is won I have to create an account based on the values in Lead and associate the newly created account with the Lead. For this I have written the following workflow. I am just pasting the transitions and transition_definitions YAML files here.
transition.yml:YAML123456789101112131415161718192021222324252627282930313233343536373839404142workflows:lead_conversion:transitions:bdcfollowup:label: 'BDC Follow up'step_to: bdc_follow_upis_start: trueis_unavailable_hidden: trueacl_resource:frontend_options:icon: 'icon-ok'class: 'btn-primary'transition_definition: bdc_definitionsaleswon:label: 'Sales Won'step_to: sales_wonis_start: falseis_unavailable_hidden: trueacl_resource:frontend_options:icon: 'icon-ok'class: 'btn-success'transition_definition: won_definitionsaleslost:label: 'Sales Lost'step_to: lostis_start: falseis_unavailable_hidden: trueacl_resource:frontend_options:icon: 'icon-remove'class: 'btn-danger'transition_definition: lost_definitionreactivate:label: 'Reactivate'step_to: newis_start: falseis_unavailable_hidden: truefrontend_options:icon: 'icon-repeat'class: 'btn-info'transition_definition: reactivate_definition
And transition_definition.yml I am only pasting the sales_won definition as other transitions are working fine:YAML123456789101112131415161718192021222324252627282930won_definition:pre_conditions: # if lead.status = "bdc_follow_up"'@and':- '@equal': [$lead.status.name, 'bdc_follow_up']post_actions:- '@find_entity':class: OroCRM\Bundle\SalesBundle\Entity\LeadStatusidentifier: 'sales_won'attribute: $lead.status- '@tree': # create Account entityactions:- '@create_entity': # create Account based on Leadclass: OroCRM\Bundle\AccountBundle\Entity\Accountattribute: $.result.accountdata:firstName: $lead.firstNamelastName: $lead.lastNamejobTitle: $lead.jobTitledescription: $lead.nameaddress: $lead.address.streetcity: $lead.address.citystate: $lead.address.regionzip: $lead.address.postalCode- '@call_method': # connect Account with Leadconditions:'@empty': $lead.accountparameters:object: $leadmethod: setAccountmethod_parameters: [$.result.account]
I am getting “Could not perform transition” message after clicking on the Sales Won workflow button on the Lead View Screen. I checked in the logs and I only found a “doctrine: rollback” message. There is no error nor any exception in the logs.
What am I doing wrong? I have written my workflow based on the Unqualified Sales Lead workflow given in the OroCRM Sales Module. All other workflows belonging to Lead entity have been deactivated.
Can anybody please tell me where am I going wrong?
Thanks and Regards,
You must be logged in to reply to this topic.