Hi All,
I have a repeating table consisting of two columns (contact name and contact type). I would like to be able to update and delete individual rows of this table. Therefore, I added two buttons per row for Save and Delete and use the below code to delete, for example. The problem is that AppContactID always receives value from the first row. so, whenever I delete second or third row, it always tries to delete first row. What am I doing wrong here?
function btnContactDelete::OnClick(eventObj)
{
if (XDocument.UI.Confirm("Are you sure?",4)==6)
{
var AppContactID = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:SQLComplexDB/d:AppContact/@AppContactID").text;
if(AppContactID != null)
{
XDocument.QueryAdapter.Command = "delete dbo.AppContact where AppContactID = " + AppContactID;
XDocument.Query();
RefreshItemQuery();
}
}
}
Thanks