• Ankit Singh 6
  • NEWBIE
  • 80 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 36
    Questions
  • 30
    Replies
Hi All

We have setup outbound messages in Salesforce, and at our web application which is develped in ROR we have provided URL to receive those push data.

Currently, at ROR we are responding back with HTTP status 200 and no response data, Assuming that salesforce do not want any information as a response from these push data apart from HTTP status 200.

But, as there is limitation on outbound messages, they need response in below format : 

 
<element name="notificationsResponse">
    <complexType>
        <sequence>
            <element name="Ack" type="xsd:boolean" />
        </sequence>
    </complexType>
</element>

Please let us know if we need to farmat our response in above format. If yes please let us know to da that
Hi All

We are using below api call to fetch reports from salesforce :
https://cs15.salesforce.com/services/data/v29.0/analytics/reports/00Oe0000000GwME?export=1&enc=UTF-8&xf=CSV&includeDetails=true

The above api call was fetching all the records from reports even if it was more than 2000. But currently from last few days the api call only fetching 2000 records(max) from salesforce even the report contains more than 2000 records

Please let us know the reason for this, also if possible please try the above api call to check for data.
We already have a windows service running on a server which communicates with our telephony system. Now we want to send an API call to that service when a phone number is clicked. Is there a way to implement this. 
To be very precise I am looking to provide a clickable icon next to phone number field of Leads and Contacts, in Salesforce. After clicking on this I want to fire an API call to initiate the calling. 

Regards
Ankit
HI All

We have added a button on lead list view page. We select multiple leads from the list and clicks that button. On click of the button we are hitting an api call which shows lead details(with some extra information) on a custom widget in home page one by one.
Now we want to open lead details page for each lead which comes in the widget after api call in place of lead list view..Also we do not want to load the full page instead just the list view section

Please let me know any workaround to achieve this.
 
Hi All

We have currently added a custom component on Home page. Similarly we need to create custom component (or if not a custom button) on Report page layout. But currently we are unable to do that.

Please let us know a way to do that.

Regards
Ankit
Hi All

We are trying to fetch contacts along with their activities.
Is there a way to fetch it in one api call (or using single soql query)? We know the way to fetch in two api calls (ie first fetch contact and then fetch activity based on whoid). I need  some way to join both objects.

Please help me out with this.

Regards
Ankit

Hi,
I'm new to Salesforce & I'm having a business requirement where I need to create a new app in Salesforce AppExchange. I wish to create an app where I need to provide the functionality of calling to the leads/contacts present in Salesforce. The design for my app would be as follows:
An app will be provided in Salesforce app exchange, on installing the app into my account a button will appear in Salesforce ListView named 'Click To Call'. Once the user clicks on this button then calling will trigger on the selected contacts one by one. At the click of this button, a calling pop-up will appear on screen(due to the app installed in the Salesforce account). Once the pop-up arrives before the user, he interacts with the person who has been called and disposes the contacts after selecting appropriate fields from the call pop-up. On call dispose, an API will hit my server for syncing the data relative to calling on that contact. 
I have already developed all the APIs for calling & syncing on my server, now I need an app to do the same from Salesforce side.

Thus for building this app I'm in need of writing some server side code which could hit the API's of 'phone calling functionality' which are already present on my server. Also, I need to write the HTML & Jquery code for designing the call pop-up within my app.

Can you please suggest me the resources which I shall consider for building such an app & host it on app exchange or just guide me how on Salesforce side can I begin with its development.

