• RAMANJINEYULU GOGULA
  • NEWBIE
  • 20 Points
  • Member since 2016
  • Salesforce Developer
  • SIEMENS


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 12
    Replies
Hi,
I'm uploading an image in Salesforce, where that field datatype is Text Area Rich, and I also gave that API name in Email  Template.

But when I ever send an email, attachment is not sending and only text is passing. So can anybody help regarding this. How to showcase my attachment image in sent email?
You can observe here, it is executing but not affecting any changes in the records, please help me out?

public class ramsBatchTownName implements Database.Batchable<sObject> {
    public String field;
    public String v1,v2,v3,v4,v5;
    public String query;
    public ramsBatchTownName(String q){
        field='Address__c';
        v1='KKM';
        v2='MDP';
        v3='NAND';
        v4='PLVD';
        v5='NO ADDRESS';
        query=q;
    }
    public Database.QueryLocator start(Database.BatchableContext BC){
        return Database.getQueryLocator(query);
    }
    public void execute(Database.BatchableContext BC, List<Ram__c> batch){
        for(Ram__c rc:batch){
            if(rc.Districts__c=='Anantapur')
                rc.put(field,v1);
            else if(rc.Districts__c=='Chittor')
                rc.put(field,v2);
            else if(rc.Districts__c=='Kurnool')
                   rc.put(field,v3);
            else if(rc.Districts__c=='Kadapa')
                   rc.put(field,v4);
        }
        update batch;
    }
    public void finish(Database.BatchableContext BC){
        
    }
}
public with sharing class salescontroller 
{
    public string dat='this month';
   public Integer leadcount{ get; set; }
   
    public Integer getCountings()
    {
       Integer counts=[SELECT COUNT() FROM Lead];
       leadcount=counts;
        return counts;
    }
    public List<Lead> getCurrentMonthInfo()
    {
        List<Lead> ll=Database.query('SELECT Id,Name,Division_Name__c,Title,counting__c '+ 'FROM Lead');
        return ll;
    }
}


I need to transfer count value from getCountings() to getCurrentMonthInfo() and retrieve count variable value in this, Could anyone can solve this plz??
public class ContactSearch 
{
    public static List<Contact> searchForContacts(String s1, String s2)
    {
        ContactSearch cs=new ContactSearch();
        List<String> s3=new List<String>{s1,s2};
        s3[0]=s1;
        s3[1]=s2;
        System.debug(s3);
        List<String> sr=new String[]{''+[SELECT LastName FROM Contact],''+[SELECT MailingPostalCode FROM Contact]};
        if(s1==s3[0] && s2==s3[1])
        {
            List<Contact> result=new List<Contact>();
            Contact[] query=[SELECT Id,FirstName,LastName FROM Contact WHERE LastName=:s1 AND MailingPostalCode=:s2];            
            System.debug(query);
        }
        List<Contact> result=new List<Contact>();
        return result;
      }
}


This is the code developed by me, it is running but unable to pass the trailhead challenge? 

For HTML we do make file with .html
Like wise for visualforce?

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [ContactField__c]: [ContactField__c]


Getting above error..while submitting an assignment.
Question: Create a rollup summary field that determines the potential value of the opportunities associated with an account.
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Process failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, missing required field: [nextApproverIds]: [nextApproverIds].

Please help me to get out of it, everything I followed according to the question. But why it is showing like this?
I have this very simple class..  
trigger RestrictContactByName on Contact (before insert, before update) {
    //check contacts prior to insert or update for invalid data
    For (Contact c : Trigger.New) {
        if(c.LastName == 'INVALIDNAME') {   //invalidname is invalid
            c.AddError('The Last Name "'+c.LastName+'" is not allowed for DML');
        }
    }
}
.. and the corresponding Test Class:  
@isTest
private class TestRestrictContactByName {

	@isTest static void metodoTest() {
		
		List listaContatti = new List();
		Contact c1 = new Contact(FirstName='Francesco', LastName='Riggio');
		Contact c2 = new Contact(LastName = 'INVALIDNAME');
		listaContatti.add(c1);
		listaContatti.add(c2);
		
		//insert listaContatti;
		
		// Perform test
        Test.startTest();
        Database.SaveResult [] result = Database.insert(listaContatti, false);
        Test.stopTest(); 
		
		c1.LastName = 'INVALIDNAME';
		update c1;
       		
	}
	
}

When I run the Test class from the Developer Console I get 100% of coverage on the RestrictContactByName class but, when I check the challenge on the trailhead it returns the error:

Challenge not yet complete... here's what's wrong: The 'RestrictContactByName' class did not achieve 100% code coverage via your test methods

Has someone had my same issue?