Forums › Forums › OroPlatform › OroPlatform – How do I? Questions › How to create a sales process automatically when a new Lead is added?
This topic contains 19 replies, has 4 voices, and was last updated by achyuthb 7 years, 10 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- May 21, 2015 at 1:24 pm #35981
How to create a sales process automatically when a new Lead is added?
If I understood well, I can’t do that just cloning and changing the workflow process right?
I have two ideas:
—
1) Create a Process to do that;
2) Use the API to create a Sales Process based on a Lead. I can detect when this event happens because I’m saving these Leads with my integration api;Do you guys have other idea?
Thank you - CreatorTopic
- AuthorReplies
- May 22, 2015 at 5:34 am #35982
Hello, Rodolfo.
If you need to create Sales Process in one specific case (e.g. during some workflow transition), then you have to add new entity creation in this one specific place (e.g. @create_entity action in workflow definition).
If you need to create new Sales Process FOR ALL Leads no matter when and where they are creating, then you can create process that will listen to “create” event and create new entity there (you can even start workflow on a new entity).
May 22, 2015 at 6:36 am #35983Thank you @yshyshkin
I’ll try to implement the process.
May 23, 2015 at 9:21 am #35984pllllllz Yevhen Shyshkin
schema update Failed
Error
Dropping database schema…
Database schema dropped successfully!Command “doctrine:schema:drop” executed in 89 second(s), memory usage: 18.34Mb
[2015-05-23 17:08:52] Launching “oro:entity-config:cache:clear” command
Clear the entity config cacheCommand “oro:entity-config:cache:clear” executed in 1 second(s), memory usage: 4.46Mb
[2015-05-23 17:08:56] Launching “oro:entity-extend:cache:clear” command
Clear the extended entity cacheCommand “oro:entity-extend:cache:clear” executed in 1 second(s), memory usage: 5.18Mb
[2015-05-23 17:09:15] Launching “oro:migration:load” command
Process migrations…
> Oro\Bundle\MigrationBundle\Migration\CreateMigrationTableMigration
> Oro\Bundle\OrganizationBundle\Migrations\Schema\OroOrganizationBundleInstaller
> Oro\Bundle\SecurityBundle\Migrations\Schema\v1_0\OroSecurityBundle
> Oro\Bundle\AttachmentBundle\Migrations\Schema\OroAttachmentBundleInstaller
> Oro\Bundle\EmailBundle\Migrations\Schema\OroEmailBundleInstaller
> Oro\Bundle\UserBundle\Migrations\Schema\OroUserBundleInstaller
> Oro\Bundle\SSOBundle\Migrations\Schema\OroUserBundleInstaller
> Oro\Bundle\EntityConfigBundle\Migrations\Schema\OroEntityConfigBundleInstaller
> Oro\Bundle\EntityConfigBundle\Migrations\Schema\v1_3\OroEntityConfigBundle
> Oro\Bundle\EntityConfigBundle\Migrations\Schema\v1_4\FixOptionSetObjects
> Oro\Bundle\EntityConfigBundle\Migrations\Schema\v1_5\DropFieldConfig
> Oro\Bundle\EntityExtendBundle\Migrations\Schema\OroEntityExtendBundleInstaller
> Oro\Bundle\IntegrationBundle\Migrations\Schema\OroIntegrationBundleInstaller
> Oro\Bundle\ActivityBundle\Migrations\Schema\OroActivityBundleInstaller
> Oro\Bundle\ActivityListBundle\Migrations\Schema\OroActivityListBundleInstaller
> Oro\Bundle\AddressBundle\Migrations\Schema\OroAddressBundleInstaller
> Oro\Bundle\BatchBundle\Migrations\Schema\OroBatchBundleInstaller
> Oro\Bundle\CalendarBundle\Migrations\Schema\OroCalendarBundleInstaller
> Oro\Bundle\CalendarBundle\Migrations\Schema\v1_9\OroCalendarBundle
> Oro\Bundle\ConfigBundle\Migrations\Schema\OroConfigBundleInstaller
> Oro\Bundle\CronBundle\Migrations\Schema\v1_0\OroCronBundle
> Oro\Bundle\CronBundle\Migrations\Schema\v1_0\JmsJob
> Oro\Bundle\CronBundle\Migrations\Schema\v1_1\JmsJob
> Oro\Bundle\DataAuditBundle\Migrations\Schema\v1_0\OroDataAuditBundle
> Oro\Bundle\DataAuditBundle\Migrations\Schema\v1_1\OroDataAuditBundle
> Oro\Bundle\DataAuditBundle\Migrations\Schema\v1_2\OroDataAuditBundle
> Oro\Bundle\DataGridBundle\Migrations\Schema\OroDataGridBundleInstaller
> Oro\Bundle\EmbeddedFormBundle\Migrations\Schema\OroEmbeddedFormBundleInstaller
> Oro\Bundle\ImapBundle\Migrations\Schema\v1_0\OroImapBundle
> Oro\Bundle\ImapBundle\Migrations\Schema\v1_1\OroImapBundle
> Oro\Bundle\ImapBundle\Migrations\Schema\v1_2\OroImapBundle
> Oro\Bundle\InstallerBundle\Migrations\Schema\OroInstallerBundle
> Oro\Bundle\MigrationBundle\Migrations\Schema\v1_0\OroMigrationBundle
> Oro\Bundle\MigrationBundle\Migrations\Schema\v1_1\OroMigrationBundle
> Oro\Bundle\NoteBundle\Migrations\Schema\v1_0\OroNoteBundle
> Oro\Bundle\NoteBundle\Migrations\Schema\v1_1\OroNoteBundle
> Oro\Bundle\NotificationBundle\Migrations\Schema\OroNotificationBundleInstaller
> Oro\Bundle\ReportBundle\Migrations\Schema\OroReportBundleInstaller
> Oro\Bundle\SearchBundle\Migrations\Schema\OroSearchBundleInstaller
> Oro\Bundle\SegmentBundle\Migrations\Schema\OroSegmentBundleInstaller
> Oro\Bundle\SidebarBundle\Migrations\Schema\v1_0\OroSidebarBundle
> Oro\Bundle\SidebarBundle\Migrations\Schema\v1_1\OroSidebarBundle
> Oro\Bundle\TagBundle\Migrations\Schema\OroTagBundleInstaller
> Oro\Bundle\TranslationBundle\Migrations\Schema\OroTranslationBundleInstaller
> Oro\Bundle\WindowsBundle\Migrations\Schema\v1_0\OroWindowsBundle
> Oro\Bundle\WorkflowBundle\Migrations\Schema\OroWorkflowBundleInstaller
> Oro\Bundle\CommentBundle\Migrations\Schema\v1_0\OroCommentBundle
> Oro\Bundle\DashboardBundle\Migrations\Schema\OroDashboardBundleInstaller
> Oro\Bundle\NavigationBundle\Migrations\Schema\v1_0\OroNavigationBundle
> Oro\Bundle\NavigationBundle\Migrations\Schema\v1_1\OroNavigationBundle
> Oro\Bundle\NavigationBundle\Migrations\Schema\v1_2\OroNavigationBundle
> Oro\Bundle\NavigationBundle\Migrations\Schema\v1_3\OroNavigationBundle
> OroCRM\Bundle\ContactBundle\Migrations\Schema\OroCRMContactBundleInstaller
> OroCRM\Bundle\AccountBundle\Migrations\Schema\OroCRMAccountBundleInstaller
> OroCRM\Bundle\MarketingListBundle\Migrations\Schema\OroCRMMarketingListBundleInstaller
> OroCRM\Bundle\MarketingListBundle\Migrations\Schema\v1_2\OroCRMMarketingListBundle
> Oro\Bundle\TrackingBundle\Migrations\Schema\OroTrackingBundleInstaller
> Oro\Bundle\ReminderBundle\Migrations\Schema\OroReminderBundleBundleInstaller
> OroCRM\Bundle\CallBundle\Migrations\Schema\OroCRMCallBundleInstaller
> OroCRM\Bundle\CampaignBundle\Migrations\Schema\OroCRMCampaignBundleInstaller
> OroCRM\Bundle\ChannelBundle\Migrations\Schema\OroCRMChannelBundleInstaller
> OroCRM\Bundle\ChannelBundle\Migrations\Schema\v1_4\OroCRMChannelBundle
> OroCRM\Bundle\TaskBundle\Migrations\Schema\OroCRMTaskBundleInstaller
> OroCRM\Bundle\AnalyticsBundle\Migrations\Schema\v1_0\OroCRMAnalyticsBundle
> OroCRM\Bundle\SalesBundle\Migrations\Schema\OroCRMSalesBundleInstaller[2015-05-23 17:19:38] Launching “oro:workflow:definitions:load” command
Loading workflow definitions…[Oro\Bundle\WorkflowBundle\Exception\AssemblerException]
Option “label” is requiredoro:workflow:definitions:load [–directories[=”…”]] [–workflows[=”…”]] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-s|–shell] [–process-isolation] [-e|–env=”…”] [–no-debug] [–current-user=”…”] [–current-organization=”…”] [–disabled-listeners=”…”] command
Command “oro:workflow:definitions:load” executed in 21 second(s), memory usage: 7.94Mb
May 24, 2015 at 1:11 am #35985Hello, fati.
Please, check, whether all attributes without property paths, steps and transitions have labels.
May 24, 2015 at 2:59 am #35986hello
thanks but i do not understandingplatform/src/oro/bundle/workflowbundle/resource/config/workflow ?
imports:
– { resource: ‘oro/workflow/b2b_flow_lead.yml’ }
– { resource: ‘oro/workflow/b2b_flow_sales.yml’ }
– { resource: ‘oro/workflow/b2b_flow_sales_funnel.yml’ }May 24, 2015 at 8:58 am #35987This code includes and merges data from specified files.
May 25, 2015 at 9:31 am #35988Hi @igor-chornobay and @yshyshkin,
I’m following this post: http://oroinc.com/orocrm/forums/topic/processes-entities#post-6877
It worked for me too but if I click on ‘Sales Process Item’ I can’t see the “Qualify” and “Disqualify” button. I only see “Create from Leads” and “Create from Opportunity”.
The entity created on Sales Funnel doesn’t have:
– ‘workflow_item_id’;
– ‘workflow_step_id’;
– ‘data_channel_id’;So, I’m wondering if I create the Workflow in the same process is it solve the problem? Can you please help me changing this process.yml to create this workflow?
Thank you.
process.yml
1234567891011121314151617181920212223242526definitions:lead_creation:label: 'Create Sales Process for Lead'enabled: trueentity: OroCRM\Bundle\SalesBundle\Entity\Leadorder: 10actions_configuration:- @create_entity:class: OroCRM\Bundle\SalesBundle\Entity\SalesFunnelattribute: $.salesFunneldata:startDate: $createdAtowner: $ownerlead: $.dataopportunity: $opportunityorganization: $organizationworkflowItem: $workflowItemworkflowStep: $workflowSteptriggers:lead_creation:-event: createpriority: 5queued: trueMay 25, 2015 at 1:29 pm #35989How about this one?
1234567891011121314151617181920212223242526272829303132333435definitions:lead_creation:label: 'Create Sales Process for Lead'enabled: trueentity: OroCRM\Bundle\SalesBundle\Entity\Leadorder: 10actions_configuration:- @create_entity:class: Oro\Bundle\WorkflowBundle\Entity\WorkflowItemattribute: $.workflowparameters:class: Oro\Bundle\WorkflowBundle\Entity\WorkflowStepattribute: $.workflowStepwhere:name: 'new_lead'data:currentStep: $.workflowStep.idworkflowName: $.workflowStep.workflow_namename: $.workflowStep.nameentityId: $entityId- @create_entity:class: OroCRM\Bundle\SalesBundle\Entity\SalesFunnelattribute: $.salesFunneldata:startDate: $createdAtowner: $ownerlead: $.datatriggers:lead_creation:-event: createpriority: 5queued: trueMay 26, 2015 at 1:54 am #35990Hello, @Rodolfo.
You see, creating of new entity not always starts workflow – it can be done only if start step is defined, and Sales Funnel flow does not have it.
If I understand you correctly, you need to create SalesFunnel entity and automatically start workflow using “Create from Lead” transition – to do that you have to save entity right after creation (see “flush” option of @create_entity action), and then start workflow using “start_from_lead” transition with @start_workflow action.
For more information about @start_workflow action see action code.
May 28, 2015 at 1:16 pm #35991Hi @yshyshkin
Thank you for your help. After adding @start_workflow, now I’m getting this error:
1234Process job 926749 failed: The security context contains no authentication token.One possible reason may be that there is no firewall configured for this URL.1234567891011121314151617181920212223242526272829definitions:lead_creation:label: 'Create Sales Process for Lead'enabled: trueentity: OroCRM\Bundle\SalesBundle\Entity\Leadorder: 10actions_configuration:- @create_entity:class: OroCRM\Bundle\SalesBundle\Entity\SalesFunnelattribute: $.salesFunneldata:startDate: $createdAtowner: $ownerlead: $.dataorganization: $organizationflush: true- @start_workflow:name: b2b_flow_sales_funnelattribute: $.result.workflowItemtransition: start_from_leadtriggers:lead_creation:-event: createpriority: 5queued: trueMay 29, 2015 at 4:58 am #35992Hello, Rodolfo.
Security issue appears because this is queued process, workflow start action covered with ACL and there is no security/permissions in CLI execution. The easiest way to fix that is to make it not queued.
Also you missed some important parts – entity, channel etc. Here is how it should look like to work:
1234567891011121314151617181920212223242526272829definitions:lead_creation:label: 'Create Sales Process for Lead'enabled: trueentity: OroCRM\Bundle\SalesBundle\Entity\Leadorder: 10actions_configuration:- @create_entity:class: OroCRM\Bundle\SalesBundle\Entity\SalesFunnelattribute: $.salesFunneldata:startDate: $createdAtowner: $ownerlead: $.dataorganization: $organizationdataChannel: $dataChannelflush: true- @start_workflow:name: b2b_flow_sales_funnelentity: $.salesFunnelattribute: $.workflowItemtransition: start_from_leadtriggers:lead_creation:-event: createpriority: 5queued: falseMay 29, 2015 at 6:49 am #35993Hello @yshyshkin !
Thank you so much! It’s working!
May 4, 2016 at 5:39 am #35994Hi All,
Could please help me on installation issue. Please find issue details below.[2016-05-04 13:59:34] Launching “cache:clear” command
Clearing the cache for the prod environment with debug falseCommand “cache:clear” executed in 37 second(s), memory usage: 57.49Mb
[2016-05-04 14:00:27] Launching “oro:migration:load” command
Process migrations…
> Oro\Bundle\EntityExtendBundle\Migration\LoadEntityConfigStateMigration
> Oro\Bundle\MigrationBundle\Migration\CreateMigrationTableMigration
> Oro\Bundle\PlatformBundle\Migrations\Schema\OroPlatformBundleInstaller
> Oro\Bundle\OrganizationBundle\Migrations\Schema\OroOrganizationBundleInstaller
> Oro\Bundle\SecurityBundle\Migrations\Schema\OroSecurityBundleInstaller
> Oro\Bundle\AttachmentBundle\Migrations\Schema\OroAttachmentBundleInstaller
> Oro\Bundle\EmailBundle\Migrations\Schema\OroEmailBundleInstaller
> Oro\Bundle\CronBundle\Migrations\Schema\OroCronBundleInstaller
> Oro\Bundle\UserBundle\Migrations\Schema\OroUserBundleInstaller
> Oro\Bundle\SSOBundle\Migrations\Schema\OroUserBundleInstaller
> Oro\Bundle\EntityConfigBundle\Migrations\Schema\OroEntityConfigBundleInstaller
> Oro\Bundle\EntityExtendBundle\Migrations\Schema\OroEntityExtendBundleInstaller
> Oro\Bundle\IntegrationBundle\Migrations\Schema\OroIntegrationBundleInstaller
> Oro\Bundle\ActivityBundle\Migrations\Schema\OroActivityBundleInstaller
> Oro\Bundle\ActivityListBundle\Migrations\Schema\OroActivityListBundleInstaller
> Oro\Bundle\AddressBundle\Migrations\Schema\OroAddressBundleInstaller
> Oro\Bundle\BatchBundle\Migrations\Schema\OroBatchBundleInstaller
> Oro\Bundle\CalendarBundle\Migrations\Schema\OroCalendarBundleInstaller
> Oro\Bundle\ConfigBundle\Migrations\Schema\OroConfigBundleInstaller
> Oro\Bundle\DataAuditBundle\Migrations\Schema\OroDataAuditBundleInstaller
> Oro\Bundle\DataGridBundle\Migrations\Schema\OroDataGridBundleInstaller
> Oro\Bundle\EmbeddedFormBundle\Migrations\Schema\OroEmbeddedFormBundleInstaller
> Oro\Bundle\ImapBundle\Migrations\Schema\OroImapBundleInstaller
> Oro\Bundle\InstallerBundle\Migrations\Schema\OroInstallerBundleInstaller
> Oro\Bundle\MigrationBundle\Migrations\Schema\OroMigrationBundleInstaller
> Oro\Bundle\NoteBundle\Migrations\Schema\OroNoteBundleInstaller
> Oro\Bundle\NotificationBundle\Migrations\Schema\OroNotificationBundleInstaller
> Oro\Bundle\ReportBundle\Migrations\Schema\OroReportBundleInstaller
> Oro\Bundle\SearchBundle\Migrations\Schema\OroSearchBundleInstaller
> Oro\Bundle\SegmentBundle\Migrations\Schema\OroSegmentBundleInstaller
> Oro\Bundle\SidebarBundle\Migrations\Schema\OroSidebarBundleInstaller
> Oro\Bundle\TagBundle\Migrations\Schema\OroTagBundleInstaller
> Oro\Bundle\TranslationBundle\Migrations\Schema\OroTranslationBundleInstaller
> Oro\Bundle\WindowsBundle\Migrations\Schema\v1_0\OroWindowsBundle
> Oro\Bundle\WindowsBundle\Migrations\Schema\v1_1\OroWindowsBundle
> Oro\Bundle\WorkflowBundle\Migrations\Schema\OroWorkflowBundleInstaller
> OroCRM\Bundle\ActivityContactBundle\Migrations\Schema\OroCRMActivityContactBundleInstaller
> Oro\Bundle\CommentBundle\Migrations\Schema\OroCommentBundleInstaller
> Oro\Bundle\DashboardBundle\Migrations\Schema\OroDashboardBundleInstaller
> Oro\Bundle\NavigationBundle\Migrations\Schema\OroNavigationBundleInstaller
> OroCRM\Bundle\ContactBundle\Migrations\Schema\OroCRMContactBundleInstaller
> OroCRM\Bundle\AccountBundle\Migrations\Schema\OroCRMAccountBundleInstaller
> OroCRM\Bundle\MarketingListBundle\Migrations\Schema\OroCRMMarketingListBundleInstaller
> Oro\Bundle\TrackingBundle\Migrations\Schema\OroTrackingBundleInstaller
> Oro\Bundle\ReminderBundle\Migrations\Schema\OroReminderBundleBundleInstaller
> OroCRM\Bundle\CallBundle\Migrations\Schema\OroCRMCallBundleInstaller
> OroCRM\Bundle\CampaignBundle\Migrations\Schema\OroCRMCampaignBundleInstaller
> OroCRM\Bundle\ChannelBundle\Migrations\Schema\OroCRMChannelBundleInstaller[2016-05-04 14:10:31] Launching “oro:workflow:definitions:load” command
Loading workflow definitions…[Oro\Bundle\WorkflowBundle\Exception\AssemblerException]
Option “label” is requiredoro:workflow:definitions:load [–directories [DIRECTORIES]] [–workflows [WORKFLOWS]] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-s|–shell] [–process-isolation] [-e|–env ENV] [–no-debug] [–disabled-listeners DISABLED-LISTENERS] [–] <command>
Command “oro:workflow:definitions:load” executed in 4 second(s), memory usage: 4.21Mb
May 4, 2016 at 5:47 am #35995Hello.
You should check your workflow configuration – probably, you missed label for attribute or transition.
To check only workflow assembling you can run “php app/console oro:workflow:definitions:load” separately, fix issues (you can use -v flag to see exception stack trace) and only then try to install from scratch.
May 4, 2016 at 5:58 am #35996Hi Yevhen,
I am very new to Orocrm could you please elaborate bit more. - AuthorReplies
The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.