I added a Delete link in an xp:repeat to delete the document for the row, with "rowVar" the variable for the repeat to access thye document entries.
Here is the code for the Delete link in the repeat:
<xp:link escape="true" id="link2"
style="width:50.0px;display:inline-block" text="Delete">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="panelChemLog" immediate="true">
<xp:this.action><![CDATA[#{javascript:
var deleteUNID = rowVar.getUniversalID();
println(deleteUNID);
var doc:NotesDocument = database.getDocumentByUNID(deleteUNID);
println(doc.getCreated() );
doc.remove(true);
}]]></xp:this.action>
</xp:eventHandler>
</xp:link>
I included the println statements and I can see in my log that the deleteUNID and doc object is set, but the code throws this exception on the final doc.remove(true) statement:
Script interpreter error, line=5, col=5: [TypeError] Exception occurred calling method NotesDocument.remove(boolean) null
How do I code the Delete link to delete the document for the row in the repeat?