Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Cannot read property 'etc' of null . for query string parameters .

Posted on by 382

Hi ,

var objectTypecode =Xrm.page.context.getquerystringparameters().etc;

the above line of code is working fine for web crm. but for mobile application ,the above line of code gives me below error.

error: "Cannot read property 'etc' of null . for query string parameters ".

Kindly Advice.

Thanks,

Waseem.

*This post is locked for comments

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Cannot read property 'etc' of null . for query string parameters .

    Can you please provide your code?

    You can get Logical Name from form context - msdn.microsoft.com/.../gg334720.aspx

  • Mohammed Waseem Profile Picture
    Mohammed Waseem 382 on at
    RE: Cannot read property 'etc' of null . for query string parameters .

    its not giving me Object type code . because it gives me ready state 1 .

    and anyway i dont want to hard code the entity logical name .

    Any other way .we can work arround .

    Thanks,

    Waseem.

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Cannot read property 'etc' of null . for query string parameters .

    Waseem,

    etc contains objecttypecode so the answer - yes, you will get that piece from Metadata call.

  • Mohammed Waseem Profile Picture
    Mohammed Waseem 382 on at
    RE: Cannot read property 'etc' of null . for query string parameters .

    HI Andrii ,

    even if i get object type code from meta data service call , will it give me etc portion from that.

    Thanks ,

    Waseem.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Cannot read property 'etc' of null . for query string parameters .

    Hello,

    Check following post - butenko.pro/.../how-to-get-object-type-code-of-entity-using-webapi

  • Mohammed Waseem Profile Picture
    Mohammed Waseem 382 on at
    RE: Cannot read property 'etc' of null . for query string parameters .

    Hi Andrii,

    Thanks for reply.

    Could you please help me with the code.

    Thanks,

    Waseem

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Cannot read property 'etc' of null . for query string parameters .

    Hello Mohammed,

    Even if you will make getQueryStringParameters function work in mobile getting of etc portion of url is not supported. Try to use other approach - fetching of object type code of current entity using metadata service call.

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans