web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by 28,983 Moderator

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

I have the same question (0)
  • Suggested answer
    Andreas Cieslik Profile Picture
    9,267 on at

    Hi Bipin,

    maybe this helps:

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

    Cheers,

    Andreas

  • Bipin D365 Profile Picture
    28,983 Moderator on at

    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.

  • Verified answer
    Andreas Cieslik Profile Picture
    9,267 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans