You need to sign in to do that
Don't have an account?
Mark Thomas 49
Add Account Owner in existing Apex Class
We have an existing Apex Class that syncs information between Salesforce and our ERP system. We would like to start pulling the Account Owner from Salesforce. I'm getting an error when adding Account Owner to this string in the existing APEX class,
this.SalesforceID = account.Id;
this.Name = account.Name;
this.PrimaryCountry = account.Primary_Country__c;
//this.EAGRelationshipID = EAGRelationshipID; //no related field in salesforce
this.UnicodeName = account.Account_Name_Unicode__c;
this.IndustrySectorID = account.Industry_Sector_ID__c;
this.ManufacturingTypeID =account.Manufacturing_Type_ID__c;
this.[Select Id, Name ,OwnerId from Account where id in : relatedAccountId]){
}
Any thoughts about how I might structure this?
this.SalesforceID = account.Id;
this.Name = account.Name;
this.PrimaryCountry = account.Primary_Country__c;
//this.EAGRelationshipID = EAGRelationshipID; //no related field in salesforce
this.UnicodeName = account.Account_Name_Unicode__c;
this.IndustrySectorID = account.Industry_Sector_ID__c;
this.ManufacturingTypeID =account.Manufacturing_Type_ID__c;
this.[Select Id, Name ,OwnerId from Account where id in : relatedAccountId]){
}
Any thoughts about how I might structure this?
Can you try using account.ownerId = 'ID' format instead?
Anudeep
Error: Compile Error: Missing ';' at '[' at line 481 column 18
I know the Owner field is handled differently because it is being pulled from the user object, but I'm not having any luck pulling it into this Apex Class