• Sandeep Mishra 7
  • NEWBIE
  • 120 Points
  • Member since 2015
  • Salesforce Developer


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 12
    Replies
If user A wants to receive a notification when a new case is opened with the status of "New" during business hours. Which could be the best automation processs could be used to accpmplish this?

Escalation rules OR Process Builder OR Visual Workflow?
If user A wants to receive a notification when a new case is opened with the status of "New" during business hours. Which could be the best automation processs could be used to accpmplish this?

Escalation rules OR Process Builder OR Visual Workflow?
I am new to webservices. Can anyone give an real time example to  Rest Apex Class, to illustrate post and get method from an outside application ?
 
I want to make changes in VF page.Currently a document is generated,printed out and then signed and scanned again back to the system.I want to auto popolate the signature say with "XYZ" name and any font style.
How can i achieve this?
Has Salesforce reduced the developer edition licences to only 2 ?
iF so how can I increase them ?
please help me ....

Two team members need to view and update Accounts, but only one should be able to see and edit the Rating field. Create one profile and one permission set with field level security to solve for this use case.The profile must be named 'Basic Account User' and result in an API name of 'Basic_Account_User'. It should use the 'Salesforce' user license type.
The permission set must be named ‘Account Rating’ and result in an API name of 'Account_Rating'.Check Challenge
Hi All,

Written a schedulable class for sending an email on every wednesday.

My schedulable class:
global class ClassEmailSchedule implements Schedulable {
    
    public List<Log_Book__c> lb{get;set;}
	global void execute(SchedulableContext SC){
        
        sendMail();
    }
    public void sendMail(){
        
        lb = [SELECT ID, NAME, Subject__c, Student__r.NAME,Class_Scheduled_Date__c, Student__r.Parent_Email__c, Subjects_Registered__r.Select_Day__c 
            FROM Log_Book__c WHERE Subjects_Registered__r.Select_Day__c = 'Wednesday' ];
        
        for(Log_Book__c email : lb){
            if(email.Class_Scheduled_Date__c == Date.today()){
		List<Messaging.SingleEmailMessage> mails =  new List<Messaging.SingleEmailMessage>();

		Messaging.SingleEmailMessage mail =  new Messaging.SingleEmailMessage();
    
      List<String> sendTo = new List<String>();
      sendTo.add(email.Student__r.Parent_Email__c);
      mail.setToAddresses(sendTo);
      
      mail.setReplyTo('bhaskar.thamma@gmail.com');
      mail.setSenderDisplayName('BHASKAR');
    
       // (Optional) Set list of people who should be CC'ed
      List<String> ccTo = new List<String>();
      ccTo.add('jagadeesh.adaveni@gmail.com');
      mail.setCcAddresses(ccTo);

      mail.setSubject('Reminder for Class');
      String body = 'Dear <b>' + email.Student__r.name + '</b>, ';
      body += 'Your class is to day at 10.00 AM.';
      body += 'Thank you...';
      
      mail.setHtmlBody(body);
      mail.saveAsActivity = false;
      mail.setTargetObjectId(email.Id);

      mails.add(mail);
      // Step 5. Add your email to the master list
      Messaging.sendEmail(mails);
        }
    }
        
    }
}
Class scheduled but not getting any email.
Let me know what is the wrong in this and give me solution. 

Thank you...
Hi All,

I am trying to access the class varible dynamically for one of my requirment. Please see the code.

public class CaseUpdateTestingClass {
    public string AssetSN = '1AED45';
    public string CDIDId='3498474';
    public string ContactFirstName='SalesForce';
}
CaseUpdateTestingClass es = new CaseUpdateTestingClass();
string ss = 'AssetSN;CDIDId;ContactFirstName'; // Here I do dynamic assignment
for ( string a : ss.split(';'))
system.debug('*********** : '+es.get(a));

Thanks
Shaijan Thomas
Apex Basics & Database Unit 5/5

Hello, Community, I am facing problem in solving this challenge, please advise.

Here is the criteria presented: 

With SOSL you can search against different object types that may have similar data, such as contacts and leads. To pass this challenge, create an Apex class that returns both contacts and leads that have first or last name matching the incoming parameter.

The Apex class must be called 'ContactAndLeadSearch' and be in the public scope.
The Apex class must have a public static method called 'searchContactsAndLeads'.
Because SOSL indexes data for searching, you must create a Contact record and Lead record before checking this challenge. Both records must have the last name 'Smith'. The challenge uses these records for the SOSL search.
The return type for 'searchContactsAndLeads' must be 'List<List< SObject>>'
The 'searchContactsAndLeads' method must accept an incoming string as a parameter, find any contact or lead that matches the string as part of either the first or last name and then return those records.

Error received: 

Challenge not yet complete... here's what's wrong: 
Executing the 'searchContactsAndLeads' method failed. Either the method does not exist, is not static, or does not return the expected search results.

Here is my code:

public class ContactAndLeadSearch{
    public static List<List< SObject>> searchContactsAndLead(String name)
    {
        List<List<sObject>> result=[FIND :name IN ALL FIELDS RETURNING Lead(LastName),Contact(LastName)];
                return result;
    }
}


PLEASE ADVISE...Thanks Community!!!
I am able to get 80% code coverage, but it didnt covers the hasnext,previous and pagenumber method. 
Below is the class:
public with sharing class CustomPaginationController 
{

    public CustomPaginationController(ApexPages.StandardController controller) 
    {
       acc = new Account();
       lstAccount = new List<Account>();

   }

    public Account acc {get;set;}   
    public ApexPages.StandardSetController con{get; set;} 
  /*  public CustomPaginationController ()
    {

    }*/
    public List<Account> lstAccount 
    {  
        get  
        {  
            if(con != null)  
                return (List<Account>)con.getRecords();  
            else  
                return null ;  
        }  
        set;
    }  
    public PageReference Search()
    {
        String query= '';
        String strFilter = '';
      
        if(acc.Name != null && (acc.Name ).trim() !='')
        {
            strFilter  = strFilter  +  ' And Name Like \''+acc.Name+'%\'' ;
        }
        if(acc.Phone != null && (acc.Phone).trim() !='' )
         {
        	strFilter  = strFilter  +  ' And Phone like \''+acc.Phone+'%\'' ;
         }
       if(acc.ShippingCity != null && (acc.ShippingCity).trim() !='' )
        {
        	strFilter  = strFilter  +  ' And ShippingCity like \''+acc.ShippingCity+'%\'' ;
        }
        if(acc.ShippingCountry != null && (acc.ShippingCountry).trim() !='' )
        {
            strFilter  = strFilter  +  ' And ShippingCountry like \''+acc.ShippingCountry+'%\'' ;
        }
        if(acc.Account_Type__c != null && (acc.Account_Type__c).trim() !='' )
        {
            strFilter  = strFilter  +  ' And Account_Type__c like \''+acc.Account_Type__c+'%\'' ;
        }
        if(acc.Customer_Number__c != null && (acc.Customer_Number__c).trim() !='' )
        {
            strFilter  = strFilter  +  ' And Customer_Number__c like \''+acc.Customer_Number__c+'%\'' ;
        }
        if(strFilter != '')
        {
            query = 'Select name ,id, phone,ShippingCity,ShippingCountry,Account_Type__c,Customer_Number__c from Account  where name != null '+strFilter+ ' limit 1000';
            System.debug('Query ---->'+ query );
            con = new ApexPages.StandardSetController(Database.getQueryLocator(query)); 
            con.setPageSize(20);
        }
        else
        {
        }
       return null;
    }
    public PageReference createAccount(){
            PageReference newAccPage2 = new PageReference('/001/e');
            // do not longer override the creation action   
            newAccPage2.getParameters().put('nooverride', '1');
            newAccPage2.getParameters().put('acc2', acc.Name);
            newAccPage2.getParameters().put('acc10', acc.Phone);
            newAccPage2.setRedirect(true);
            return newAccPage2; 

   }
    public Boolean hasNext  
    {  
        get  
        {  
            return con.getHasNext();  
        }  
        set;  
    }  
    public Boolean hasPrevious  
    {  
        get  
        {  
            return con.getHasPrevious();  
        }  
        set;  
    }  
    public Integer pageNumber  
    {  
        get  
        {  
            return con.getPageNumber();  
        }  
        set;  
    }  
    public void previous()  
    {  
        con.previous();  
    }  
    public void next()  
    {  
        con.next();  
    }  
   
}

Test Class is as follows:
@isTest
private class TestCustomPaginationController {
static testMethod void TestPaginationAccount() 
    {
		//creating an Account
		Account Acc=new Account();
		Acc.Name='Test Account';
		Acc.phone='5591231234';
        Acc.Currency_Number__c='PROSVAA';
		Acc.ShippingCity='Los Angles';
		Acc.Account_Type__c= 'Integrator';
		Acc.ShippingCountry='United States';
		Insert Acc;		
		//PageReference pageRef = Page.newAccPage2;
		//Test.setCurrentPage(pageRef);
		ApexPages.Standardcontroller sc = new ApexPages.Standardcontroller(Acc);
		ApexPages.currentPage().getParameters().put('Id',acc.id);
		CustomPaginationController ec = new CustomPaginationController(sc);
        ec.acc.name='Test Account';
        ec.acc.phone='5591231234';
        ec.acc.ShippingCity='Los Angles';
        ec.acc.Account_Type__c='Integrator';
        ec.acc.Customer_Number__c='PROSVAA';
        ec.acc.ShippingCountry='United States';
        ec.Search();
        List<Account> lstAccount =new list<Account>();
        lstAccount.add(ec.acc);
        ec.CreateAccount();
        PageReference pageRef = Page.SearchandCreateAccount;
        Test.setCurrentPage(pageRef);
        ec.next();
        ec.previous();
        //p.pageNumber();
        //p.hasNext();
        //p.hasPrevious();
        //ec.acc.hasNext();
        //CustomPaginationController NewPagination=CustomPaginationController(ec.acc);
        //NewPagination.hasNext();
        //NewPagination.hasPrevious();
        //acc.hasNext(); 
        //lstAccount.hasPrevious();
        //ec.getPageNumber();
        //ec.previous();
        //ec.next();
		//list<account> Accs=ec.Acc;
		//System.assertEquals(1, Accs.size());
	}
}

Code is not covered for 
public List<Account> lstAccount 
    {  
        get  
        {  
            if(con != null)  
                return (List<Account>)con.getRecords();  
            else  
                return null ;  
        }

and 
public Boolean hasNext  
    {  
        get  
        {  
            return con.getHasNext();  
        }  
        set;  
    }  
    public Boolean hasPrevious  
    {  
        get  
        {  
            return con.getHasPrevious();  
        }  
        set;  
    }  
    public Integer pageNumber  
    {  
        get  
        {  
            return con.getPageNumber();  
        }  
        set;  
    }

Please suggest.

Command links with param are not working inside "repeat inside repeat" code. The action method attached to the command link is not getting invoked.

 

Any suggestions?

 

 

<apex:repeat value="{!listData}" var="l" rendered="{!NOT(ISNULL(listData))}">

<apex:repeat value="{!l.Items}" var="c"><tr>

<td>{!l.Title}</td>

<td>{!c.Description}</td>

<td>{!c.Name}</td>

<td>

<apex:commandLink value="View" action="{!viewId}">

<apex:param assignTo="{!selectedId}" name="selectedId" value="{!c.Id}" />

</apex:commandLink>

</td>

</tr>

</apex:repeat>

Message Edited by Chirag Mehta on 03-10-2010 10:36 AM