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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

(1) ShareShare
ReportReport
Posted on by

I'm using the CRM 2016 on-premises

I find this Client API can only return 1 and 2 status

But according to the MSDN, the return value will include

alueForm Type

0

Undefined

1

Create

2

Update

3

Read Only

4

Disabled

5

Quick Create (Deprecated)

6

Bulk Edit

11

Read Optimized (Deprecated)

For example:

1. Create custom entity ent_Test01

2. Set user role has only read access with Org level.

3. create a record with system administrator role

4. login the user who has only read access and open the ent_Test01 record

5. I will see there is a yellow bar on the bottom of the page " Inactive                                Readonly"

6. But the Xrm.Page.ui.getFormType() still return 2 (Update)

Can anyone tell me when I can get 3(Read Only) and 4(Disabled) value?

*This post is locked for comments

I have the same question (0)
  • JVE Profile Picture
    213 on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    It is resolved in latest CRM On-Prem v9.0.3.7

  • Community Member Profile Picture
    on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    How can i apply validation in form edit mode in javascript

  • Community Member Profile Picture
    on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    Did you guys find any better solution. I am in the same boat

  • MohamedRamadan Profile Picture
    on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    I think it is a bug, as it was working as expected from CRM 2011 until CRM 2015. The workaround we used is that, if the form type is 2, we are making another JavaScript Ajax call to check the user permission on the record, if it is read, then we consider the form is read-only, if it is write, then the form is in update mode.

    Of course, this solution adds a performance cost to the form load, but we find it good for our case.

    Another workaround, I think I saw it in StackOverflow, was that you looking for a field on the form that you know it should be editable in the write mode, and check if it is editable or read-only, but we didn't try this solution. 

  • Daniel Wikell Profile Picture
    2,360 on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    I've read somewhere (but can't find the source anymore) that as soon as a javascript event is tied to a read-only form it will change and no longer be classified as a read-only form. Perhaps this behaviour is what is causing the issues..

    The combination of having to read the value from a javscript and it not being available when there's javascript on the form makes this whole thing form type quite a bit strange... :D

  • Community Member Profile Picture
    on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    Hi ,

    Any one find solution? Or is it Bug?

    Regards,

    Shiva K

  • MohamedRamadan Profile Picture
    on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    Hello,

    We are also facing the same issue on Microsoft Dynamics 365 Version (8.2.2.112) On-premise, Xrm.Page.ui.getFormType() is returning 2 (update) even the form is a Read-only.

    Any updates or workarrounds for this?

    Thanks,

    Mohamed Ramadan

  • Minal Salunkhe Profile Picture
    65 on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    Hi,

    I'm facing the same issue on dynamics 365. Did you get any solution for this.

  • Community Member Profile Picture
    on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    Have you found a resolution to this? I am not seeing this behavior in MSCRM 2011, but I am in 2016.

    Thanks,

  • Suggested answer
    Nadeeja Bomiriya Profile Picture
    6,804 on at
    RE: About Xrm.Page.ui.getFormType() in CRM 2016 on-premises

    Hi AlejandroRTovar,

    I tested this in CRM 2016 On-Premises (8.0.0.1094) and CRM Online 2016 Update (8.1.0.502).  It works fine for me.  I have tested below scenarios.

    1. Open new form - returns 1 (Create)

    2. Open an existing form - returns 2 (Update)

    3. Select multiple records in a view and click Edit - returns 6 (Bulk Edit)

    4. Deactivate form - returns 4 (Disabled)

    Cheers,

    Nadeeja

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans