You need to sign in to do that
Don't have an account?
Namrata Heggadal
Adding Namespace to the code
While moving code from developer org to packaging org using ANT in few places of the apex code we need to prefix the packaging namespace. Is there any way to automate this process?
For instance:
RecordType Test = [ SELECT Id, Name FROM RecordType WHERE SobjectType = 'abc__books__c' AND DeveloperName = 'bookreview' ];
In the above code abc is the namespace which is added manually.
For instance:
RecordType Test = [ SELECT Id, Name FROM RecordType WHERE SobjectType = 'abc__books__c' AND DeveloperName = 'bookreview' ];
In the above code abc is the namespace which is added manually.
First and foremost sincerely regret delayed reply.
For this you need to create a common class where you declare the namespace as private variable like this: Then you use this variable wherever you need this prefix like in your case: Hope this helps.
Regards,
Nagendra.P