Salesforce Certified Application Architect

Tuesday 19 January 2016

System.XmlException: only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1)

During writing the test class the problem is testing a method that makes a REST request, 

I have tried to implment "HttpCalloutMock" without success an am getting the following error =

"System.XmlException: only whitespace content allowed before start tag and not [ (position: START_DOCUMENT seen [... @1:1)"


Solution :  
It's like the document .getChildElement and Root element on this fake response is not valid, It might be format problem like XML or JSon .

Please pass the fake response as you require i mean you are getting fake response in your debug log is not valid response its could be format problem .

Thanks
Gaurav
 

Wednesday 13 January 2016

How to cover mark Red colour in Test classes










Since i am using trigger after update therefore we should pass as mentioned under :-
Application app = new Application(Status='Submitted',      
                Type__c='new',
               
                Customer__c='5',
                Branch=branch1.id,
                Area = area1.id,
                Meeting = mc.id,
                Loan='42645' ,
                product = Prod.Id 
             
          );
         
          insert app ;
          app .Status = 'Draft';
          update app ;



Friday 8 January 2016

Delete duplicate mobile number with different URN from Opportunity through batch apex

global class Batch_OpportunityBatch implements Database.Batchable<sObject>{

    global Database.QueryLocator start(Database.BatchableContext BC){
      return Database.getQueryLocator('SELECT id,Name,Mobile,URN FROM Opportunity WHERE URN LIKE \'' + 7 + '%\'  order by CreatedDate desc') ;
    }

    global void execute(Database.BatchableContext BC, List<Opportunity> scope){
    System.debug('scope@@@@@@@@'+scope);
    //Map<String, List<Opportunity>> mapMobileKeyWithOpportunitys = new Map<String, List<Opportunity>>();
    Map<String, String> mapMobileKeyWithUniqueOpportunitys = new Map<String, String> ();
   
    List <Opportunity> listOpportunitytoDelete = new list<Opportunity>();
   
    for(Opportunity s : scope){
    if(!mapMobileKeyWithUniqueOpportunitys.containsKey(s.Mobile)){
        mapMobileKeyWithUniqueOpportunitys.put(s.Mobile,s.URN);
       
    }               
    }
    System.debug('mapMobileKeyWithUniqueOpportunitys@@@@-->'+mapMobileKeyWithUniqueOpportunitys);
    
     if(mapMobileKeyWithUniqueOpportunitys.size()>0 && !mapMobileKeyWithUniqueOpportunitys.isempty()){

        listOpportunitytoDelete = [select id, Name from Opportunity where URN NOT IN : mapMobileKeyWithUniqueOpportunitys.values() and URN LIKE \'' + 7 + '%\'];
       }
        System.debug('$$$$$$$$'+listOpportunitytoDelete.size());   
        if(listOpportunitytoDelete.size()>0){
            Delete listOpportunitytoDelete ;
           
        }
    }

    global void finish(Database.BatchableContext BC){
   
    }
}



Salesforce Certified Application Architect & Certified Data Architecture and Management Designer Exam

How to pass Salesforce Certified Data Architecture and Management Designer Exam This exam was 1st architect exam for me. Its not that muc...