• Michael Chitayat
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi everyone,

 

Our Company is using financial force accounting system, and I just wrote a trigger on the sales invoice object. Now when I wrote a test class for it, I use the code below:

 

c2g__CodaInvoice__c salesinvoice = new c2g__CodaInvoice__c();
//set values for the invoice
c2g__Opportunity__c = opp.id;
c2g__Account__c = acc.id;// opp and acc are already defined
...
... insert salesinvoice;

 But when I run the test, I always get an error message "no current company". Does anybody know what causes this error and how to get rid of it? Thanks a lot!!