This topic contains 2 replies, has 2 voices, and was last updated by Rick 7 years ago.
- Topic
Hi there,
we created a workflow for our lead process and try to force adding at least one phone number on a transition. We’d like to use the same form for this attribute as it is on editing the lead directly – setting the number and primary choice. But we came out with a form without the primary choice and on submit the widget crashes with a render error.
attributes.yml
123456workflows:default_flow_lead:attributes:lead_phones:type: entityoptions:class: Oro\Bundle\SalesBundle\Entity\LeadPhonetransitions.yml
123456789101112131415161718workflows:default_flow_lead:transitions:aggregate:step_to: aggregatedis_start: falseis_unavailable_hidden: truefrontend_options:icon: 'fa-check-circle'form_options:attribute_fields:lead_phones:form_type: oro_phone_collectionoptions:required: trueattribute_default_values:lead_phones: $lead.phonestransition_definition: aggregate_definitiontransition_definitions.yml
12345678910111213141516171819202122232425262728293031323334...aggregate_definition:preconditions: # if lead.status = "new"'@equal': [$lead.status.id, 'new']conditions:'@and':parameters:- '@not_empty': $lead_phonespost_actions: # set lead.status = "aggregated"- '@request_enum_entity':enum_code: lead_statusidentifier: 'aggregated'attribute: $lead.status- '@tree': # store Lead Emailconditions: # if Lead Email given'@not_empty': $lead_emailsactions:- '@foreach':array: $lead_emailsvalue: $.result.leadEmailactions:- '@create_entity': # create Emailclass: Oro\Bundle\SalesBundle\Entity\LeadEmailattribute: $.result.emaildata:email: $.result.leadEmail.emailowner: $lead.ownerprimary: $.result.leadEmail.primary- '@call_method': # add Email to Leadobject: $leadmethod: addEmailmethod_parameters: [$.result.email]- '@unset_value': # unset temporary property[$.result.email]Can you give us a hint what’s going wrong on form rendering and best practice on adding a phone without duplicating a previously specified one?
Best regards
Rick
The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.