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

Announcements

News and Announcements icon
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,985 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,985 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans