locked
Checking to see if an Account already exists RRS feed

  • Question

  • Hi,

    I'm currently writting a workflow to update records when an Opportunity is closed as Won. Basically the workflow will create an Account and copy data over from the Originating Lead, but I want to first check to see if the Account already exists.

    So my questions is now can I create a check within a workflow to see if an account under a specified name already exists.

    Many thanka in advance

    Dave C


    Dave C
    Friday, March 19, 2010 4:15 PM

Answers

  • Yes of course, you can add a check condition.

    Add a condition that check the opportunity, the attribute 'Customer', with operator 'Does not contain data'

    if this condition is true, then you need to create the account;


    My blog : http://mscrmtools.blogspot.com
    You will find:
    Bulk Delete Launcher(Delete data based on advanced find queries)
    Form Javascript Manager (export/import javascript from forms)
    ISV.Config Manager (graphical ISV.config edition - export/import)
    View Layout replicator (customize one view and replicate to others)
    And others (use tool tag on my blog)
    Friday, March 19, 2010 7:31 PM
    Moderator

All replies

  • I don't think you can use standard workflow because all checking conditions you can do are related to the record that triggered the workflow.

     

    But you can write a custom activities in c# that will check if an account exists for that name


    My blog : http://mscrmtools.blogspot.com
    You will find:
    Bulk Delete Launcher(Delete data based on advanced find queries)
    Form Javascript Manager (export/import javascript from forms)
    ISV.Config Manager (graphical ISV.config edition - export/import)
    View Layout replicator (customize one view and replicate to others)
    And others (use tool tag on my blog)
    Friday, March 19, 2010 5:03 PM
    Moderator
  • I don't think you can use standard workflow because all checking conditions you can do are related to the record that triggered the workflow.

     

    But you can write a custom activities in c# that will check if an account exists for that name


    My blog : http://mscrmtools.blogspot.com
    You will find:
    Bulk Delete Launcher(Delete data based on advanced find queries)
    Form Javascript Manager (export/import javascript from forms)
    ISV.Config Manager (graphical ISV.config edition - export/import)
    View Layout replicator (customize one view and replicate to others)
    And others (use tool tag on my blog)
    Friday, March 19, 2010 5:04 PM
    Moderator
  • Thanks for the reply... as the workflow is triggered by the change of status on the Opportunity entity, would it be possible to detemine whether or not the Opportunity was associated with a Lead or and Account. As I want to workflow to create an account if one doesn't exist, if it knew that the Opportunity was created from an Account it wouldn't need to run. If on the other hand the Opportunity was created from a Lead, then it could create the Account.

    I think a bit of lateral thought is required... isn't that always the case with CRM. I'm not much of a coder, so hoping this can be achieved with the standard workflow functions.

    Many thanks

    Dave C 


    Dave C
    Friday, March 19, 2010 6:22 PM
  • Yes of course, you can add a check condition.

    Add a condition that check the opportunity, the attribute 'Customer', with operator 'Does not contain data'

    if this condition is true, then you need to create the account;


    My blog : http://mscrmtools.blogspot.com
    You will find:
    Bulk Delete Launcher(Delete data based on advanced find queries)
    Form Javascript Manager (export/import javascript from forms)
    ISV.Config Manager (graphical ISV.config edition - export/import)
    View Layout replicator (customize one view and replicate to others)
    And others (use tool tag on my blog)
    Friday, March 19, 2010 7:31 PM
    Moderator
  • Sorted... I actually needed to check to see if the Originating Lead field contained data and if it did, then create an Account.

    An Opportunity created from an Account doesn't have an entry in this field.

    Thanks for the pointers.

    Dave C


    Dave C
    Saturday, March 20, 2010 11:27 AM