on 08-20-2010 9:29 PM
Hi all,
I try to delete an existing address in BP addresses. I used oBP.Addresses.AddressName.Remove(i)
but no success.
Any Idea?
Vangelis
Hi Vangelis,
Did you call the Update method of the BP after removing the address? It won't actually delete the address from the database until you update the main BP object.
Kind Regards,
Owen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vangelis,
I did a quick test and I think the issue is that you should be calling the Delete method of the Addresses object rather than the Remove method of the AddressName.
This works for me:
if(oBP.GetByKey(strUser_Id))
{
for(int i = oBP.Addresses.Count - 1; i >= 0; i--)
{
oBP.Addresses.SetCurrentLine(i);
oBP.Addresses.Delete();
}
if (oBP.Update() != 0)
{
_sboApp.SetStatusBarMessage("Error deleting addresses: " + _sboCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, true);
}
}
Kind Regards,
Owen
Edited by: Owen Slater on Aug 23, 2010 9:19 AM
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.