function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rohit Gajbhiye 7Rohit Gajbhiye 7 

Invalid data type pen__c is object name not a field name

Every thing is right I do know where I'm doing wrong please help me I'm  beginner level studentpen__c is object api  name not a field api name 
Best Answer chosen by Rohit Gajbhiye 7
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Rohit,

If the object API name is parker_pen__c then you should be using the same. Dont use Pen__c . Replace the code where you have Pen__c with parker_pen__c and try to save the class and let me know what error you are facing then.

Even for the Price field just place entire API name .


If this solution helps, please mark it as best answer.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Rohit,

Did you check if the API names of thr object and field are correct?

Thanks,
 
Rohit Gajbhiye 7Rohit Gajbhiye 7
Sai praveen sir object api name was parker_pen__c I used pen__c and also parker_pen__c but still it's show invalid data type and I chek field api name they are correct tell me the best solution 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Rohit,

If the object API name is parker_pen__c then you should be using the same. Dont use Pen__c . Replace the code where you have Pen__c with parker_pen__c and try to save the class and let me know what error you are facing then.

Even for the Price field just place entire API name .


If this solution helps, please mark it as best answer.

Thanks,
 
This was selected as the best answer
mukesh guptamukesh gupta
Hi Rohit,

I think your Object API name is :- parker_pen__c 

Use parker_pen__c  instead of pen__c in your class, Even after that you face error the please share your object details screen


if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 
Rohit Gajbhiye 7Rohit Gajbhiye 7
Thank you mukesh gupta  and  sai praveen for this support actually I tried both api name but it didn't work that time now it's working the object name is parker_pen__c but my sir told me neglect  parker_ only write pen__c so write that I get error and I also write parker_pen__c I get error but today it get save successfully thank you so much 
Rohit Gajbhiye 7Rohit Gajbhiye 7
I want to ask that I create LWC and connect to the org all steps done but I forget to add code then I go and edit some code after that I'm not able to se deploy option than I go to salesforce org and delete component and try to connect sfdx: authorize org and also deploy but I'm not able to see that