Delete record from other collection

Hi,

please how can I do delete record from other collection?

I know how to update, insert or load other collection via UpdateCollectionRequestData and LoadCollectionRequestData. but I can't find any delete class here.

Thanks.

  • You can delete records using the UpdateCollectionRequestData class. You need to set the update action to delete.

  • Please do you have any working example of this delete?

    I am trying this code. I successfully found record, message "Record found" is appear. But Delete does not happened. I suppose that I have to do Save action on that collection? But I don't know syntax for that.

    Thanks.

    LoadCollectionRequestData colReq = new LoadCollectionRequestData();
    colReq.IDOName = "BCA_SYSD_2";
    colReq.PropertyList.Add("bankAccNum");
    colReq.Filter = "bankAccNum = '" + row.Properties["ownBankAccNum"].Value + "' and bu = '" + bu + "' and filename = '" + row.Properties["filename"].Value + "'";
    colReq.OrderBy = "";
    colReq.RecordCap = 200;
    LoadCollectionResponseData colResp = IDOClient.LoadCollection(colReq);
    if (colResp.Items.Count == 1)
    {
    Application.ShowMessage("Record found");
    UpdateCollectionRequestData req = new UpdateCollectionRequestData("BCA_SYSD_2");
    IDOUpdateItem itm = new IDOUpdateItem(UpdateAction.Delete);
    itm.ItemID = colResp.Items[0].ItemID;
    req.Items.Remove(itm);
    IDOClient.UpdateCollection(req);
    }

  • Hi, your code is almost correct, however instead of removing the IDOUpdateItem you need to add the IDOUpdateItem to the UpdateCollectionRequestData.

    So you code should be req.Items.Add(itm);