IsCurrent has stopped being checked by default when creating a new CO record

v7.10.2.3 Git SHA: b41e3d6546523d455a7dc932c1eb444aedd07f94

In our determinations subview on CO forms, isCurrent has stopped being “true” by default when creating a new record. It works as expected when the CO is not new (i.e. the new determination gets “true” by default and the old determinations get unchecked), but nothing I can do seems to change the behavior on the default new CO form. If I manually add a second determination to the CO before saving, the checkbox behaves as expected.

I think this is related to the fact that we have a determination record set to be created by default? I think this problem cropped up due to the recent update, but I am not 100% sure, it could be due to my own meddling with the forms (I was attempting to change the default sort order).

Apologies if this is a duplicate of Checkbox default="true" is not making checkbox checked by default, but it seems like this might be a separate issue?

Example of new CO default, showing box unchecked

Example of manually adding new determination to same new CO before saving:

Hi @nfshoobs,

I don’t believe it is a global issue with the 7.10.2.3 release, as the demo instance is on that version and the current box is checked when creating a new determination. I think you may be on to something with the determination being created by default.

Would you mind posting your form xml for Collection Object and Determination? I can take a look

Hey @markp,
Here you go! Thanks for taking a look.

Invertebrate Views_CO.xml (168.3 KB)