1. I need to create a similar section like lead history in lead/contact details page. In case of lead history salesforce records the state changes of the lead/contact object. I need to create the records in cutsom section which will be recorded  from a third party API Call. Can you helpme in creating the Custom section like lead history or suggest me the best way to create the section .
I am using this curl request (curl https://test.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=xxxxxxxxxxxx" -d "client_secret=xxxxxxxxxxx" -d "username=xxxxxxxxx" -d "password=xxxxxxxxx" ) . Using this curl request i am getting access token but no refresh token. How to get refresh token using curl request?
Hi All

We are trying to fetch reports data from salesforce using REST api call. We are using below api call :
https://cs15.salesforce.com/services/data/v29.0/analytics/reports/00O40000003XxXCEA0?export=1&enc=UTF-8&xf=CSV&data=2&includeDetails=true

The above call works for some of our client but not for others. On fetching data users are facing below error :
Salesforce Reponse: [{"message":"An unexpected error occurred. Please include this ErrorId if you contact support: 1950640632-71631 (-1474772396)","errorCode":"UNKNOWN_EXCEPTION"}]

Please let me know resolution for this as it is creating problem for many users.

Regards
Ankit
Hi All

We are trying to fetch salesforce report records using REST API call, but we are able to fetch only 2000 records.(Even we have 6000+ records in report)
Please suggest a workaround to fetch all the records from report using rest.

Thanks
Ankit
Hi All

We are creating a follow up task from our webapp using SOAP api call in C#. Now we want to set Reminder Set(IsReminderSet) field value while creating the task
We are using below code. We are able to create follow up task with all other fields but unable to set Reminder Set field which is of type boolean.

var doc = new XmlDocument();
var fields = new List<XmlElement>();
var task = new sObject { type = "Task" };
bool reminder = true;
XmlElement taskReminder = doc.CreateElement("IsReminderSet");
 taskReminder.InnerText = reminder.ToString();
fields.Add(taskReminder);
task.Any = fields.ToArray();
var result = _sf.create(new[] { task });
success = result[0].success;

Please let me know what I am doing wrong.

Regards
Ankit
Hi All

We have integrated salesforce using SOAP in C#. We are trying to send mail using salesforce templates through the code. But we are unable to provide fromAddress in the mail. Below is the code for the same : 

SingleEmailMessage message = new SingleEmailMessage();
                message.emailPriority = EmailPriority.High;
                message.saveAsActivity = false;
                message.useSignature = true;
                message.templateId = templateId;
                message.targetObjectId = CrmId;
                SingleEmailMessage[] messages = { message };
                SendEmailResult[] results = _sf.sendEmail(messages);

Please let us know a way to add fromAddress while sending mail as we are unable to find any option for that.

Regards
​Ankit
Hi All

We have integrated salesforce api using WSDL in C#. We are trying to send email through our code using salesforce template.
We are unable to provide fromAddress as we are not finding any option for that. Please check the below code : 

SingleEmailMessage message = new SingleEmailMessage();
                message.emailPriority = EmailPriority.High;
                message.saveAsActivity = false;
                message.useSignature = true;
                message.templateId = templateId;
                message.targetObjectId = CrmId;
                SingleEmailMessage[] messages = { message };
                SendEmailResult[] results = _sf.sendEmail(messages);

Please let me know a wayto provide fromAddress for sending mails.

Regards
Ankit
Hi All

We have a managed package and we need to update picklist values of a field. But after changing the values when we are upgrading the managed package to a beta version, we are not able to see updated values. We still see same old values.

Please let me know how to get new values to the upgraded version of package.

Regards
Ankit
Hi All

Below is the code for my trigger and test class but the code coverage showing 0 for me. Please let me know where I am going wrong

Trigger


trigger stageChangetest on Opportunity (before update) {
    List<string> accountNames = new List<string>();
    for (Opportunity o : trigger.new) {
        if(trigger.isupdate && o.Stagename == '7. Closed/Won'){
         accountNames.add(o.AccountId);
        }
    }
    AggregateResult[] results = [select Account.Id, MAX(cas_LastConnect__c) from Contact where Account.Id in :accountNames and cas_LastConnect__c != null group by Account.Id ];
    Map<String, Datetime> account_connectDate = new Map<String, Datetime>();
    for(AggregateResult ar : results){
        account_connectDate.put(String.valueof( ar.get('Id')), Datetime.valueof( ar.get('expr0')));
    }
    
    Datetime today = Date.today().addMonths(-6);
    List<Opportunity> opportunities = new List<Opportunity>();
    for (Opportunity o : trigger.new) {
        if(trigger.isupdate && o.Stagename == '7. Closed/Won' && account_connectDate.containsKey(o.AccountId)){
            Datetime lastConnectDate = account_connectDate.get(o.AccountId);
            system.debug(logginglevel.info,today);
            system.debug(logginglevel.info,lastConnectDate);
            if(lastConnectDate > today){
                o.ConnectAndSell_bookings_contribution__c = o.Amount;
            }
        }
    }
}

Test Class


@isTest(seeAllData=false)
private class cas_ClosedAmountTest {
    /** Test with an existing opportunity **/
    static testMethod void testWithExistingContact() {
    //init();
    Test.startTest();
    Account acc = new Account();
    acc.Name = 'test account';
    acc.Phone = '123214';
    acc.Type = 'Customer';   
    
    insert acc;
    //Account acc = [select Account.Id from Account where Name='Kuliza'];    
    Opportunity opp = new Opportunity( Name = 'test opportunity',
                              AccountId = acc.Id,
                              StageName = 'Negotiations',
                              CloseDate = System.today(),
                              Type = 'New Business - Add',
                              Amount = 5558);
    insert opp;
    opp.StageName = '7. Closed/Won';
    update opp;
    
    AggregateResult[] results = [select MAX(cas_LastConnect__c) from Contact where Account.Id = :acc.Id and cas_LastConnect__c != null ];
    Map<String, Datetime> account_connectDate = new Map<String, Datetime>();
    for(AggregateResult ar : results){
        account_connectDate.put(String.valueof( ar.get('Id')), Datetime.valueof( ar.get('expr0')));
    }
        Datetime today = Date.today().addMonths(-6);
        Double casContribution = null;
        if(account_connectDate.containsKey(opp.AccountId)){
            Datetime lastConnectDate = account_connectDate.get(opp.AccountId);
            if(lastConnectDate > today){
                casContribution = opp.Amount;
            }
        }
    // Verification
    System.assertEquals(opp.ConnectAndSell_bookings_contribution__c, casContribution);
    Test.stopTest();
    }
}
 
Hi All

We have a webapp which provides calling feature to users(for their contacts) using aestrisk service.
Now we want to implement same feature to Salesforce, ie we want to provide a functionality in salesforce so that user can directly call from salesforce to their contact/lead (present in reports) using same aestrisk service.

Please guide me how proceed for this.

Regards
Ankit
I have added a trigger on opportunity, which on processing data updates the value in a custom field. Trigger runs asynchronously and the field updatation is taking time. My assumption is that, on clicking save button in opportunity, it fires a trigger and side by side saves the data. As trigger is taking some time for processing, the data gets saved first and refreshes the page. The trigger changes are not yet saved and hence not reflected. If i refresh the page after some time, then the trigger changes are also reflected correctly. Can you please provide me a solution for this scenario?
Hi

I have created a button for lead/contact  which on click redirects to my webapp (other than salesforce). I need to authenticate the salesforce user  in my webapp. 

Could anyone please tell me how to authenticate sf user. Is there any way to generate some token?
Hi,
I am adding a trigger to update a field in opportunities. For the same, few fields of opprortunity will be passed to a third party API which will return some data and after processing the data, corresponding field in opportunity willl be updated. I have added the trigger and class but i'm not sure how to make a API call from trigger.
Hi All

We have a managed package and we need to update picklist values of a field. But after changing the values when we are upgrading the managed package to a beta version, we are not able to see updated values. We still see same old values.

Please let me know how to get new values to the upgraded version of package.

Regards
Ankit
Hi All

We are using below api call to fetch reports from salesforce :
https://cs15.salesforce.com/services/data/v29.0/analytics/reports/00Oe0000000GwME?export=1&enc=UTF-8&xf=CSV&includeDetails=true

The above api call was fetching all the records from reports even if it was more than 2000. But currently from last few days the api call only fetching 2000 records(max) from salesforce even the report contains more than 2000 records

Please let us know the reason for this, also if possible please try the above api call to check for data.
Hi All

We are trying to fetch contacts along with their activities.
Is there a way to fetch it in one api call (or using single soql query)? We know the way to fetch in two api calls (ie first fetch contact and then fetch activity based on whoid). I need  some way to join both objects.

Please help me out with this.

Regards
Ankit
Hi All

We are trying to fetch reports data from salesforce using REST api call. We are using below api call :
https://cs15.salesforce.com/services/data/v29.0/analytics/reports/00O40000003XxXCEA0?export=1&enc=UTF-8&xf=CSV&data=2&includeDetails=true

The above call works for some of our client but not for others. On fetching data users are facing below error :
Salesforce Reponse: [{"message":"An unexpected error occurred. Please include this ErrorId if you contact support: 1950640632-71631 (-1474772396)","errorCode":"UNKNOWN_EXCEPTION"}]

Please let me know resolution for this as it is creating problem for many users.

Regards
Ankit
Hi All

We are trying to fetch salesforce report records using REST API call, but we are able to fetch only 2000 records.(Even we have 6000+ records in report)
Please suggest a workaround to fetch all the records from report using rest.

Thanks
Ankit
Hi All

We are creating a follow up task from our webapp using SOAP api call in C#. Now we want to set Reminder Set(IsReminderSet) field value while creating the task
We are using below code. We are able to create follow up task with all other fields but unable to set Reminder Set field which is of type boolean.

var doc = new XmlDocument();
var fields = new List<XmlElement>();
var task = new sObject { type = "Task" };
bool reminder = true;
XmlElement taskReminder = doc.CreateElement("IsReminderSet");
 taskReminder.InnerText = reminder.ToString();
fields.Add(taskReminder);
task.Any = fields.ToArray();
var result = _sf.create(new[] { task });
success = result[0].success;

Please let me know what I am doing wrong.

Regards
Ankit
Hi All

We have integrated salesforce using SOAP in C#. We are trying to send mail using salesforce templates through the code. But we are unable to provide fromAddress in the mail. Below is the code for the same : 

SingleEmailMessage message = new SingleEmailMessage();
                message.emailPriority = EmailPriority.High;
                message.saveAsActivity = false;
                message.useSignature = true;
                message.templateId = templateId;
                message.targetObjectId = CrmId;
                SingleEmailMessage[] messages = { message };
                SendEmailResult[] results = _sf.sendEmail(messages);

Please let us know a way to add fromAddress while sending mail as we are unable to find any option for that.

Regards
​Ankit
Hi All

Below is the code for my trigger and test class but the code coverage showing 0 for me. Please let me know where I am going wrong

Trigger


trigger stageChangetest on Opportunity (before update) {
    List<string> accountNames = new List<string>();
    for (Opportunity o : trigger.new) {
        if(trigger.isupdate && o.Stagename == '7. Closed/Won'){
         accountNames.add(o.AccountId);
        }
    }
    AggregateResult[] results = [select Account.Id, MAX(cas_LastConnect__c) from Contact where Account.Id in :accountNames and cas_LastConnect__c != null group by Account.Id ];
    Map<String, Datetime> account_connectDate = new Map<String, Datetime>();
    for(AggregateResult ar : results){
        account_connectDate.put(String.valueof( ar.get('Id')), Datetime.valueof( ar.get('expr0')));
    }
    
    Datetime today = Date.today().addMonths(-6);
    List<Opportunity> opportunities = new List<Opportunity>();
    for (Opportunity o : trigger.new) {
        if(trigger.isupdate && o.Stagename == '7. Closed/Won' && account_connectDate.containsKey(o.AccountId)){
            Datetime lastConnectDate = account_connectDate.get(o.AccountId);
            system.debug(logginglevel.info,today);
            system.debug(logginglevel.info,lastConnectDate);
            if(lastConnectDate > today){
                o.ConnectAndSell_bookings_contribution__c = o.Amount;
            }
        }
    }
}

Test Class


@isTest(seeAllData=false)
private class cas_ClosedAmountTest {
    /** Test with an existing opportunity **/
    static testMethod void testWithExistingContact() {
    //init();
    Test.startTest();
    Account acc = new Account();
    acc.Name = 'test account';
    acc.Phone = '123214';
    acc.Type = 'Customer';   
    
    insert acc;
    //Account acc = [select Account.Id from Account where Name='Kuliza'];    
    Opportunity opp = new Opportunity( Name = 'test opportunity',
                              AccountId = acc.Id,
                              StageName = 'Negotiations',
                              CloseDate = System.today(),
                              Type = 'New Business - Add',
                              Amount = 5558);
    insert opp;
    opp.StageName = '7. Closed/Won';
    update opp;
    
    AggregateResult[] results = [select MAX(cas_LastConnect__c) from Contact where Account.Id = :acc.Id and cas_LastConnect__c != null ];
    Map<String, Datetime> account_connectDate = new Map<String, Datetime>();
    for(AggregateResult ar : results){
        account_connectDate.put(String.valueof( ar.get('Id')), Datetime.valueof( ar.get('expr0')));
    }
        Datetime today = Date.today().addMonths(-6);
        Double casContribution = null;
        if(account_connectDate.containsKey(opp.AccountId)){
            Datetime lastConnectDate = account_connectDate.get(opp.AccountId);
            if(lastConnectDate > today){
                casContribution = opp.Amount;
            }
        }
    // Verification
    System.assertEquals(opp.ConnectAndSell_bookings_contribution__c, casContribution);
    Test.stopTest();
    }
}
 
Hi All

We have a webapp which provides calling feature to users(for their contacts) using aestrisk service.
Now we want to implement same feature to Salesforce, ie we want to provide a functionality in salesforce so that user can directly call from salesforce to their contact/lead (present in reports) using same aestrisk service.

Please guide me how proceed for this.

Regards
Ankit
Hi,
I am adding a trigger to update a field in opportunities. For the same, few fields of opprortunity will be passed to a third party API which will return some data and after processing the data, corresponding field in opportunity willl be updated. I have added the trigger and class but i'm not sure how to make a API call from trigger.
Hi

I want to create a custom button under lead/contact layout. On click of this button I want to open 3rd party webapp page in a new tab.
Please let me know how to achieve the above requirement.
Our app currently supports users to login with their Salesforce.com accounts.

Now we are trying to integrate Force.com accounts in our app as well.
We use SOAP API for all the communication.

So for Force.com is the login procedure same? Do we use the same API endpoint as Salesforce.com or do we use some other endpoint.
I cannot find this in the docs.
Hi

I want to integrate Views to my webapp ie I want fetch all view lists and their contacts and leads.
Currently I have integrated Objects and reports using SOAP and REST api call.
Please let me know which api call is better for integrating Views in C# and if possible some sample code.
Hi

I have a trigger and a class which creates Follow Up opportunity based on stage, that is if stage is changed to 7. Closed/Won then it creates new follow up opportunity with all values same as parent opportunity except opportunity team.

We want opportunity team gets copied to new opportunity created.
Please guide me through.
Hi 

I am trying to deploy few of my code changes (related to trigger) but while deploying from Sandbox to Production I am facing error related to some test classes. Below is the error and code for these test classes.

System.LimitException: LeadsProfiler:Too many DML statements: 151 
Stack Trace: (LeadsProfiler)

Methods : 
testManyChanges
testBulkInsert

Code : 

@isTest
private class StatusChangeTest {
    static testMethod void testStatusChange() {
        Lead l = new Lead();
        l.Company = 'Hogwarts School of Witchcraft and Wizardry';
        l.FirstName = 'Harry';
        l.LastName = 'Potter';
        l.Status = 'Contacted - Qualifying';
        l.LeadSource = 'Other';
        insert l;
        
        l = [select Id, Status, Status_Change_Date__c from Lead where Id = :l.Id];
        
        System.assertEquals(l.Status_Change_Date__c, Date.today());
        
        l.Status_Change_Date__c = Date.today().addDays(-3);
        update l;
                
        Test.startTest();
        SchedulableContext sc;
        new StatusChange().execute(sc);
        Test.stopTest();
        
        l = [select Id, Status from Lead where Id = :l.Id];
        
        System.assertEquals(l.Status, 'Not Contacted');
    }
    
    static testMethod void testManyChanges(){
        List<Lead> leads = new List<Lead>();
        for(Integer i =0; i < 201; i++){
            Lead l = new Lead();
            l.Company = 'Hogwarts School of Witchcraft and Wizardry';
            l.FirstName = 'Harry' + i;
            l.LastName = 'Potter';
            l.Status = 'Contacted - Qualifying';
            l.LeadSource = 'Other';
            
            leads.add(l);
        }
        
        insert leads;
        
        leads = [select LastName, Status, Status_Change_Date__c from Lead where LastName = 'Potter'];
        
        for(Lead l: leads){
            l.Status_Change_Date__c = Date.today().addDays(-3);
        }
        update leads;
        
        
        Test.startTest();
        SchedulableContext sc;
        new StatusChange().execute(sc);
        Test.stopTest();
        
        leads = [select Id, Status from Lead where LastName = 'Potter'];
        
        for(Lead l: leads){
            System.assertEquals(l.Status, 'Not Contacted');
        }
    }
}



public class UpdateAlertStatusOnAccountTest {
    static testMethod void testInsertWithDuplicateAccounts() {
        // create one account
        Account testAccount = new Account(Name='UpdateAlertStatusOnAccountTest');
        insert testAccount;
        
        // create two alerts on the same account
        Alert_Notes__c alert1 = new Alert_Notes__c(Account__c = testAccount.Id, Impacts__c = 'Account', Alert_Status__c = 'Red');
        Alert_Notes__c alert2 = new Alert_Notes__c(Account__c = testAccount.Id, Impacts__c = 'Account', Alert_Status__c = 'Green');
        
        insert new Alert_Notes__c[] { alert1, alert2 };
        
        // make sure the second one takes.
        
        testAccount = [select Id, Alert_Status__c from Account where Id = :testAccount.Id];
        System.assertEquals('Green', testAccount.Alert_Status__c);
    }
    
    static testMethod void testImpacts() {
        Account testAccount = new Account(Name='UpdateAlertStatusOnAccountTest');
        insert testAccount;
        
        Contact c1 = new Contact(FirstName = 'Test', LastName='UpdateAlertStatus', AccountId = testAccount.Id);
        insert c1;
        
        // create two alerts on the same account
        Alert_Notes__c alert1 = new Alert_Notes__c(Account__c = testAccount.Id, Contact__c = c1.Id, Impacts__c = 'Contact', Alert_Status__c = 'Red');
        Alert_Notes__c alert2 = new Alert_Notes__c(Account__c = testAccount.Id, Contact__c = c1.Id, Impacts__c = 'Account + Contact', 
                                                   Alert_Status__c = 'Green');
        Alert_Notes__c alert3 = new Alert_Notes__c(Account__c = testAccount.Id, Impacts__c = 'Contact', 
                                                   Alert_Status__c = 'Green');
        
        insert alert1;
        
        testAccount = [select Id, Alert_Status__c from Account where Id = :testAccount.Id];
        c1 = [select Id, Alert_Status__c from Contact where Id = :c1.Id];
        
        System.assertEquals(null, testAccount.Alert_Status__c);
        System.assertEquals('Red', c1.Alert_Status__c);
        
        insert alert2;
        
        testAccount = [select Id, Alert_Status__c from Account where Id = :testAccount.Id];
        c1 = [select Id, Alert_Status__c from Contact where Id = :c1.Id];
        
        System.assertEquals('Green', testAccount.Alert_Status__c);
        System.assertEquals('Green', c1.Alert_Status__c);
        
        Boolean error = false;
        try {
            insert alert3;
        } catch(DMLException e) {
            error = true;
        }
        
        System.assert(error);
    }
    
    static testMethod void testBulkInsert() {
        // create 201 accounts and an alert note per account -- provided 
        String[] alertStats = new String[] { 'Red', 'Yellow', 'Green'};
        
        List<Account> accountList = new List<Account>();
        
        for(Integer i = 0; i < 201; i++) {
            if(accountList.size() == 200) {
                insert accountList;
                accountList.clear();
            }
            
            Account a = new Account(Name = 'UpdateAlertStatusOnAccountTest' + i);
            accountList.add(a);
        }
        
        insert accountList;
        
        // re-select the accounts
        accountList = [select Id from Account where Name like '%UpdateAlertStatusOnAccountTest%'];
        
        List<Alert_Notes__c> alertNotes = new List<Alert_Notes__c>();
        
        Test.startTest();
        
        for(Integer i = 0; i < 201; i++) {
            if(alertNotes.size() == 200) {
                insert alertNotes;
                alertNotes.clear();
            }
            
            alertNotes.add(new Alert_Notes__c(Account__c = accountList[i].Id, Impacts__c = 'Account', Alert_Status__c = alertStats[Math.mod(i, 3)]));
        }
        
        insert alertNotes;
        

        
        // there should be 67 of each color.
        Integer redCount = [select count() from Account where Alert_Status__c = 'Red' and Name like '%UpdateAlertStatusOnAccountTest%'];
        Integer yellowCount = [select count() from Account where Alert_Status__c = 'Yellow' and Name like '%UpdateAlertStatusOnAccountTest%'];
        Integer greenCount = [select count() from Account where Alert_Status__c = 'Green' and Name like '%UpdateAlertStatusOnAccountTest%'];
        
        System.assertEquals(67, redCount);
        System.assertEquals(67, yellowCount);
        System.assertEquals(67, greenCount);
        
        Test.stopTest();
    }
}


Please let me know what could I do to solve this.
There is a validation which ensures that country to be added when a new contact is created. If country is not present, it gives error for new contact.
ISBLANK(Country)

Now we want to ignore this validation for a particular account or you can say for a LeadSource. Please let me know how could I achieve that.
I have tried below rule but it did not work.

NOT(ISPICKVAL(LeadSource, "DiscoverOrg")) && 
ISBLANK(Country)
I have a class which implements schedulable and below class which schedules the job
public class LeadNotContactedStart{
  public void startRun() {
        leadNotContactedImplimentation dtr = new leadNotContactedImplimentation();
        String sch = '0 0 * * * ?';
        if(test.isrunningtest()){
            system.schedule('Lead not contacted Test', sch, dtr);
        }  
        else{
            system.schedule('Lead not contacted', sch, dtr);
        }
    }
}

I needed to to edit the class which implements the schedulable in order to achieve that I had to delete the existed running scheduled job. Now after editing how could I restart same job.