locked
Is this the right way to update a field when an opportunity is created? RRS feed

  • Question

  • Hey everyone,

    In my account form, I have an attribute called Partner, and it has 2 options, my company, or another that we support.  When we create accounts we choose which is which.  On my opportunity view, I also have a similar field for Partner which we also change.  I'd like it so if the account says Partner 2, creating an opportunity under that account will automatically select Partner 2.

    I thought I had it figured out but no go.  Made a workflow for Opportunity, Organization as scope, and start when: Record is created.

    I said If: Potential Customer (Account): Partner equals [Partner 2] then

    Update Opportunity: and then I selected that field and chose the Partner 2 from the drop down.

     

    Tried it out, didn't do anything.  Not even a record of it trying to do anything in the Workflows under system jobs.  I assume when record created is what I need no?  I tried creating it as a before step and also an after step.  Not sure what I'm missing...

    Tuesday, April 13, 2010 7:46 PM

Answers

  • If you create an opportunity from the Account form left hand nav pane then you could add a relationship mapping between the two fields. Not sure if the text value needs to tbe same in each field but the value of the picklist (1, 2) will probably need be. Then you only need to worry about when the account is change using the customer lookup field on the opportunity form. If you had to cover this scenario then use AJAX and retrieve the value. The alternative would be to create a plugin that fires on the create and update of the opportunity to find the required value and update it.
    MSCRM Bing'd - http://bingsoft.wordpress.com
    Tuesday, April 13, 2010 8:07 PM
    Moderator
  • Rhett's advice is correct, create the mapping between the Account, Partner field and the Opportunity Partner field. After publishing the change, ensure the user's first open the Account and then add an Opportunity to the Account.  This will ensure that all new Opportunities have the value passed from the Account to the Opportunity.

    I think the reason your workflow did not work is because you set it to Record Created.  Since you updated an existing Opportunity, that will not trigger the workflow.  What I generally do is also select the On Demand checkbox as that will not only let me test the workflow against a record but also let me use the workflow as needed to update, change records or take whatever action is identified in the workflow.


    Regards, Donna

           

    Tuesday, April 13, 2010 8:24 PM

All replies

  • If you create an opportunity from the Account form left hand nav pane then you could add a relationship mapping between the two fields. Not sure if the text value needs to tbe same in each field but the value of the picklist (1, 2) will probably need be. Then you only need to worry about when the account is change using the customer lookup field on the opportunity form. If you had to cover this scenario then use AJAX and retrieve the value. The alternative would be to create a plugin that fires on the create and update of the opportunity to find the required value and update it.
    MSCRM Bing'd - http://bingsoft.wordpress.com
    Tuesday, April 13, 2010 8:07 PM
    Moderator
  • Rhett's advice is correct, create the mapping between the Account, Partner field and the Opportunity Partner field. After publishing the change, ensure the user's first open the Account and then add an Opportunity to the Account.  This will ensure that all new Opportunities have the value passed from the Account to the Opportunity.

    I think the reason your workflow did not work is because you set it to Record Created.  Since you updated an existing Opportunity, that will not trigger the workflow.  What I generally do is also select the On Demand checkbox as that will not only let me test the workflow against a record but also let me use the workflow as needed to update, change records or take whatever action is identified in the workflow.


    Regards, Donna

           

    Tuesday, April 13, 2010 8:24 PM