<viewdef name="Collection Object" class="edu.ku.brc.specify.datamodel.CollectionObject" type="form" gettable="edu.ku.brc.af.ui.forms.DataGetterForObj" settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
	<desc>The Collection Object form.</desc>
	<enableRules/>
	<columnDef>100px,2px,195px,5px,96px,2px,50px,10px,150px,5px,94px,2px,176px,15px,p:g</columnDef>
	<columnDef os="lnx">115px,2px,195px,5px,125px,2px,60px,10px,140px,5px,125px,2px,181px,15px,p:g</columnDef>
	<columnDef os="mac">130px,2px,215px,5px,128px,2px,105px,10px,145px,5px,138px,2px,195px,15px,p:g</columnDef>
	<columnDef os="exp">p,2px,min(p;250px),5px:g,p,2px,p:g(2),10px,p:g(2),5px:g,p,2px,p:g,p,p:g</columnDef>
	<rowDef auto="true" cell="p" sep="2px"/>
	<rows>
		<row>
			<cell type="label" labelfor="1"/>
			<cell type="field" id="1" name="catalogNumber" uitype="formattedtext" readonly="true"/>
			<!--To make Catalog Number editable, change readonly="true" in the above line to readonly="false". ONLY do this if you're the curator and you know what the heck you're doing. Change it back when you're done. -NFS !-->
			<cell type="label" labelfor="3"/>
			<cell type="field" id="3" name="accession" uitype="querycbx" initialize="name=AccessionCO;title=AccessionCO" searchbtn="false" addbtn="false" isrequired="false" colspan="4"/>
			<cell type="panel" id="116" name="outerPanel" coldef="p,2px,p:g,5px,p:g" colspan="5">
				<rows>
					<row>
						<cell type="subview" id="attachments" viewname="ObjectAttachment" name="collectionObjectAttachments" initialize="btn=true;icon=CollectionObjectAttachment"/>
						<cell type="subview" id="7" name="collectionObjectCitations" viewname="CollectionObjectCitation" initialize="btn=true;icon=CollectionObjectCitation"/>
						<cell type="subview" viewname="DNASequence" id="6" name="dnaSequences" initialize="btn=true"/>
					</row>
				</rows>
			</cell>
		</row>
		<row>
			<cell type="subview" viewname="Determination" id="6" name="determinations" colspan="14" rows="5" initialize="sortfield=-DeterminedDate"/>
		</row>
		<row>
			<cell type="separator" label="Collecting Event Info" colspan="14"/>
		</row>
		<row>
			<cell type="label" labelfor="21"/>
			<cell type="field" id="21" name="collectingEvent" uitype="querycbx" initialize="name=CollectingEvent;clonebtn=true" colspan="12"/>
		</row>
		<row>
			<cell type="subview" id="cesub" name="collectingEvent" viewname="CollectingEventSub" defaulttype="form" colspan="14" rows="5" readonly="false"/>
		</row>
		<row>
			<cell type="subview" viewname="Preparation" id="8" name="preparations" defaulttype="table" rows="3" colspan="14"/>
		</row>
		<row>
			<cell type="panel" id="outerPanel" name="outerPanel" coldef="p,f:p:g,p,f:p:g,p,f:p:g,p,f:p:g" rowdef="p" colspan="16">
				<rows>
					<row>
						<cell type="label" label="Total Items:"/>
						<cell type="field" id="tq" name="totalCountAmt" uitype="text" readonly="true"/>
						<cell type="label" label="Total Current Items:"/>
						<cell type="field" id="ti" name="actualTotalCountAmt" uitype="text" readonly="true"/>
						<cell type="label" labelfor="int1"/>
						<cell type="field" id="int1" name="integer1" uitype="text"/>
						<cell type="label" labelfor="int2"/>
						<cell type="field" id="int2" name="integer2" uitype="text"/>
						<cell type="label" labelfor="resint3"/>
						<cell type="field" id="resint3" name="reservedInteger3" uitype="text"/>
					</row>
					<row>
						<cell type="label" labelfor="rem"/>
						<cell type="field" id="rem" name="remarks" uitype="textareabrief" rows="3" colspan="17"/>
					</row>
				</rows>
			</cell>
		</row>
		<row>
			<cell type="panel" id="116" name="outerPanel" coldef="p,2px,p:g,5px,p:g" rowdef="p,4px,p,4px,p,4px,p,4px,p,4px,p,4px,p,4px,p" colspan="6">
				<rows>
					<row>
						<cell type="label" labelfor="14"/>
						<cell type="field" id="14" name="altCatalogNumber" uitype="text" colspan="3"/>
						<!-- 						<cell type="label" labelfor="t3"/>
						<cell type="field" id="t3" name="text3" uitype="text" colspan="8"/> -->
					</row>
					<row>
						<cell type="label" labelfor="4"/>
						<cell type="field" id="4" name="cataloger" uitype="querycbx" initialize="searchbtn=false; newbtn=false; name=Agent;title=Catalog Agent" readonly="true" isrequired="true" colspan="3"/>
						<!-- 						<cell type="label" labelfor="10"/>
						<cell type="field" id="10" name="modifiedByAgent" uitype="label" readonly="true" uifieldformatter="Agent" colspan="3"/> -->
					</row>
					<row>
						<cell type="label" labelfor="5"/>
						<cell type="field" id="5" uitype="plugin" name="this" initialize="name=PartialDateUI;df=catalogedDate;tp=catalogedDatePrecision" uifieldformatter="Date" default="today" readonly="true" colspan="3"/>
						<!-- 						<cell type="label" labelfor="11"/>
						<cell type="field" id="11" name="timestampModified" uitype="label" readonly="true" colspan="3"/> -->
					</row>
					<row><!-- 						<cell type="label" labelfor="12"/>
						<cell type="field" id="12" name="catalogedDateVerbatim" uitype="text" readonly="true" colspan="3"/>
            <cell type="label" labelfor="guid"/>
						<cell type="field" id="guid" name="guid" uitype="text" colspan="3" readonly="true"/> --></row>
					<row>
						<cell type="label" label="  "/>
					</row>
					<row>
						<cell type="label" label="  "/>
					</row>
					<row>
						<cell type="label" label="  "/>
					</row>
					<row>
						<cell type="label" label="  "/>
					</row>
				</rows>
			</cell>
			<cell type="panel" id="116" name="outerPanel" coldef="p,2px,p:g,5px,p:g" rowdef="p,4px,p,4px,p,4px,p,4px,p,4px,p,4px,p,4px,p" colspan="10">
				<rows>
					<row>
						<cell type="label" labelfor="t3"/>
						<cell type="field" id="t3" name="text3" uitype="text" colspan="6"/>
					</row>
					<row>
						<cell type="label" labelfor="10"/>
						<cell type="field" id="10" name="modifiedByAgent" uitype="label" readonly="true" uifieldformatter="Agent" colspan="2"/>
					</row>
					<row>
						<cell type="label" labelfor="11"/>
						<cell type="field" id="11" name="timestampModified" uitype="label" readonly="true" colspan="2"/>
					</row>
					v
					<row>
						<cell type="blank" colspan="2"/>
						<cell type="command" id="114" name="generateLabelBtn" label="Generate Label" ignore="true" default="true" initialize="visible=false;align=left"/>
					</row>
				</rows>
			</cell>
		</row>
		<!--<row>
       <rows>
         <row>
						<cell type="label" labelfor="t3"/>
						<cell type="field" id="t3" name="text3" uitype="text" colspan="8"/>
          </row>
       <row>
           <cell type="label" labelfor="10"/>
					 <cell type="field" id="10" name="modifiedByAgent" uitype="label" readonly="true" uifieldformatter="Agent" colspan="3"/>
        </row>
      <row>
           <cell type="label" labelfor="11"/>
					 <cell type="field" id="11" name="timestampModified" uitype="label" readonly="true" colspan="3"/>
					</row>
      <row>
    			<cell type="label" labelfor="guid"/>
					<cell type="field" id="guid" name="guid" uitype="text" colspan="3" readonly="true"/>
				</row>
  </rows>
  </cell>
  </row>
    
                    <cell type="label" label="RELNAMEHERE:" initialize="align=right;"/>
                    <cell type="field" id="colrel" uitype="plugin" name="this" initialize="name=CollectionRelOneToManyPlugin;relname=xxxx;" colspan="9"/>
                    <cell type="label" labelfor="2"/>
                    <cell type="field" id="2" name="projectNumber" uitype="text"/>
                </row>
                <row>
                    <cell type="subview" id="15" viewname="InvertZooAttributes" name="collectionObjectAttribute" colspan="14"/>
                </row>
                <row>
                    <cell type="label" label="RELNAMEHERE:" initialize="align=right;"/>
                    <cell type="field" id="colrel" uitype="plugin" name="this" initialize="name=ColRelTypePlugin;relname=xxxx;"/>
                </row>
                <row>
                    <cell type="label" labelfor="appr"/>
                    <cell type="field" id="appr" name="appraisal" uitype="querycbx" initialize="name=Appraisal;title=Appraisal" isrequired="false"/>
                </row>
                <row>
                    <cell type="panel" id="ContainerPanel" name="ContainerPanel" coldef="p" rowdef="p" colspan="11">
                        <rows>
                            <row>
                                <cell type="panel" id="CPInner" name="CPInner" coldef="p" rowdef="p" initialize="border=line;bordercolor=200,200,200;bgcolor=240,240,240">
                                <rows>
                                    <row>
                                        <cell type="field" id="ContainerPlugin" uitype="plugin" name="this" initialize="name=ContainerPlugin"/>
                                    </row>
                                </rows>
                            </cell>
                            </row>
                        </rows> 
                    </cell>
                </row>
                <row>
                    <cell type="label" labelfor="avail"/>
                    <cell type="field" id="avail" name="availability" uitype="text"/>
                    <cell type="label" labelfor="cdv"/>
                    <cell type="field" id="cdv" name="catalogedDateVerbatim" uitype="text"/>
                    <cell type="label" labelfor="ca"/>
                    <cell type="field" id="ca" name="countAmt" uitype="text"/>
                </row>
                <row>
                    <cell type="subview" id="7" name="collectionObjectCitations" viewname="CollectionObjectCitation" colspan="15"/>                    
                </row>
                <row>
                    <cell type="subview" viewname="ConservDescription" id="cd" name="conservDescriptions" initialize="btn=true"/>
                </row>
                <row>
                    <cell type="subview" viewname="DNASequence" id="6" name="dnaSequences" initialize="btn=true"/>
                </row>
                <row>
                    <cell type="label" labelfor="fnp"/>
                    <cell type="field" id="fnp" name="fieldNotebookPage" uitype="querycbx" initialize="name=FieldNotebookPage;title=FieldNotebookPage" isrequired="false"/>
                </row>
                <row>
                    <cell type="label" labelfor="desc"/>
                    <cell type="field" id="desc" name="description" uitype="text"/>
                    <cell type="label" labelfor="fn"/>
                    <cell type="field" id="fn" name="fieldNumber" uitype="text"/>
                    <cell type="label" labelfor="guid"/>
                    <cell type="field" id="guid" name="guid" uitype="text"/>
                </row>
                <row>
                    <cell type="label" labelfor="id"/>
                    <cell type="field" id="id" name="inventoryDate" uitype="formattedtext" uifieldformatter="Date"/>
                    <cell type="label" labelfor="mod"/>
                    <cell type="field" id="mod" name="modifier" uitype="text"/>
                    <cell type="label" labelfor="name"/>
                    <cell type="field" id="name" name="name" uitype="text"/>
                </row>
                <row>
                    <cell type="label" labelfor="not"/>
                    <cell type="field" id="not" name="notifications" uitype="text"/>
                    <cell type="label" labelfor="n1"/>
                    <cell type="field" id="n1" name="number1" uitype="text"/>
                    <cell type="label" labelfor="n2"/>
                    <cell type="field" id="n2" name="number2" uitype="text"/>
                </row>
                <row>
                    <cell type="subview" viewname="OtherIdentifiers" id="44" name="otherIdentifiers" defaulttype="table" colspan="15" rows="3"/>
                </row>
                <row>
                    <cell type="subview" viewname="Project" id="proj" name="projects" initialize="btn=true"/>
                </row>
                <row>
                    <cell type="label" labelfor="oj"/>
                    <cell type="field" id="oj" name="objectCondition" uitype="text"/>
                    <cell type="label" labelfor="rest"/>
                    <cell type="field" id="rest" name="restrictions" uitype="text"/>
                </row>
                <row>
                    <cell type="label" labelfor="t2"/>
                    <cell type="field" id="t2" name="text2" uitype="text"/>
                    <cell type="label" labelfor="n2"/>
                    <cell type="field" id="n2" name="totalValue" uitype="text"/>
                    <cell type="subview" viewname="SubPaleoContext" id="9" name="paleoContext" defaulttype="table" colspan="12"/>
                </row> 
                <row>
                    <cell type="subview" viewname="TreatmentEvent" id="te" name="treatmentEvents" initialize="btn=true"/>
                </row>
                <row>
                    <cell type="field" id="yn3" name="yesNo3" uitype="checkbox" initialize="editable=true"/>
                    <cell type="field" id="yn4" name="yesNo4" uitype="checkbox" initialize="editable=true"/>
                    <cell type="field" id="yn5" name="yesNo5" uitype="checkbox" initialize="editable=true"/>
                    <cell type="field" id="yn6" name="yesNo6" uitype="checkbox" initialize="editable=true"/>
                    <cell type="label" labelfor="9"/>
                    <cell type="field" id="9" name="createdByAgent" uitype="label" readonly="true" uifieldformatter="Agent"/>
                    <cell type="label" labelfor="12"/>
                    <cell type="field" id="12" name="timestampCreated" uitype="label" readonly="true"/>
    
    <cell type="field" id="113" uitype="checkbox" name="generateLabelChk" label="Generate Label on Save" ignore="true" default="true" initialize="visible=false"/>
