0

We have a few workflows running on opportunity. There is a workflow which is run when a record is created which checks the record type of Account and changes the recordtype of opportunity accordingly. For eg if account record type is Franchise then the opps recordtype is changed to francise

Another workflow which changes the name of the opportunity depending on the recordtype and this runs everytime record is created and edited. For eg if the recordtype is Franchise then the name is Franchise -- Account name.

The issue we have is that when we convert a lead which is a Franchise, the opps are changed to recordtype franchise but the name is not changed.

The name change workflow executes fine when i create a opp record manually or when i edit the record and change the record type.

This is most likely because the name change workflow executes before the recordtype change workflow .

Is there a way i can make sure the name change workflow executes after the recordtype change workflow executes

Thanks

UPDATE:

I checked the checkbox reevaluate workflows after field change on the recordtype change workflow. But it does not have any effect on the outcome

1

Lead conversions happen differently than creating new opportunities from existing accounts. There's a special LeadConvert Class that runs during lead conversions to create contacts, accounts, and opportunities which then performs the DML to insert them into the database. It could very well be that they might not cause some of your normal workflow to execute and you may need to create workflow specific to Lead conversions.

To illustrate, it's known that Before Triggers and validation rules are affected by this. According to the Apex docs:

The before triggers associated with the following operations are fired during lead conversion only if validation and triggers for lead conversion are enabled in the organization:

  • insert of accounts, contacts, and opportunities
  • update of accounts and contacts

Based on the above, you may want to check your settings in Setup for Lead conversion to see if those settings are enabled and any others that might be affecting you.

| improve this answer | |
  • The workflows seem to get fired, but i think its the order in which they are fired. The workflow of name change fires before the recordtype change so the name is showing the wrong recordtype name though the recordtype in itself has changed – Prady Nov 26 '15 at 17:27
  • I'd expect the workflow to fire in the order the DML occurs. – crmprogdev Nov 26 '15 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.