Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Header Status Reason field returning null reference in Interactive Service Hub through JavaScript code

Posted on by 28,964 Super User 2024 Season 1

Hi,

We have added JavaScript where we need to hide Header Status Reason field on Case form through Javascript.

We have used below code

var statusReason_header = Xrm.Page.getControl("header_statuscode");

The above code is returning null reference in Interactive service hub. However the above piece of code is working in web client. We have placed Status Reason field on Case form Header.

Thanks

*This post is locked for comments

  • Verified answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,265 on at
    RE: Header Status Reason field returning null reference in Interactive Service Hub through JavaScript code

    Hi Bipin,

    maybe you can workaround this with status reason transitions:

    www.preact.co.uk/.../how-to-set-dynamics-crm-status-reason-transitions

    technet.microsoft.com/.../dn660979.aspx

    and there you could leave out the on-hold status reason.

    Cheers,

    Andreas

  • Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Header Status Reason field returning null reference in Interactive Service Hub through JavaScript code

    Hi Andreas,

    We have the requirement to Hide onHold(2) optionset value from Status Reason field on Case form. We are getting Null reference through Javascript. Due to this below code is not executing

    var statusReason_header = Xrm.Page.getControl("header_statuscode");

           //Hide Status Reason OnHold value from Header

           if (statusReason_header != null) {

               statusReason_header.removeOption(2);

           }

    We have also placed the same field on Body of Case form and tried below code   Xrm.Page.getControl("statuscode").removeOption(2); but this will hide OnHold optionset from Body field not from Header. Header Status Reason field would still show OnHold Optionset.

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,265 on at
    RE: Header Status Reason field returning null reference in Interactive Service Hub through JavaScript code

    Hi Bipin,

    maybe this helps:

    www.magnetismsolutions.com/.../hiding-side-bar-fields-in-the-crm-2016-interactive-service-hub

    Cheers,

    Andreas

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