locked
javascript redirect by field instead of ID RRS feed

  • Question

  • Hello all,

    I've been googling for hours now and i can't find a way for doing what i want.

    Imagine these two options:

    //opens the account entity with the id E6155323-492E-E211-A8AF-68A3C45A28EA

    Xrm.Utility.openEntityForm("account", "E6155323-492E-E211-A8AF-68A3C45A28EA", null);

    //opens the account entity with the id E6155323-492E-E211-A8AF-68A3C45A28EA

    "https://XXX.crm4.dynamics.com//sfa/accts/edit.aspx?id=%7bE6155323-492E-E211-A8AF-68A3C45A28EA%7d"

    What about if want to "open" this entity but by NAME or PHONE NUMBER ??

    I only see examples of new entities with the values filled, but that's not what i want. Is it even possible ?

    Thursday, November 29, 2012 5:03 PM

Answers

  • In order to open the CRM form for an entity you will need to ID for the entity (whether you use openEntityForm, or launch the new form directly with a URL.)

    To get the ID for your entity, you can make a web service call to CRM to look up the ID for the entity, given the name or phone number.

    There are several examples in the Dynamics CRM SDK for calling CRM Organization service from JavaScript, including:

    http://technet.microsoft.com/en-us/library/gg328025.aspx


    • Proposed as answer by Sam - Inogic Friday, November 30, 2012 3:12 AM
    • Marked as answer by bla bla 84 Friday, November 30, 2012 9:38 AM
    Friday, November 30, 2012 12:01 AM
  • Ok thank you all.

    My requirement is in a call center when someone calls you get the number in a textbox and you redirect to the user with that number in microsoft crm.

    But no big deal, i'll do the query myself and then get the number from database or like Larry McCoy said.

    Again thanks, i'll mark the Larry Mccoy answer as ok so it is locked.

    • Marked as answer by bla bla 84 Friday, November 30, 2012 9:38 AM
    Friday, November 30, 2012 9:38 AM

All replies

  • I think this would be difficult because any value other than the ID runs the risk of not being unique. 

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Thursday, November 29, 2012 6:58 PM
    Moderator
  • In order to open the CRM form for an entity you will need to ID for the entity (whether you use openEntityForm, or launch the new form directly with a URL.)

    To get the ID for your entity, you can make a web service call to CRM to look up the ID for the entity, given the name or phone number.

    There are several examples in the Dynamics CRM SDK for calling CRM Organization service from JavaScript, including:

    http://technet.microsoft.com/en-us/library/gg328025.aspx


    • Proposed as answer by Sam - Inogic Friday, November 30, 2012 3:12 AM
    • Marked as answer by bla bla 84 Friday, November 30, 2012 9:38 AM
    Friday, November 30, 2012 12:01 AM
  • hi

    In MSCRM we can't open any record with name or phoneNumber,to open any record the GUID ID is Compulsory.

    may i know what is your exact requirement......?


    Please don't forget to Vote and marked as answer If this post answers your question or was helpful, please click "Mark As Answer" on the post and "Mark as Helpful" Be wise

    Friday, November 30, 2012 3:19 AM
  • Ok thank you all.

    My requirement is in a call center when someone calls you get the number in a textbox and you redirect to the user with that number in microsoft crm.

    But no big deal, i'll do the query myself and then get the number from database or like Larry McCoy said.

    Again thanks, i'll mark the Larry Mccoy answer as ok so it is locked.

    • Marked as answer by bla bla 84 Friday, November 30, 2012 9:38 AM
    Friday, November 30, 2012 9:38 AM