Notifications
Clear all
Sep 14, 2021 3:50 am
How to create a fake dummy id in salesforce for testing, so you don't need to hard code?
1 Reply
Sep 14, 2021 3:53 am
If you need to create a properly formed Id and doesn't care about it actually being in the database for your apex test classes, you can create it as:
Id dummyId = SObjectType.My_Object__c.getKeyPrefix().rightPad(15, 0)