This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jan 12, 2017, 8:22 PM
9 Posts

error with date when creating document

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 1

Hello,

 

I'm getting an error whenever I try to save a date to a document.

 

I have this a date field

                    <xp:td>
                        <xp:inputText id="dateFrom">
                            <xp:dateTimeHelper id="dateTimeHelper1"></xp:dateTimeHelper>
                            <xp:this.converter>
                                <xp:convertDateTime type="date"></xp:convertDateTime>
                            </xp:this.converter>
                        </xp:inputText>
                    </xp:td>

and this create button

 

<xp:button value="Create" id="button1">
                            <xp:eventHandler event="onclick" submit="true"
                                refreshMode="partial">
                                <xp:this.action><![CDATA[#{javascript:var newDoc = database.createDocument();
newDoc.appendItemValue("Form", "ProfCatLnk");
newDoc.appendItemValue("DateFrom", getComponent("dateFrom").getValue());
newDoc.save();

}]]></xp:this.action>
                            </xp:eventHandler>
                        </xp:button>

 

when I click on save, it get an error "problem submitting an area of the page"

 

Any idea why?

Jan 13, 2017, 2:19 PM
298 Posts
probably trying to save a text value to the date field
I suspect the getComponent("id").getValue() returns a string and you are trying to save that to a date field, which requires the data to be a NotesDateTime value.

You have to convert the data type.

Howard

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal