HI!
Help me, please, how to programmatically change the value of the field and save it by Save button?
This code works:
$doc.set("Field", $tempValue)
$doc.save()
But I don’t want to explicitly save the document at this moment, it should make the user save the page after form editing. Without $doc.save()
the value is not saved.
vmassol
February 18, 2019, 8:33am
2
AWM form;
The Software
field with Database List
type;
Custom display code:
{{velocity}}
##Show checkboxes, softID field and Submit button in edit mode:
#if($context.action == 'edit')
{{livetable id="hdwLookUpSoftware" classname="SoftwareInventory.Code.SoftwareInventoryClass" columns="softID,softType,softName,softVersion,softLicense"
selectedColumn="softID" defaultOrder="asc" tagCloud="false" extraParams=""/}}
{{addCheckboxColumnToLivetable livetable="hdwLookUpSoftware" column="softID" buttonId="sftCheckboxService" serviceDocument="ServiceDocument" /}}
{{html}}
<div class="buttonwrapper">
<a href="" id="sftCheckboxService" class="button">Save Linked Software</a>
</div>
{{/html}}
#set ($tempVar=$datetool.get('HH:mm:ss'))
$doc.set("hdwSoftware", $tempVar)
$doc.save()
##Hide checkboxes, softID field and Submit button
#else
{{livetable id="hdwLookUpSoftware" classname="SoftwareInventory.Code.SoftwareInventoryClass" columns="softType,softName,softVersion,softLicense"
selectedColumn="softType" defaultOrder="asc" tagCloud="false" extraParams=""/}}
#end
{{/velocity}}
In edit mode I set checkboxes in LiveTable manually;
Click the Save Linked Software
button;
On the ServiceDocument
page, I analyze the passed parameters using $request.getParameterValues ("cbData")
;
I transfer these parameters as a value to the Software
field in the AWM form;
When i click the Save
button, I hope that the data will be saved, but not.
Also I think that pp. 6, 7 can be optimized, but I do not know how
BTW:
In Sandbox document this script
{{velocity}}
$doc
{{/velocity}}
returns
Sandbox.Glossary
And all other docs have a Glossary
suffix.
Is it correct behavior?
Thanks.