on 02-13-2017 11:38 AM - last edited on 02-03-2024 7:18 PM by postmig_api_4
If someone have working code sample, how to remove row from matrix and at once in MSSQL DB in one user moment, please public him in your answer.
Thank you !!!
Thanks for the help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My apologies, i forgot to specify that mentioned matrix is a part of a user form which is not regestered as UDO. I learned from description what GeneralService provides access only to UDOs. So how to remove row in matrix witch belongs Form(MyForm: UserFormBase) ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Евгений,
Depends what type is your data. But you need to call:
oMtx.DeleteRow(line);
and call the correct method to delete your register.
Suppose that your line represents a register from UDO, you can do something like this:
SAPbobsCOM.GeneralService oGeneralService = null;
SAPbobsCOM.GeneralData oGeneralData = null;
SAPbobsCOM.GeneralDataParams oGeneralParams = null;
try
{
oGeneralService = SBO_Company.GetCompanyService().GetGeneralService("your udo ucode");
oGeneralParams = oGeneralService.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralDataParams);
oGeneralParams.SetProperty("Code", code);
oGeneralService.Delete(oGeneralParams);
}
finally
{
this.ReleaseObject(oGeneralService);
this.ReleaseObject(oGeneralData);
}
Suppose that your line represents a register from an UDT, you can do something like this:
SAPbobsCOM.UserTable oUserTable = null;
try
{
oUserTable = GatiApplicationEx.Instance.SBO_Company.UserTables.Item(this.TableName());
//Verifies if exist in the table
if (oUserTable.GetByKey(this.Code.ToString()))
{
//if exists , remove it.
if (oUserTable.Remove() != 0)
{
sucess = false;
throw new Exception(SBO_Company.GetLastErrorDescription());
}
}
}
finally
{
this.ReleaseObject(oUserTable);
}
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
4 | |
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.