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
vasu yadavvasu yadav 

Test class code for below trigger?


Could you please post the test class code for below mentioned trigger. I have tried but i am facing some issue.

public class SalesForceToProductViaTrigger {
    public static void SendCustomer(Id recordId){
        Account acc;
        string queryString='select Id,Name';
        Map<String,SObjectField> fmap=Schema.SObjectType.Account.fields.getMap();
        DescribeFieldResult f;
        for(SObjectField field:fmap.values()){
        queryString+=' from Account where id=\''+recordId+'\'';
    public static void updateIsUpdateToFalse(Id recordId){
        update new Account(id=recordId,DTCisUpdateFromWebService__c=false);

Thanks in advance

Sandeep WaliaSandeep Walia
Hi Vasu,

Does't inserting an Account record and passing it's id in the function parameter provides code coverage?
If no then can you please share your test class code?

Hope this helps,