Skip to Content

Problems on Rollback transaction

Hi all.

When I use start transaction and end transaction with SAPbobsCOM.BoWfTransOpt.wf_RollBack, its unable get user fields from UserTable. for example:

oCompany.StartTransaction();
oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack);
/////////////
SAPbobsCOM.UserTable oUserTable = null;
oUserTable = oCompany.UserTables.Item(TableName);
oUserTable.GetByKey(KeyValue);

after this, every user field (oUserTable.UserFields.Fields.Item(FieldName).Value) is empty

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jun 13, 2017 at 12:08 PM

    i have checked, and there is a same problem in my code

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 13, 2017 at 11:27 AM
    -2

    Hi Giorgi,

    Do you have certain that your KeyValue exists in your database?

    When you use GetByKey, you need validate if the method found the register with an if clause. Like this:

    if (oUserTable.GetByKey(KeyValue))
    {
    //Do your logic.
    }

    Hope it helps.

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded

    • The problem is that oUserTable.GetByKey(KeyValue) STOPS WORKING AFTER

      oCompany.StartTransaction();

      oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack);/////////////

      It begins to return empty values. The parameter is the same, the record is still in the database, but

      oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack);///////////// <-- this fragment causes .Getbykey() function return empty values

  • Jun 13, 2017 at 11:11 AM

    Hi Giorgi Abulashvili,

    Could you please help to provide the exact code that you are using at the moment?

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded