• Sudheekar Reddy 6
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I am super new to Apex and consequently struggling through. I created an Apex class with the intent that I will trigger it with Process Builder. I built a test class for it and I'm getting the error "Method does not exist or incorrect signature: void updateCustomer(Id) from the type CustomerAccountingUpdate.

Here's my Apex Class:
public class CustomerAccountingUpdate {
        
    public static string updateCustomer(Account aAccount) {
    	aAccount.c2g__CODAAccountsReceivableControl__c = System.Label.GeneralLedgerAcctsRec;
        aAccount.c2g__CODASalesTaxStatus__c = 'Taxable';
        aAccount.c2g__CODATaxCode1__c = 'AvaTax';
        aAccount.c2g__CODADaysOffset1__c = 0;
        aAccount.c2g__CODADescription1__c = 'Due Upon Receipt';
       
        update aAccount;
        
        return 'success';
    }
}


And my test Class:
@isTest(SeeAllData=true)
public class CustomerAccountingUpdateTest {
	static private Account setUpTestEnvironment() {          
         Account a =  new Account(
                               Name = 'Test Accounting Test'
                               ,Type = 'Prospect'            				   
                           );
         insert a;
        return a;
    }
    static testMethod void AccountingUpdateTest() {
         Account a = setUpTestEnvironment();
   
         Test.startTest();
         
         CustomerAccountingUpdate.updateCustomer(a.id);
         
         Test.stopTest();
    }
}


Thanks so much - this is the first time I've written a class & test totally from scratch rather than modifying something that was already there so I have no idea where I'm going wrong.