You need to sign in to do that
Don't have an account?
cherial
Error: Compile Error: Incorrect SObject type: AccountDetails__c should be Account at line 1 column 1
I have created a tab(Custom Object) whose details are:
Singular Label AccountDetails
Plural Label AccountDetails
Object Name AccountDetails
API Name AccountDetails__c
I created a class and defined a method addHelloWorld(AccountDetails__c[] accs) and it is saved successfully.
Then i defined a trigger:
trigger helloWorldAccountDetailsTrigger on AccountDetails__c (before insert) {
AccountDetails__c[] accs = Trigger.new;
MyHelloWorld.addHelloWorld(accs);
}
While saving the trigger getting an error: Error: Compile Error: Incorrect SObject type: AccountDetails__c should be Account at line 1 column 1
Please any one suggest me how to rectify this error.
Thanks in advance
cheers,
Nath
Singular Label AccountDetails
Plural Label AccountDetails
Object Name AccountDetails
API Name AccountDetails__c
I created a class and defined a method addHelloWorld(AccountDetails__c[] accs) and it is saved successfully.
Then i defined a trigger:
trigger helloWorldAccountDetailsTrigger on AccountDetails__c (before insert) {
AccountDetails__c[] accs = Trigger.new;
MyHelloWorld.addHelloWorld(accs);
}
While saving the trigger getting an error: Error: Compile Error: Incorrect SObject type: AccountDetails__c should be Account at line 1 column 1
Please any one suggest me how to rectify this error.
Thanks in advance
cheers,
Nath
Yes this method is static.
Clearly the complied and saved class is:
public class MyHelloWorld {
public static void addHelloWorld(AccountDetails__c[] accs){
for (AccountDetails__c a:accs){
if (a.Hello__c != 'World') {
a.Hello__c = 'World';
}
}
}
}
Might be class is not saving properly.
:smileyvery-happy:
Thanks
I am in a similar situation. How did you solve the error?