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
James George 717James George 717 

Custom Object/fields Prepended with Developer Name, how to remove it

Hi All,
Please help me on this.
I have created a custom object called 'Purple__c' but, when I try to refer I had to use the Developer Name to access it, why I'm not able to access the object without the prefix/developer name in apex code.
This is happening only in the trailhead.

Sample code (this works but I do not want to put adminxyz__ as prefix):
trigger Purple on adminxyz__Purple__c (before insert) {
    for(adminxyz__Purple__c purple: Trigger.New){
        purple.adminxyz__IsHuman__c = true;
    }
    }

Thanks,
James George
ANUTEJANUTEJ (Salesforce Developers) 
Hi James,

For all the Certification and Trailhead Guidance please report it here,

https://trailhead.salesforce.com/en/help?support=home

https://trailhead.salesforce.com/help

So that our trailhead support engineers will look into it and get back to you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Regards,
Salesforce Support.
James George 717James George 717
Hi Antej,
I believe, there maybe some setting, which I may have messed up sometime back.
Looking forward for other answers.

Thanks
James
RituSharmaRituSharma
It seems that you enabled namespace in your org. Unfortunately as of now, once you enable, there is no way to change or disable the namespace. However, in apex you can access objects and fields without namespace i.e. both adminxyz__IsHuman__c and IsHuman__c are acceptable.

Vote for this idea: https://trailblazer.salesforce.com/ideaview?id=08730000000BqjiAAC

Kindly close your query by marking it as solved so that it can help others in the future.