Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Need to autofill Mobile Phone field in the Quick create Contact window from query string using javascript

Posted on by Microsoft Employee

Hello Everyone,

    I Need to autofill Mobile Phone field in the Quick create Contact window from query string using javascript.

        Problem I am facing to do this is that window.location.href in the javascript function which I am calling on quick create contact form load is returning "https://CRMURL/form/ClientApiWrapper.aspx?ver=1047049190"

but actual url in the browser is 

https://CRMURL/main.aspx?etn=incident&pagetype=entityrecord&extraqs=mobilephone%3D4564748998%26customerid%3D380c2465-03ad-e711-80d7-005056b44c23%26customeridtype%3Dcontact#761510344

So, I am not sure about anyother way to do this. Please let me know if anyone having idea about it.

Thanks

Yogesh

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Need to autofill Mobile Phone field in the Quick create Contact window from query string using javascript

    @Nijos  Thank you for the suggestion, it works for me. :)

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Need to autofill Mobile Phone field in the Quick create Contact window from query string using javascript

    Take a look at the following link:

    msdn.microsoft.com/.../jj602956.aspx

    Basically you can use Xrm.Utility.openQuickCreate(entityLogicalName,createFromEntity,parameters);

    You would pass the information that you want in the parameters collection. See the sample in the link above.

    Hope this helps.

  • Verified answer
    Nijos Profile Picture
    Nijos 1,672 on at
    RE: Need to autofill Mobile Phone field in the Quick create Contact window from query string using javascript

    Hi,

    Dynamisc CRM uses many Iframes and makes this a messy stuff.

    Please check the DOM structure using browser debugger and identify where your current call is executing.

    Based on that try window.parent.parent.location.href or window.parentparent.parent.location.href

    if thats not working please try window.top.location.href

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Need to autofill Mobile Phone field in the Quick create Contact window from query string using javascript

    If anyone can look into it, I tried with window.parent.location.href  also but in this case also its returning different url  like this

    "https://CRMURL/form/page.aspx#_CreateFromId=&_CreateFromType=112&_searchText=&businessRulesVersion=%7b636268967110000360%7d1033&etc=2&formts=6891592&hidecommandbar=true&mdts=6891767&setLastViewed=false&showglobalquickcreate=true&userts=131558257347918266"

    which is not what i need.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans