You need to sign in to do that
Don't have an account?
Error: Compile Error: Invalid type
Hi, I'm absolute beginner and I'm trying to get familiar with salesforce triggers. I got main idea - what it's all about but I'm stuck with part of code:
CC_Variables__c variables = CC_Variables__c.getInstance('EloquaMarketingId');
I keep getting error: Error: Compile Error: Invalid type: CC_Variables__c at line 9 column 5
I have already checked many forums and tried to solve it as follows: "You need to use the API name of the object and not the label. Hence the error. To find the API name of the object go to:
Setup > create> objects> myObject > API name."
But there is not such an object is this the problem? Thank you very much.
Looking at the API name of the custom setting this is a part of one of the package. Please check the sandbox from where you are trying to migrate the changes and install the same package in your sandbox as well. In this way you will get all the components related to that package.
Let me know if you need any more help or information on this. For any immediate help you can reach out to me on:
Gmail: abhibansal2790@gmail.com
Skype: abhishek.bansal2790
Thanks,
Abhishek Bansal.
All Answers
I need to store the data to check whether it is empty. This is my next operation:
if(variables != null && variables.TextValue__c != null) {
EloquaMarketingId = variables.TextValue__c;
}
Its a custom setting and not custom object. You will find them under custom setting. You can perform DML operations on them.
https://help.salesforce.com/articleView?id=cs_about.htm&type=5 (https://help.salesforce.com/articleView?id=cs_about.htm&type=5)
If this answer helps you, please mark it as accepted.
Regards,
Tushar Sharma
https://newstechnologystuff.com/
Please use below code:-
If this solution is usefull for you, Please mark as a Best Answer to help others.
Regards
Mukesh
getInstance method is used for the custom settings. Can you please go to setup -> custom settings -> and make sure that you have any custom setting with the name Variables or not? If yes, than please copy the API name of that custom setting and use this in your code.
Thanks,
Abhishek Bansal.
Hi, Abhishek
I have nothing in here (see in the picture). So is this the problem? To be honest I'm trying to understand and make this code working as a part of exercise to get more into salesforce. So I guess I need to somehow define this custom setting right?
Thank you very much
Looking at the API name of the custom setting this is a part of one of the package. Please check the sandbox from where you are trying to migrate the changes and install the same package in your sandbox as well. In this way you will get all the components related to that package.
Let me know if you need any more help or information on this. For any immediate help you can reach out to me on:
Gmail: abhibansal2790@gmail.com
Skype: abhishek.bansal2790
Thanks,
Abhishek Bansal.