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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

No Default Value On Quick Create Optionsets CRM 2013

(0) ShareShare
ReportReport
Posted on by 60

Hi everyone.

I have a quick create form for Contact on the Account Entity.

Our client has requested that the Gender field be added to the quick create form but and to be optional. Which worked fine. The problem is that it automatically defaults to Male. They do not want it to do this. They want it to remain blank unless it is specifically entered in. It's default option in the standard contact form is to remain blank, how can I make this behaviour happen in the Quick Create form too?

I have tried to use JavaScript onload to achieve this via:

Xrm.Page.getAttribute("gendercode").setValue(null);

This gives me "Error: Object expected"

What else can I do here?

*This post is locked for comments

I have the same question (0)
  • Vijay Waghmare Profile Picture
    on at

    Go to Settings->Customization->Customize the system -> Contact -> Fields -> Open Gender attribute -> set Unassigned Value as default value.

    Thanks,

    Vijay waghmare

  • madbrendon Profile Picture
    60 on at

    Hi Vijay,

    As I mentioned above, that is already how it is set.

    This works fine on the standard form. It has no value when the form loads.

    On the Quick Create form however - it defaults to Male instead of Unassigned Value.

  • Verified answer
    Vijay Waghmare Profile Picture
    on at

    Hi,

    Setting Unassigned Value as default value for drop down should work. I tried on CRM online and its working for me.

    Can you please check, if “gender” field added on the form and published properly?

    You can try checking field before setting its value as below

    If(Xrm.Page.getAttribute("gendercode"))

    {

    Xrm.Page.getAttribute("gendercode").setValue(null);

    Or

    Xrm.Page.getAttribute("gendercode").setValue(-1);

    alert(Xrm.Page.getAttribute("gendercode").getValue());

    }

    Also check if any JavaScript events registered on quick create form setting gender value on load.

    Thanks,

    Vijay Waghmare

  • Verified answer
    madbrendon Profile Picture
    60 on at

    Hi Vijay,

    Thanks for your help.

    This line of JS onload has solved my problem.

    Xrm.Page.getAttribute("gendercode").setValue(-1);

    Thanks again,

    Brendon

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans