-
Test Database.query
We have our managed package and we need to install in another org. And there are many custom fields which already exist there. So we cannot create the custom field in our org because it will cause the duplicate issue. So how should i write the test method to cover the dynamic query custom fields?
I am using dynamic query to query records like
List<Account> accList = Database.query('select Name,customfield__C from Account');
as customfield__C is not present in my org it's value getting retrieved dynamically , so how to give customfield__C value in my test class.
Log In to reply.
Popular Salesforce Blogs

Basics of Salesforce Admin and App Builder Certifications
A Salesforce Admin Certification is the most elevated type of acknowledgement a Salesforce Administrator can accomplish; it shows aptitude in the field just as a…

Salesforce Serverless PayPal Integration in 2024
Integrating payments into your Salesforce solution typically involves setting up both a client-side environment configured with a payment SDK and a server-side component equipped with…
Popular Salesforce Videos
How To Become A Salesforce Admin?
Wondering how t become a Salesforce Admin. Watch out for this tutorial video, it will answer all your questions. Join this useful group for Salesforce…
How to Become a Salesforce Consultant at Any Age
Companies are in great demand of skilled Salesforce consultants as a means to achieve their Salesforce objectives for better output in their business. With the…
Salesforce Lightning Tutorial - How to Delete Records from Server
In this particular video you'll learn how to delete records from custom Salesforce Lightning Component using Apex Controller Method.