<rows condition="yesNo3=TRUE">
			<row>
				<cell type="label" labelfor="1"/>
				<cell type="field" id="1" name="catalogNumber" uitype="formattedtext" readonly="true"/>
				<cell type="label" labelfor="yn3"/>
				<cell type="field" id="yn3" name="yesNo3" uitype="checkbox" initialize="editable=true"/>
				<cell type="label" labelfor="3"/>
				<cell type="field" id="3" name="accession" uitype="querycbx" initialize="name=AccessionCO;title=AccessionCO" searchbtn="false" addbtn="false" isrequired="false" colspan="4"/>
				<cell type="subview" id="7" name="collectionObjectCitations" viewname="CollectionObjectCitation" initialize="btn=true;icon=CollectionObjectCitation"/>
				<cell type="subview" id="attachments" viewname="ObjectAttachment" name="collectionObjectAttachments" initialize="btn=true;icon=CollectionObjectAttachment"/>
			</row>
		</rows>
		<rows condition="yesNo3=FALSE">
			<row>
				<cell type="label" labelfor="1"/>
				<cell type="field" id="1" name="catalogNumber" uitype="formattedtext" readonly="false"/>
				<cell type="label" labelfor="yn3"/>
				<cell type="field" id="yn3" name="yesNo3" uitype="checkbox" initialize="editable=true"/>
				<cell type="label" labelfor="3"/>
				<cell type="field" id="3" name="accession" uitype="querycbx" initialize="name=AccessionCO;title=AccessionCO" searchbtn="false" addbtn="false" isrequired="false" colspan="4"/>
				<cell type="subview" id="7" name="collectionObjectCitations" viewname="CollectionObjectCitation" initialize="btn=true;icon=CollectionObjectCitation"/>
				<cell type="subview" id="attachments" viewname="ObjectAttachment" name="collectionObjectAttachments" initialize="btn=true;icon=CollectionObjectAttachment"/>
			</row>
                    </row>-->
	</rows>
</viewdef>
<viewdef name="Determination" class="edu.ku.brc.specify.datamodel.Determination" type="form" gettable="edu.ku.brc.af.ui.forms.DataGetterForObj" settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
	<desc>Determination subform for Collection Object form.</desc>
	<enableRules/>
	<columnDef>400px,2px,160px,2px,160px,2px,165px,p:g</columnDef>
	<columnDef os="lnx">80px,2px,430px,5px,80px,2px,77px,5px,125px,2px,80px,2px,120px,2px,1px,0,p:g</columnDef>
	<columnDef os="mac">260px,2px,260px,2px,288px,2px,180px,p:g</columnDef>
	<columnDef os="exp">p:g,2px,p:g,2px,p:g,2px,p:g,p:g</columnDef>
	<rowDef auto="true" cell="p" sep="2px"/>
	<rows>
		<row>
			<cell type="label" labelfor="13"/>
			<cell type="field" id="13" name="preferredTaxon" uitype="text" readonly="true"/>
			<cell type="field" id="yn5" name="preferredtaxon.yesNo5" uitype="checkbox" readonly="true"/>
			<cell type="label" labelfor="es"/>
			<cell type="field" id="es" name="preferredtaxon.esaStatus" uitype="combobox" readonly="true"/>
			<cell type="label" labelfor="cs"/>
			<cell type="field" id="cs" name="preferredtaxon.citesStatus" uitype="combobox" readonly="true"/>
		</row>
		<row>
			<cell type="label" labelfor="1"/>
			<cell type="field" id="1" name="taxon" uitype="querycbx" initialize="name=Taxon; newbtn=false; searchbtn=false"/>
			<cell type="field" id="3" name="isCurrent" uitype="checkbox" default="true"/>
			<cell type="label" labelfor="8"/>
			<cell type="field" id="8" name="qualifier" uitype="combobox"/>
			<cell type="label" labelfor="6"/>
			<cell type="field" id="6" name="typeStatusName" uitype="combobox" picklist="Type Status"/>
		</row>
		<row>
			<cell type="label" labelfor="verbdetermination"/>
			<cell type="field" id="verbdetermination" name="text7" uitype="text" colspan="1"/>
		</row>
		<row>
			<cell type="label" labelfor="5"/>
			<cell type="field" id="5" name="determiner" uitype="querycbx" initialize="name=Agent;newbtn=false; searchbtn=false"/>
			<cell type="blank"/>
			<cell type="label" labelfor="7"/>
			<cell type="field" id="7" uitype="plugin" name="this" initialize="name=PartialDateUI;df=determinedDate;tp=determinedDatePrecision" uifieldformatter="Date" colspan="5"/>
		</row>
		<!-- 		<row>
     <cell type="label" labelfor="t2"/>
			<cell type="field" id="t2" name="text2" uitype="text"/>
    
			<cell type="label" labelfor="family"/>
			<cell type="field" id="family" name="text3" uitype="text"/>
			<cell type="label" labelfor="genus"/>
			<cell type="field" id="genus" name="text4" uitype="text"/>
			<cell type="label" labelfor="species"/>
			<cell type="field" id="species" name="text5" uitype="text"/>
			<cell type="label" labelfor="subspecies"/>
			<cell type="field" id="subspecies" name="text6" uitype="text" colspan=""/>
		</row> -->
	</rows>
</viewdef>

Hi @nfshoobs

I can replicate, and it does in fact seem to be the automatic creation of the determination that is causing it. Without CO_CREATE_DET_4=true being set, the iscurrent is set to yes as expected.

Interestingly, if you add a second determination (which will get the isCurrent set as you mention) then remove it, you won’t be able to save because isCurrent is required for Determination. However, it will let you save without isCurrent otherwise.

Something is likely off with the business logic

Thanks for testing!
It is worth noting that we have had CO_CREATE_DET_4=true since before the recent update to 7.10.2.3, so it seems likely that something in the update causes this bug.

Hi @nfshoobs,

I can confirm this behavior on my end and I’ve written up the issue on GitHub to be solved in an upcoming release:

You are both correct– the CO_CREATE_DET_X is automatically adding a determination, but it is not setting the isCurrent checkbox to be true by default. I am awaiting a response from the developers. Thank you for reaching out!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.