Issue with Record Type default value

  • 1
  • Problem
  • Updated 1 year ago
  • Solved
I am trying to set the default value of the Record Type to None so that the user is forced to choose either "Officer/Director" or "Other Contact".  There are only 2 record types used for this custom object. I have tried adding a third record type of "none" and having it to default to that, but it is not working either.  Also, there is a problem that the dropdown for Record Type ID is showing "Officer/Director" twice in the list (see image). Thanks in advance for any assistance.
Photo of Jim W

Jim W

  • 310 Points 250 badge 2x thumb

Posted 1 year ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Is the record type assigned to the user's profile?
Photo of Jim W

Jim W

  • 310 Points 250 badge 2x thumb
Those record types in the image are on the custom object and they relate an existing contact to a holding company. A contact can serve on many holding companies as either an "officer/director" or "other contact."   They are not related to a user profile, so far as I can tell
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,662 Points 20k badge 2x thumb
All record types get assigned to profiles. Go to create another record type and you'll see a step in the process that you select which profiles to assign it to. Alternatively you can open any profile and go to the object to see which record types it's assigned.
Photo of Jim W

Jim W

  • 310 Points 250 badge 2x thumb
Yes, the record type is assigned to profile. (see image)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Hmmm... Sorry. Didn't read your original post entirely.


Once you place your Record Type field on the page you can set to render as a picklist, required and with the option to add "None". Seemingly this is what you've done.

What version of Skuid are you running?

Can you post your XML for the page here?
(Edited)
Photo of Jim W

Jim W

  • 310 Points 250 badge 2x thumb
