Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9052

Re: Posting Multiple Documents

$
0
0

Hi,

 

Try below sample code, I didn't check the syntax of the code

 

try {

     if(!oCompany.inTransaction)

          oCompany.StartTransaction();

 

     retVal_1 = SO.Add(); // Before try set all field for SO

     retVal_2 = PO.Add(); // Before try set all field for PO

     retVal_3 = GRPO.Add(); // Before try set all field for GRPO

     retVal_4 = DR.Add(); // Before try set all field for DR

 

 

     if(reVal_1 <> 0 OR reVal_2 <> 0 OR reVal_3 <> 0 OR reVal_4 <> 0 )

          throw new Exception(last error message);

     ELSE

          oCompany.EndTransaction(commit);

 

} catch(exception e) {

     if(oCompany.InTransaction)

          oCompany.EndTransaction(rollback);

}

 

Regards

Vibin Varghese


Viewing all articles
Browse latest Browse all 9052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>