• songlan
  • NEWBIE
  • 34 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 9
    Replies

Hello,

 

I'd like to use Test.loadData to create some attachments with createddate in the past for test purpose. What should I put for the Body field (base64) in the csv file?

 

Thanks in advance.

Hello all,

 

I installed in my developer org a package with a batch in the post install script.  After installation, the batch is executed with Status Detail:First error: Attempt to de-reference a null object. But when I execute the batch manuelly (with execute anonymous) it works. I turned on the debug log before installation but don't see anything in the log and the Notify on Apex Error is set but no mail received. 

 

Anyone have some ideas of what happened or how I can get some log for the post install script?

 

Thanks in advance.

Trigger:

 

trigger getmanager on Opp__c ( before update){
Set<Id> id= new Set<Id>();
Set<String> empid=new Set<String>();
Set<String> mngid=new Set<String>();
List<Opp__c> OppyLocation = new List<Opp__c>();

for (Opp__c opp:trigger.old){
  id.add(trigger.newmap.get(opp.id).Current_Year_Rep__c );
  system.debug('id:'+id);
  }
for (HR__c empnum: [select Employee_Number__c from HR__c where  id  in :id ]){
    empid.add(empnum.Employee_Number__c);
      }
      
    system.debug('id:'+id);
    system.debug('empid:'+empid);
 
 for (Contact con: [select Employee_Id__c,Reports_To_Employee_Id__c from contact where Employee_Id__c in:empid]){
    mngid.add(con.Reports_To_Employee_Id__c );
    }
    system.debug('mngid:'+mngid);
    
 for (HR__c empnu: [select Employee_Number__c,Name from HR__c where Employee_Number__c in: mngid]){

      for (Opp__c opp:trigger.new){
     opp.Cureent_Year_Rep_Manager__c=empnu.id; 
     system.debug('emp:'+ empnu.id );
     system.debug('emp:'+ empnu.Name );

     OppyLocation.add(opp);
     
      
         }
             }
            
}

 

Test class:

@istest
Public Class  getmanagerTest {
public static testmethod void test() {
List<Contact> con= new List<Contact>();  
  con .add(new contact(lastname='te1',Employee_Id__c='11110',Reports_To_Employee_Id__c='11111'));      
  con .add(new contact(lastname='te2',Employee_Id__c='11111',Reports_To_Employee_Id__c='11112'));      
            
 List <HR__c> rec=new List<HR__c>();
 rec.add(new HR__c( Name='kalai',Employee_Number__c='11110'));
 rec.add(new HR__c(Name='Raj',Employee_Number__c='11111'));
  
         
      Opp__c r = new Opp__c(Name= 'opp1' ,Current_Year_Rep__c='11110');
      insert r;
      }

  
          
   }

 

 

String s = 'This's is correct and it's ready to replace';

How to replace the single quote ?

 

replace character : '

Replacing with : '\

My expected output:

 

This\'s is correct and it\'s ready to replace

 

Is it possible?

Hello,

 

I'd like to use Test.loadData to create some attachments with createddate in the past for test purpose. What should I put for the Body field (base64) in the csv file?

 

Thanks in advance.

Hello all,

 

I installed in my developer org a package with a batch in the post install script.  After installation, the batch is executed with Status Detail:First error: Attempt to de-reference a null object. But when I execute the batch manuelly (with execute anonymous) it works. I turned on the debug log before installation but don't see anything in the log and the Notify on Apex Error is set but no mail received. 

 

Anyone have some ideas of what happened or how I can get some log for the post install script?

 

Thanks in advance.

I am having issue to assign a map from<apex:attribute type="map" assignedTo={!method}

 

Getting the below error message:

 Error: Type mismatch for <apex:attribute assignTo>. Value binding to a property of type MAP<Object,Object> is required, property specified is of type MAP<String,String>.

 

Below is the code snipet I am using:

VF Component:

    <apex:attribute name="leftOptions" description="Map for left Picklist" type="map" required="true" assignTo="{!test}"/>

Definition in Controller:

public Map<String,String> test {get;set;}

 

Note: the same errot comes for below definitions as well -

public Map<Account,Contact> test {get;set;}

public Map<sObject,sObject> test {get;set;}

 

Please let me know anyone need more information to help. Thanks in advance.

 

 

apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute.

Is it because  POST is required to upload the file ?




Message Edited by devNut! on 11-18-2008 11:30 AM