Thanks for you assistance Pat - Here is the XML. We are using Skuid version 9.3.4.   

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models>
        <model id="NewOfficerDirector" limit="20" query="false" createrowifnonefound="true" datasource="salesforce" type="" sobject="Holding_Company_Related_Contact__c" doclone="">
            <fields>
                <field id="Name"/>
                <field id="Holding_Company__c"/>
                <field id="Holding_Company__r.Name"/>
                <field id="Contact_SPV__c"/>
                <field id="Contact_SPV__r.Name"/>
                <field id="RecordTypeId" overridemetadata="false" ogdisplaytype="REFERENCE" displaytype="REFERENCE" datasource="salesforce" defaultvaluetype="fieldvalue" defaultValue="Please Choose One">
                    <batchfields/>
                </field>
                <field id="RecordType.Name" overridemetadata="false" ogdisplaytype="STRING" displaytype="STRING" defaultvaluetype="fieldvalue" defaultValue="Please Choose One" picklistsource="manual">
                    <picklistentries>
                        <entry value="Please_Choose_One" label="Please Choose One"/>
                    </picklistentries>
                </field>
                <field id="CurrencyIsoCode"/>
                <field id="Title__c"/>
                <field id="Role__c"/>
                <field id="Local_External__c"/>
                <field id="Dir_Mgr_Trustee__c"/>
                <field id="Send_NPS__c"/>
                <field id="Send_Appreciation_Gift__c"/>
                <field id="Send_Holiday_E_Card__c"/>
                <field id="Receive_Records__c"/>
                <field id="Import_Notes__c"/>
                <field id="RecordType.DeveloperName"/>
                <field id="Holding_Company__r.Id"/>
            </fields>
            <conditions>
                <condition type="param" value="id" field="Holding_Company__c" operator="=" enclosevalueinquotes="true" novaluebehavior="" state=""/>
            </conditions>
            <actions/>
        </model>
    </models>
    <components>
        <pagetitle model="NewOfficerDirector" uniqueid="sk-1ZsiYm-146">
            <maintitle>
                <template>{{Name}}</template>
            </maintitle>
            <subtitle>
                <template>{{Model.label}}</template>
            </subtitle>
            <actions/>
        </pagetitle>
        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="NewOfficerDirector" buttonposition="" uniqueid="sk-1ZuZlQ-182" mode="edit">
            <columns>
                <column width="33.3%">
                    <sections>
                        <section title="Basic Information" collapsible="no">
                            <fields>
                                <field id="Holding_Company__c" valuehalign="" type="" optionsource="" pagesize="5">
                                    <searchfields/>
                                    <filters/>
                                    <renderconditions logictype="and" onhidedatabehavior="keep"/>
                                    <enableconditions/>
                                </field>
                                <field id="Contact_SPV__c" valuehalign="" type=""/>
                                <field id="RecordTypeId" valuehalign="" type="REFPICK" required="true" addnoneoption="false" optionsource="" pagesize="5">
                                    <searchfields/>
                                    <renderconditions logictype="and" onhidedatabehavior="keep">
                                        <rendercondition type="blank" operator="!=" fieldmodel="NewOfficerDirector" sourcetype="fieldvalue" field="Contact_SPV__c" value="null" enclosevalueinquotes="false"/>
                                    </renderconditions>
                                    <enableconditions/>
                                    <filters/>
                                </field>
                            </fields>
                        </section>
                    </sections>
                </column>
                <column width="33.3%">
                    <sections>
                        <section title="Officer Information" collapsible="no">
                            <fields>
                                <field id="Title__c"/>
                                <field id="Role__c" valuehalign="" type=""/>
                                <field id="Local_External__c"/>
                                <field id="Dir_Mgr_Trustee__c"/>
                            </fields>
                            <renderconditions logictype="and">
                                <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="NewOfficerDirector" sourcetype="fieldvalue" field="RecordTypeId" value="01261000000VH0wAAG"/>
                            </renderconditions>
                        </section>
                    </sections>
                </column>
                <column width="33.3%">
                    <sections>
                        <section title="Contact Preferences" collapsible="no">
                            <fields>
                                <field id="Send_NPS__c"/>
                                <field id="Receive_Records__c"/>
                                <field id="Import_Notes__c"/>
                                <field id="Send_Appreciation_Gift__c"/>
                                <field id="Send_Holiday_E_Card__c"/>
                            </fields>
                            <renderconditions logictype="and">
                                <rendercondition type="blank" operator="!=" fieldmodel="NewOfficerDirector" sourcetype="fieldvalue" field="Contact_SPV__c" value="null" enclosevalueinquotes="false"/>
                            </renderconditions>
                        </section>
                    </sections>
                </column>
            </columns>
        </basicfieldeditor>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,662 Points 20k badge 2x thumb
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models>
        <model id="NewOfficerDirector" limit="20" query="false" createrowifnonefound="true" datasource="salesforce" type="" sobject="Holding_Company_Related_Contact__c" doclone="">
            <fields>
                <field id="Name"/>
                <field id="RecordTypeId"/>
                <field id="RecordType.Name"/>
            </fields>
            <conditions>
                <condition type="param" value="id" field="Holding_Company__c" operator="=" enclosevalueinquotes="true" novaluebehavior="" state=""/>
                <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="RecordTypeId" fieldtargetobjects="RecordType" operator="="/>
            </conditions>
            <actions/>
        </model>
    </models>
    <components>
        <pagetitle model="NewOfficerDirector" uniqueid="sk-1ZsiYm-146">
            <maintitle>
                <template>{{Name}}</template>
            </maintitle>
            <subtitle>
                <template>{{Model.label}}</template>
            </subtitle>
            <actions/>
        </pagetitle>
        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="NewOfficerDirector" buttonposition="" uniqueid="sk-1ZuZlQ-182" mode="edit">
            <columns>
                <column width="100%">
                    <sections>
                        <section title="Basic Information" collapsible="no">
                            <fields>
                                <field uniqueid="sk-2DyAQm-118" id="RecordTypeId" valuehalign="" type="REFPICK" required="true" addnoneoption="true"/>
                            </fields>
                        </section>
                    </sections>
                </column>
            </columns>
        </basicfieldeditor>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,662 Points 20k badge 2x thumb
Not sure what happened in your page, but it simply wasn't working. On rare occasion, the XML and the settings in the page builder aren't in sync.

That said, I removed the field and added it back in with the options I mentioned earlier. I then added a condition that ensured there wasn't a record type auto selected.
Photo of Jim W

Jim W

  • 310 Points 250 badge 2x thumb
Well thank you again Pat, I will give that a try. 
Photo of Jim W

Jim W

  • 310 Points 250 badge 2x thumb
I got it to work! Thanks again for your help.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,662 Points 20k badge 2x thumb
Yw