v9.1p_2014-03-11/Pro Deployment (built 2014-03-11)
I have a form with a MultiFileItem and it works fine when I'm editing an existing master record, but not when I'm creating a new master record. When I call form.saveData() on a new record it creates an add operation on the form DS and then a fetch operation on the MultiFileItem DS.
The master record id is being returned in the add operation response.
In the docs it says the following, but I don't understand what the last part (bolded) means...:
"If the master record is being newly created, files are not actually uploaded until after the master record is confirmed saved,and the list of fields shown in the main form reflects files which will be uploaded after the master record is saved. "
MultiFileItem DS:
Form DS:
MultiFileItem:
Do I need to do anything special for this to work?
Like I said it works fine for existing master records.
Let me know if you need any more information.
/Tilds
I have a form with a MultiFileItem and it works fine when I'm editing an existing master record, but not when I'm creating a new master record. When I call form.saveData() on a new record it creates an add operation on the form DS and then a fetch operation on the MultiFileItem DS.
The master record id is being returned in the add operation response.
In the docs it says the following, but I don't understand what the last part (bolded) means...:
"If the master record is being newly created, files are not actually uploaded until after the master record is confirmed saved,and the list of fields shown in the main form reflects files which will be uploaded after the master record is saved. "
MultiFileItem DS:
Code:
<DataSource ID="scrum_backlog_userStoryFiles" serverConstructor="it.forecast.server.servlets.scrum.userStories.UserStoryFilesServlet"> <fields> <field name="fileId" type="sequence" primaryKey="true" hidden="true"/> <field name="masterRecordId" type="number" foreignKey="scrum_backlog_userStoryDetails.id" hidden="true"/> <field name="file" type="binary" title="File"/> <field name="user" type="text" title="User" hidden="true"/> </fields> </DataSource>
Code:
<DataSource ID="scrum_backlog_userStoryDetails" serverConstructor="it.forecast.server.servlets.scrum.userStories.UserStoryDetailsServlet"> <fields> <field name="id" type="sequence" hidden="true" primaryKey="true" /> <field name="userStoryType" type="integer" title="Type" required="true" /> <field name="userStoryId" type="text" title="Id" /> <field name="title" type="text" title="Title" length="255" required="true" /> <field name="role" type="text" title="As a" length="255" required="false" /> <field name="goal" type="text" title="I want" length="1000" required="false" /> <field name="benefit" type="text" title="so that" length="1000" required="false" /> <field name="acceptanceCriteria" type="text" title="Acceptance Criteria" length="3000" required="false" /> <field name="owners" type="enum" title="Owners" required="true" /> <field name="timeLeft" type="integer" title="Time Left" /> <field name="minutesWorked" type="text" title="Time Registered" /> <field name="minutesWorkedString" type="text" title="Time Registered" /> <field name="estimate" type="integer" title="Estimated Points" length="9" /> <field name="taskEstimate" type="integer" title="Task Estimate" /> <field name="sprint" type="integer" title="Sprint" /> <field name="epic" type="text" title="Epic" length="255" /> <field name="completionDate" type="date" title="Completion Date" dateFormatter="toEuropeanShortDate" /> <field name="linkedEstimate" type="integer" title="Linked Estimate" /> </fields> </DataSource>
Code:
MultiFileItem files = new MultiFileItem("files", "File Attachments"); files.setWidth(fieldWidth); files.setAttribute("dataSource", "scrum_backlog_userStoryFiles"); files.setTitleOrientation(TitleOrientation.TOP); files.setIconVAlign(VerticalAlignment.TOP); files.setColSpan(4);
Like I said it works fine for existing master records.
Let me know if you need any more information.
/Tilds
Comment