• Peter Kalina IBM
  • NEWBIE
  • 5 Points
  • Member since 2015
  • Ing.
  • ENASTE

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 11
    Replies
Hi all,

how many weeks before new upcoming release i can refresh my sandboxes and it will appear new version of release maintenance.

Thank you

Peter
Hi all,

how many weeks before new upcoming release i can refresh my sandboxes and it will appear new version of release maintenance.

Thank you

Peter
I need help creating an Apex trigger to get the lead assignment rule to trigger on our imported leads. I need it to run on all leads and I am not sure how to get it to work.  thank you

trigger LeadAssign on Lead (after update) 
{
 List<Id> lIds=new List<id>();
For (lead l:trigger.new){
    if (l.IsConverted==False){
        lIds.add(l.Id);   }
       }
if (AssignLeads.assignAlreadyCalled()==FALSE){
    system.debug('Assign already called? '+AssignLeads.assignAlreadyCalled());
    AssignLeads.Assign(lIds);
}
}
public global class AssignLeads{

public static Boolean assignAlreadyCalled=FALSE;

public static boolean assignAlreadyCalled(){
return assignAlreadyCalled;
}

@future
public static void assign(List<Id> lIds){
assignAlreadyCalled=TRUE;
List<Lead> leads=[SELECT Id FROM Lead WHERE Id IN: lIds];
For (lead l:leads){
Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule= true;
l.setOptions(dmo);

}
update(leads);
}

}
  
  • January 27, 2016
  • Like
  • 0
Hi ,
     Iam trying to get contact owner field in lead object but did not find any way to access ,can someone tell me how to get contact owner field on lead object.

Regards,
Kiran
Hi, 

 I want to put below code inside after update after insert triger Please help me how to add below code into trigger am finding difficult in adding in inside trigger I need to pass trigger.new values in soql query.

Everytime when i make a update in lead it must look inside territory_lookup__c object to get values and update. 
 
for (lead ulds : [select id,postalcode,state,country from lead where id = '00Q180000029Ujz' limit 1])
 {
   ulds.postalcode = '';
   ulds.country = 'India';
   update ulds;
 }

 List<Territory_Lookup__c> territoryLookupList = null;  
 List<Integer> gzip = new List<Integer>(); // we need a list so that we can sort it.
 list<String> gstate = new list<String>();
 list<String> gcountry = new list<String>(); 
 
 for(Lead l :  [select id,postalcode,state,country from lead where id = '00Q180000029Ujz' limit 1]){
  gstate.add(l.state);
  gcountry.add(l.country);
  
   if ( l.postalcode != null)
   {
   gzip.add(Integer.valueof(l.postalcode));
   }
   else
   {
    gzip.add(0);
    }
 }

  system.debug('Zip :' + gzip);
  system.debug('State :' + gstate);
  system.debug('Country :' + gcountry);
 
  

  Territory_Lookup__c tls = [select Theater__c,Region__c,Area__c,User__c FROM Territory_Lookup__c
                           where  ( Zip_Start__c <= :gzip and Zip_End__c >=:gzip )  or
                                  (Country__c = :gcountry )
                                  limit 1]; 
    
  system.debug('Theater :' + tls.Theater__c);
  system.debug('Area :' + tls.Region__c);
  system.debug('Region :' + tls.Area__c);


  for(lead uld : [select id,postalcode,state,country from lead where id = '00Q180000029Ujz' limit 1]){
 
 
     uld.Territory_Lookup__c = tls.id;
     uld.Territory_Area__c = tls.Area__c;
     uld.Territory_Region__c = tls.Region__c;
     uld.Territory_Theater__c = tls.Theater__c;
 
      update uld;
   }

Thanks
Sudhir
Hi, 

  I wrote a batch apex to update custom field in account for some reasons its not working please suggest me what is the issue in this batch apex
 
global class batchAccountUpdate implements Database.Batchable<sObject> {

       public List<Account> parentIds = [SELECT id FROM account where parentid = ''];
       
       public List<Account> results = [SELECT id FROM account  WHERE parentid IN :parentIds];
       
       public List<aggregateResult> minopp = [SELECT id,accountid,min(closedate) closedates from opportunity 
                                             where accountid in (SELECT id FROM account where parentid = '' )
                                             group by id,accountid ]; 


    global Database.QueryLocator start(Database.BatchableContext BC) {
       
       
       return Database.getQueryLocator([SELECT id FROM account  WHERE parentid IN :parentIds]);
     
    }
   
    global void execute(Database.BatchableContext BC, List<Account> scope) 
    {
    
    for (AggregateResult ar : minopp ) 
     {     
   
         for(Account act : scope)
         { 
            
            act.Logo_Since__c   = Date.Valueof(ar.get('closedates')); 
            update act;          
         }
         update scope;
         
     }   
     
    } 
    
    global void finish(Database.BatchableContext BC) {
    }
}


Thanks

Sudhir

Can anyone explain what this means? This is a error occurs on an sControl that was working fine until recently. It was working on March 5, 2012. This error comes up when trying to enter a Value into a lookup field on an s-control.

 

Error: {faultcode:'soapenv:Client', faultstring:''' is not valid for the type xsd:double', }