cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple users posting to Invoice

Former Member
0 Kudos

Dear Experts,

I have an AddOn made in .net 2005 wich creates multiple invoices per user, in this company there are multiple users trying to create invoices through this AddOn. Here are my questions...

a. Would It be helpful if i use oCompany.InTransaction so that the "Posting to Invoice" process will be FIFO for scenarios that multiple users posts their invoices at the same time.

b. Will it work on MS SQL 2005 ?

c. Would you like me to post my code for clarifications?

Best Regards,

Frabulous

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

You can use the transaction object. You should know, that the huge global transaction is "blocking' the system.

During the transaction, if your objects have any errors, the transaction is automatically rolled back.

Usage:

Try
            If oCompany.InTransaction Then
                MsgBox("Cannot start transaction, becuase the previous transaction has not been finished!")
            End If

            oCompany.StartTransaction()
            ' Do your transaction here
            '
            ' Commit the transaction
            oCompany.EndTransaction(BoWfTransOpt.wf_Commit)

        Catch ex As Exception
            If oCompany.InTransaction Then oCompany.EndTransaction(BoWfTransOpt.wf_RollBack)
        Finally
            GC.Collect()
        End Try

Regards,

J

Former Member
0 Kudos

Hi,

Whether you use StartTransaction/EndTransaction or not depends on what way invoices are created.

Do the invoices belong to each other, you can use transactions - in case one add fail, the other invoices are rolled back.

If this is not the case, each Add is a transaction by its own, you dont really need to use transactions.