# Collecting trip attachment button

**URL:** <https://speciforum.org/t/collecting-trip-attachment-button/795>\
**Category:** Get Help\
**Created:** [October 4, 2022, 5:13pm UTC](https://speciforum.org/t/collecting-trip-attachment-button/795 "2022-10-04T17:13:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Plarson](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/plarson/32/797_2.png) [@Plarson](https://speciforum.org/u/Plarson)\
**Post date:** [October 4, 2022, 5:13pm UTC](https://speciforum.org/t/collecting-trip-attachment-button/795/1 "2022-10-04T17:13:25Z")

</div>

I am having trouble getting the collecting trip attachment button to appear on the collecting trip form in Specify7. I’ve put this in the view def on a new line but it doesn’t seem to work.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [October 4, 2022, 5:49pm UTC](https://speciforum.org/t/collecting-trip-attachment-button/795/2 "2022-10-04T17:49:58Z")

</div>

Hi @Plarson,

I have this button appearing properly using the following components in my form definition:

**Views:**  
_First, you must have an accompanying `<view>` for each `<viewdef>`_

```auto
        <view name="CollectingTripForm"
            class="edu.ku.brc.specify.datamodel.CollectingTrip"
            busrules="edu.ku.brc.specify.datamodel.busrules.CollectingTripBusRules"
            isinternal="false"
            resourelabels="false">
            <desc><![CDATA[CollectingTrip Form]]></desc>
            <altviews>
                <altview name="CollectingTripForm View" viewdef="CollectingTripForm" mode="view" default="true"/>
                <altview name="CollectingTripForm Edit" viewdef="CollectingTripForm" mode="edit"/>
            </altviews>
        </view>

        <view name="CollectingTrip"
            class="edu.ku.brc.specify.datamodel.CollectingTrip"
            busrules="edu.ku.brc.specify.datamodel.busrules.CollectingTripBusRules"
            resourelabels="false">
            <desc><![CDATA[CollectingTrip Form]]></desc>
            <altviews>
                <altview name="CollectingTrip View" viewdef="CollectingTrip" mode="view" default="true"/>
                <altview name="CollectingTrip Edit" viewdef="CollectingTrip" mode="edit"/>
            </altviews>
        </view>

```

**View definition:**

```auto
        <viewdef
            type="form"
            name="CollectingTripForm"
            class="edu.ku.brc.specify.datamodel.CollectingTrip"
            gettable="edu.ku.brc.af.ui.forms.DataGetterForObj"
            settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
            <desc><![CDATA[CollectingTrip Form]]></desc>

            <columnDef>100px,2px,211px,5px,120px,2px,130px,5px,120px,2px,130px,0px,15px,p:g</columnDef>
            <columnDef os="lnx">115px,2px,276px,5px,145px,2px,110px,5px,145px,2px,110px,0px,15px,p:g</columnDef>
            <columnDef os="mac">130px,2px,296px,5px,165px,2px,130px,5px,165px,2px,130px,0px,15px,p:g</columnDef>
            <columnDef os="exp">p,2px,p:g(2),5px:g,p,2px,p:g(2),5px:g,p,2px,p:g(2),0px,15px,p:g</columnDef>
            <rowDef auto="true" cell="p" sep="2px"/>
            <rows>
                <row>
                    <cell type="label" labelfor="1"/>
                    <cell type="field" id="1" name="text1" uitype="text"/>
                    <cell type="label" labelfor="7"/>
                    <cell type="field" id="7" name="text2" uitype="text"/>
                    <cell type="label" labelfor="2"/>
                    <cell type="field" id="2" name="number1" uitype="text"/>
                </row>
                <row>
                    <cell type="label" labelfor="5"/>
                    <cell type="field" id="5" name="remarks" uitype="textareabrief" colspan="10"/>
                </row>
								<row>
				<cell type="subview" id="attachments" viewname="ObjectAttachment" name="collectingTripAttachments" colspan="3" initialize="btn=true;icon=CollectingTripAttachment"/>
				</row>
                <row>
                    <cell type="subview" id="3" name="collectingEvents" viewname="CollectingEventSub" colspan="13"/>
                </row>

            </rows>
        </viewdef>

```

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/a/a0cec83fdb79d2d67b8cb520aba35c252ccbd825.jpeg)

If you are having any trouble after seeing this example, please share your view definition with us so that I can take a closer look!

Thank you!

Grant

---

<div class="post-metadata">

**Author:** ![Plarson](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/plarson/32/797_2.png) [@Plarson](https://speciforum.org/u/Plarson)\
**Post date:** [October 6, 2022, 3:05pm UTC](https://speciforum.org/t/collecting-trip-attachment-button/795/3 "2022-10-06T15:05:53Z")

</div>

Got it, thanks! The problem was that I only had one of the views.
