I'm trying to create a button to execute an Apex Class with the Javascript attached. I'm getting the syntax error: Field object.id does not exist. Check spelling. What am I missing? What is window.location.href= looking for?
Global class InvoiceAccounts_Button {
Webservice static void createInvoiceAccounts() {
// Create a list of InvoiceAccounts
List<InvoiceAccount__c> InvA_List = new List<InvoiceAccount__c> {
new InvoiceAccount__c(Name='Kim_Button',Account_Owner_Name__c='Shain',Account_Owner_Title__c='Sir')};
// Bulk insert all InvoiceAccount__cs with one DML call
insert InvA_List;
}
}