• venkateshyadav1243
  • NEWBIE
  • 150 Points
  • Member since 2012

  • Chatter
    Feed
  • 5
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 97
    Questions
  • 124
    Replies
Hi
Am facing issue with deployment, am trying to deploy through ANT tool am not able to deploy its showing errors, But i tried the same with eclipse with out error its validated sucessfully,but through ANT am not able to deploy its showing error message "invalid cross reference id",I have to Deploy only through ANT.
Can any one faced same issue please let me know how to reslove Advance Thanks for your help.

Regards,
Venkatesh.
Hi ,

Am parsing csv file using apex i have to do insert and update records , before insert or update i need to check any record have duplicate values,
Duplicate records are considering concatenation of 3 fields(index ,rep type , platform).
Before processing my csv file I need to check one validation rule
Concatenation of 3 fields records should not cross more than 100%
Example:
Index          Rep type     platform percentage
IBM               Gs              OS           30
IBM               GS             Os            80
Saas              WX            Apex       100
FA                  ABC            XYZ        80

In this situation  I need display error message in VF page you are entering more than  100 % to below records

Can any one tell me how to check duplicate records while inserting and updating and checking values is less than 100 % or not, if  more than 100% display error message.
Regards
Venkatesh.
Hi All,

Am uploading CSV file that contain around 4 MB ,but am not to upload into salesforce its showing me error " System.LimitException: Regex too complicated "

I read in Salesforce limitation pdf its saying we can upload upto 10 MB,but my file is failing does any one what is the reason ?
Can any one tell me how can i rectify with out going batch apex class,
how the salesforce will calculate Heapsize ?


Reagrds,
Venkatesh.
Hi All,

Am trying to handle errors in my csv file before processing batch class
can any one please tell me how to handle errors in batch class and send error list to user email.
I written batch class for inset and update records its working fine,but now i have to handle few validation rule before insert/update and if any record is contain proper value ,i have to stop the batch process can one please help me how can i do this.
Below is my batch apex class.

global class CustomIterableBatchForGSSAccount implements Database.Batchable<String>,Database.Stateful{
global Map<Id, String> errorMap {get; set;}
    global Map<Id, SObject> IdToSObjectMap {get; set;}
    Public String CSVFile;
    Set<string> strset=new Set<string>();
    Map<string,id>  Offmap=new map<string,id>();
    Public  List<GSS_Split__c> Gsstoupload;
    Public  List<GSS_Split__c> Gsstoupdate;
    Public  List<GSS_Split__c> Gsssize;
    Public String Errormsgs;
    //Constructor to hold the uploaded CSV file
   
    global CustomIterableBatchForGSSAccount(String CSVFile){
        this.CSVFile= CSVFile;
         errorMap = new Map<Id, String>();
        IdToSObjectMap = new Map<Id, SObject>();
    }
   //Start Method
    global Iterable<String> start(Database.BatchableContext bc){
        return new CustomIterable(CSVFile);
    }
    //execute method
    global void execute(Database.BatchableContext bc,List<String> Scope){
    Gsstoupload = new List<GSS_Split__c>();
    Gsstoupdate = new List<GSS_Split__c>();
    Gsstoupload.clear();
    Gsstoupdate.clear();
   for(GSS_Split__c gss:[select name,Request_Number__c,Account_Index__c,Period_End_text__c,Period_Start_text__c,HQ__c,GRS_REPTYPE__c,GRS_PLATFORM__c,Territory__c,Region__c,WGSS_Perc__c,GSS_Perc__c,PeriodStart__c,Period_End__c,AX_login__c,Primary_AX__c from GSS_Split__c])
        {       
          Strset.add(gss.Request_Number__c);
          Offmap.put(gss.Request_Number__c,gss.id);
          System.debug('All GSS ACCOUNT OBJECT RECORDS'+gss);
        }
        List<String> inputvalues;
        try{       
            System.debug('**scope size**'+scope.size());

         
            for (Integer i=0;i<scope.size();i++)
            {
                inputvalues = new List<String>();
                //split the rows
                inputvalues = scope[i].split(',');
                if(Strset.contains(inputvalues[0]))
            {
                GSS_Split__c a = new GSS_Split__c(id=offmap.get(inputvalues[0]));
               
                //split the rows
               // inputvalues = scope[i].split(',');


            a.Request_Number__c=inputvalues[0];
            a.Account_Index__c= inputvalues[1];
            a.HQ__c= inputvalues[2];      
            a.GRS_REPTYPE__c= inputvalues[3];
            a.GRS_PLATFORM__c= inputvalues[4];
            a.Territory__c= inputvalues[5];
            a.Region__c= inputvalues[6];
            a.GSS_Perc__c= integer.valueof(inputvalues[7]);
            a.WGSS_Perc__c=integer.valueof(inputvalues[8]);
            a.Period_Start_text__c=inputvalues[9];
            a.Period_End_text__c=inputvalues[10];
            a.AX_login__c= inputvalues[11];
            a.Primary_AX__c= inputvalues[12];
            Gsstoupdate.add(a);
            }
             else{  
            GSS_Split__c a = new GSS_Split__c(id=offmap.get(inputvalues[4]));
            System.debug('gsss recordsssssss'+a);
            a.Request_Number__c=inputvalues[0];
            a.Account_Index__c= inputvalues[1];
            a.HQ__c= inputvalues[2];      
            a.GRS_REPTYPE__c= inputvalues[3];
            a.GRS_PLATFORM__c= inputvalues[4];
            a.Territory__c= inputvalues[5];
            a.Region__c= inputvalues[6];
            a.GSS_Perc__c= integer.valueof(inputvalues[7]);
            a.WGSS_Perc__c=integer.valueof(inputvalues[8]);
            a.Period_Start_text__c=inputvalues[9];
            a.Period_End_text__c=inputvalues[10];
            a.AX_login__c= inputvalues[11];
            a.Primary_AX__c= inputvalues[12];
            Gsstoupload.add(a);
           
            }
            }
          Savepoint sp = Database.setSavepoint();
            try{
        if(Gsstoupdate.size()>0)
        {
        System.debug('######## gsstoupdate'+Gsstoupdate);
update Gsstoupdate;
        }
        if(Gsstoupload.size()>0)
        {
         System.debug('######## gsstoupload'+Gsstoupload);
Database.insert(Gsstoupload,false);
        }
      
       
        }
        Catch (Exception e)
        {
Database.rollback(sp);
       
         System.debug('Exception--->'+e+'%%%'+e.getmessage());
        }   
            
        }Catch(Exception e){
            system.debug('Exception--->'+e+'%%%'+e.getmessage());
        }
       
    }
   
    global void finish(Database.BatchableContext bc)    {    }
}


Regards,
Venkatesh.
Hi

Am uploading csv file in visualforce page and uploading through bacth apex,its working fine for insert and upadte below is my code.
I have to show error messgae before inserting/update into the system.
Example i have 1 percentage field(Gss percentage) if any record have less than 100 % i need to cancel the batch process and i have to display error message in visualforce page i.e (Some X record have less than 100% please correct and enter).

When i try to add visulforce messgae in batch apex its showing me error how can i display this error in visualforce page
please can any one give me some idea.


global class CustomIterableBatchForAccount implements Database.Batchable<String>,Database.Stateful{
   
    public String CSVFile;
     set<string> strset=new set<string>();
    Map<string,id> offmap=new map<string,id>();
    public  List<GSS_Split__c> gsstoupload;
    public  List<GSS_Split__c>  gsstoupdate;
        public  List<GSS_Split__c> gsssize;
    public string errormsgs;
    //Constructor to hold the uploaded CSV file
   
    global CustomIterableBatchForAccount(String CSVFile){
        this.CSVFile= CSVFile;
    }
    public void data()
    {
   
       
    }
    //Start Method
    global Iterable<String> start(Database.BatchableContext bc){
        return new CustomIterable(CSVFile);
    }
    //execute method
    global void execute(Database.BatchableContext bc,List<String> scope){
     gsstoupload = new List<GSS_Split__c>();
    gsstoupdate = new List<GSS_Split__c>();
    gsstoupload.clear();
    gsstoupdate.clear();
   for(GSS_Split__c gss:[select name,Request_Number__c,Account_Index__c,Period_End_text__c,Period_Start_text__c,HQ__c,GRS_REPTYPE__c,GRS_PLATFORM__c,Territory__c,Region__c,WGSS_Perc__c,GSS_Perc__c,PeriodStart__c,Period_End__c,AX_login__c,Primary_AX__c from GSS_Split__c])
        {       
       // gsssize.add(gss.name);
          strset.add(gss.Request_Number__c);
          offmap.put(gss.Request_Number__c,gss.id);
          system.debug('All GSS ACCOUNT OBJECT RECORDS'+gss);
          //system.debug('All GSS ACCOUNT OBJECT RECORDS SIZE IN CURRENT SYSTEM'+gsssize.size());
        }
        List<String> inputvalues;
        try{       
            system.debug('**scope size**'+scope.size());

         
            for (Integer i=0;i<scope.size();i++)
            {
                inputvalues = new List<String>();
                //split the rows
                inputvalues = scope[i].split(',');
                if(strset.contains(inputvalues[0]))
            {
                GSS_Split__c a = new GSS_Split__c(id=offmap.get(inputvalues[0]));
               
                //split the rows
               // inputvalues = scope[i].split(',');


            a.Request_Number__c=inputvalues[0];
            a.Account_Index__c= inputvalues[1];
            a.HQ__c= inputvalues[2];      
            a.GRS_REPTYPE__c= inputvalues[3];
            a.GRS_PLATFORM__c= inputvalues[4];
            a.Territory__c= inputvalues[5];
            a.Region__c= inputvalues[6];
            a.GSS_Perc__c= integer.valueof(inputvalues[7]);
            a.WGSS_Perc__c=integer.valueof(inputvalues[8]);
            a.Period_Start_text__c=inputvalues[9];
            a.Period_End_text__c=inputvalues[10];
            a.AX_login__c= inputvalues[11];
            a.Primary_AX__c= inputvalues[12];
            gsstoupdate.add(a);
            }
             else{  
            GSS_Split__c a = new GSS_Split__c(id=offmap.get(inputvalues[4]));
            system.debug('gsss recordsssssss'+a);
            a.Request_Number__c=inputvalues[0];
            a.Account_Index__c= inputvalues[1];
            a.HQ__c= inputvalues[2];      
            a.GRS_REPTYPE__c= inputvalues[3];
            a.GRS_PLATFORM__c= inputvalues[4];
            a.Territory__c= inputvalues[5];
            a.Region__c= inputvalues[6];
            a.GSS_Perc__c= integer.valueof(inputvalues[7]);
            a.WGSS_Perc__c=integer.valueof(inputvalues[8]);
            a.Period_Start_text__c=inputvalues[9];
            a.Period_End_text__c=inputvalues[10];
            a.AX_login__c= inputvalues[11];
            a.Primary_AX__c= inputvalues[12];
            gsstoupload.add(a);
           
            }
            }
           
            try{
        if(gsstoupdate.size()>0)
        {
        system.debug('######## gsstoupdate'+gsstoupdate);
update gsstoupdate;

        }
        if(gsstoupload.size()>0)
        {
         system.debug('######## gsstoupload'+gsstoupload);
Database.insert(gsstoupload,false);

        }
             }
        catch (Exception e)
        {
       
         system.debug('Exception--->'+e+'%%%'+e.getmessage());
       
        }   
            system.debug('@@@@@@@@@@@@@@@@@@@size'+gsstoupload.size());
          
        }catch(Exception e){
            system.debug('Exception--->'+e+'%%%'+e.getmessage());
        }
       
    }
   
    global void finish(Database.BatchableContext bc)
    {
    }
}
Regards,
Venkatesh.
Hi
Am not able to get the field result from Schema.DescribeFieldResult

can any one help me how to get the field result below is my method

public String LabelDataType{get;set;}
    public String FieldObject{get;set;}
public String Label {get;set;}


public PageReference fieldtype(){
    String APIName = getAPIName(FieldObject, Label);
    if(APIName == ' None')return null;

Schema.DescribeFieldResult fieldResult = getFieldResult(FieldObject,APIName);
  System.debug(LabelDataType.toUpperCase()+';;;;'+fieldResult.getType());
    if(fieldResult != null){
                    }
            else{
                        }
        }
    }

    return null;   
  }
Hi
I need to insert/update more than 1 lac records in salesforce,
How can i do it, i tried normal file upload functionality but am getting "regex" error,
any one help me how can i complete this task



Regards,
Venkatesh
Hi,
I have a requirement parsing csv file into salesforce(insert and update.)
I have a date field called in Period Start Date (MM/DD/YYYY.)
But my client is giving me Date Format like this MARCH 2014,
So can anyone please guide me how to convert date filed into This format MARCH 2014,APRIL 2013
a.PeriodStart__c=date.ValueOf(inputvalues[10]);

Thanks for your help and guidance
Regards,
Venkatesh
Hi am not able to cover test calss can please any one help me where am missing thanks for your help

Trigger.

trigger updatingadressdummy on KYC__c (after insert,after update) {

    // for billing 1
    set<id>kycidb1=new set<id>();//set for kyc
        set<id>kycids1=new set<id>();//set for kyc
    set<id>kycidb1c1=new set<id>();//set for contact
    list<kyc__c>kyclist=new list<kyc__c>();//1st list for kyc
    list<kyc__c>kyclist1=new list<kyc__c>();//2nd list for kyc
    list<account>acc=new list<account>(); //list for account
    list<contact>contactb1=new list<contact>();//list for contact
    list<kyc__c>kyclistcb1=new list<kyc__c>();//1st list for contact in kyc
    list<kyc__c>kyclistc1b1=new list<kyc__c>();// 2 nd list for  contact  inkyc
   
  if (!supporttoaccountupdatetrigger.hasAlreadyCreatedFollowUpTasks())
   {
   
   
        for(kyc__c k:trigger.new)
        {
            if(k.Billing_Address_1__c!=NULL)
           {
            kycidb1.add(k.Billing_Address_1__r.id);
            }
             if(k.Shipping_Address1__c!=NULL)
            kycids1.add(k.Shipping_Address1__c);
           
            if(k.Contact_Person_b1__c!=NULL)
            {
            kycidb1c1.add(k.Contact_Person_b1__r.id);
            }
           
         
        }
       
       
        // for billing 1 kyc
        kyclist=[select id,Billing_Street1__c,Billing_City_1__c,Billing_Country_1__c,Billing_State_Province1__c,Billing_Zip_Postal_Code1__c,Billing_Telephone_number1__c,Billing_Fax_number1__c from kyc__c where Billing_Address_1__c=:kycidb1];
       
        //for billing 1 conatact 1
       kyclistcb1=[select id,Contact_Person_Name_b1__c,Mobile_b1__c from kyc__c where Contact_Person_b1__r.id=:kycidb1c1];
       
        //contact for billing1
        contactb1=[select id,firstname,lastname,mobilephone from contact where id=:kycidb1c1];
       
         //account for billing 1                                                                  
        acc=[Select Id, BillingStreet,BillingState,Billingcity,BillingCountry,BillingPostalCode,Billing_Telephone_number__c,Billing_Fax_number__c,
                    ShippingStreet,ShippingCity,ShippingState,ShippingPostalCode,ShippingCountry,Shipping_Telephone_number__c,Shipping_Fax_number__c from Account where ID=:kycidb1] ; 
     
       
     
       
      //     billing 1  account
       
        for(kyc__c ky:kyclist)
        {
            for(account a:acc)
            {
                ky.Billing_Street1__c=a.BillingStreet;
                ky.Billing_City_1__c=a.billingcity;
                ky.Billing_Country_1__c=a.BillingCountry;
                ky.Billing_Zip_Postal_Code1__c=a.BillingPostalCode;
                ky.Billing_State_Province1__c=a.BillingState;
                ky.Billing_Telephone_number1__c=a.Billing_Telephone_number__c;
                //ky.Billing_Fax_number1__c=a.Billing_Fax_number__c;
               
                kyclist1.add(ky);
              
            }
        }    
       
        supporttoaccountupdatetrigger.setAlreadyCreatedFollowUpTasks();
               update kyclist1;
              
              
              
          //   for billing one in cantact  
              
         for(kyc__c kyc1:kyclistcb1)
         {
            for(contact c1:contactb1)
            {
                kyc1.Contact_Person_Name_b1__c=c1.firstname + ' ' +c1.lastname;
                kyc1.Mobile_b1__c=c1.MobilePhone;
               
                kyclistc1b1.add(kyc1);
              
            }
        }    
       
        supporttoaccountupdatetrigger.setAlreadyCreatedFollowUpTasks();
               update kyclistc1b1;
              
              
                                                                                                                               
}                                                                         

}


test class

:

@isTest
private class testupdatingadressdummy
{
 
 
  static testMethod void teSupdatingadress()
  {


        account a=new account(name='test',Region__c='East',BillingStreet='test',BillingState='assam',Billingcity='kolkata',BillingCountry='india',BillingPostalCode='1234',Billing_Telephone_number__c='9000853067',
                    ShippingStreet='parnapalli',ShippingCity='hyderabad',ShippingState='karnataka',ShippingPostalCode='12345',ShippingCountry='india',Shipping_Telephone_number__c='1234567890');
        insert a;
       
        Master_Product__c mp=new Master_Product__c(name='test name',Product_Code__c='c2');
        insert mp;
       
        contact c=new contact(firstname='Meenakshmi',lastname='Goswami',Designation__c='Developer',Accountid=a.id,mobilephone='900867657');
        insert c;

        Opportunity2__c op=new Opportunity2__c(Name='test1',Account__c=a.id,Master_Product__c=mp.id,Technical_Bid_date__c=date.Today(),Type_of_Business__c='Regular',Contact_Person__c=c.id);
        insert op;
    
        Opportunity_Product_Detail__c opd=new Opportunity_Product_Detail__c(Opportunity__c=op.id,Company__c=a.id,Quantity__c=1000,Height__c=12,Label_Height__c=12,Hologram_Height__c=14,Holographic_Film_Height__c=15,Multimax_Seal_Height__c=16,Sleeve_Height__c=90,Foil_Stamping_Height__c=17,Width__c=22,Label_Width__c=23,Foil_Width_for_Supplies__c=24,Hologram_Width__c=25,Holographic_Film_Width__c=27,Holographic_Strip_Width__c=28,Sleeve_Layflat_Width__c=29,Sleeve_Width__c=30,Foil_Stamping_Width__c=31,Make__c='ACR',Model__c='GT800');
        insert opd;
       
        Quote__c qt=new Quote__c(Opportunity_Product_Detail__c=opd.id,Purpose_of_Sales__c='SEZ',Basic_Price_Each_item__c=23,Declaration_form_be_provided__c='No',TTR_Height__c=13,TTR_Width__c=12);
        insert qt;
       
        Purchase_Order__c sco=new Purchase_Order__c(Quote__c=qt.id,Opportunity__c=op.id,New_Flash_Aidc_Email_sent__c='venky@globalnest.com');
        insert sco;
                               
       Kyc__c kc=new kyc__c();
        kc.Sale_Confirmation_Order__c=sco.id;
        kc.Contact_Person_b1__c=c.id;
        kc.Contact_Person_Name_b1__c='Meenakshmi Goswami';
        kc.Mobile_b1__c='900867657';
        kc.Email__c='abc@gmail.com';
        kc.Opportunity__c=op.id;
        kc.Billing_Street1__c='test';
        kc.Billing_City_1__c='kolkata';
        kc.Billing_Country_1__c='india';
        kc.Billing_State_Province1__c='assam';
        kc.Billing_Zip_Postal_Code1__c='1234';
        kc.Billing_Telephone_number1__c='9000853067';
      
       kc.Billing_Address_1__c=a.id;
        kc.Contact_Person_b1__c=c.id;
        kc.Shipping_Address1__c=a.id;
        kc.Billing_Address_3__c=a.id;
               insert kc;
    
                      }
        }
Hi,

I have 2 objects Invoice and Target,
In invoice object am stroing  inovice related details(this invoice details coming from tally and storing in salesforce invoice object)
in targer object am giving target to users(Monthly target,yearly target),
What i have to do is i need to create report linking with this 2 objects and i have to do some calculation and i  need to dispaly in report

example i need to show like this
User name             target              total invoice         result
 
 X                                200                    150                     -50

Y                                 300                     350                    +50

Z                                  200                     200                    0


can any one please tell me this is possible by standard way.
or i have to create vf page and i have to inclde in report,
can any one tell me best way to do this scenario

Thanks for your help.


Regards,
Venkatesh.

Hi,

Following is our requirement.

We have to build a functionality for target management in SFDC. The client needs to assign yearly and monthly targets for each of its users(30 in all) for all products(12 in number). It is assumed that targets are acheived when invoices are raised in the system. The invoice are basically tagged to Orders(Orders are child object to Quotes.)

Please provide some ideas on how to design the same.

Thanks for your help.

Regards
Venkatesh.

Hi ,
I have one opportunity for one opportunity i can add multiple products.

in my products i have one field descrption,for few products have same descrption .

ex : for one opportunity i added 9 products in this 9 products,3 have descption "AAA"

3  have descption "BBB"

3  have descption "CCC"

i have one preview pdf button in my opportunity for showing the all products details,

right now am fetching all the 9 products descrption in my pdf.
like this format

SR number                        descr

1        AAA
2        AAA
3        AAA
4        BBB
5        BBB
6        BBB
7        CCC
8        CCC
9        CCC


What i need to display in pdf is like this
SN       Description
1          AAA
2
3
4         BBB
5
6        
7         CCC
8
9


Advance Thanks for your help.

Regards
Venkatesh.
Hi
i have one schedular class am facing this problem from so many days but am not able to achive.
my query is not fetching any records but when i see in debug log its updating my old records.

My requirement is if user is not completed task with in 2 days i need to escalte this task to system admin

map<Id, User> crmusernewid =new map<Id, User>([SELECT Id, Name FROM User WHERE Asst_crm_user__c=true and Profile.Name IN ('System Admin')]);

listtask=[Select t.CreatedDate, t.Id, t.LastModifiedById, t.LastModifiedDate, t.OwnerId, t.Priority,
t.Status, t.Subject, t.WhatId, t.WhoId from Task t where Whatid=:CRID and Status='Not Started'  and Created_date__c=today and ActivityDate=null AND OwnerID IN :ID2User.keyset()];
system.debug('List of tasks that are not closed with in 3 days '+listtask);

am updating this way

public Map<id,task> listtask2=new Map<id,task>();

if(listtask.size()>0)
{
for(task t: listtask)
{
  for(user crm:crmusernewid.values())
{
t.OwnerId=crm.id;
listtask2.put(t.id,t);
}
}
}
update listtask2.values(); //updating the tasks


Thanks
Advance for your help
Hi
I have one trigger that updating activitydate
trigger GetUsableTaskDueDate on Task (before insert, before update)
{
Task[] checkTasks = Trigger.new;
  for(Task t : checkTasks)
  {
   t.Due_Date__c=t.ActivityDate;
   }
   }

I have scheduler class when i run my scheduler class in my query its fetching one record but when am updating its updating different records more than my query fecthing record am not able to undersatnd what is happing below is scheduler class please check any one tell me how can i do this.
I have one more doubt how many times trigger will call when am running scheduler class?



global with sharing class Task_Escalation_user_sys_created_dt_6 implements Schedulable
{

public List<Client_Requirement__c> clientreq2=new list<Client_Requirement__c>();

public Map<id,task> listtask4=new Map<id,task>();

public list<task> listtask3=new List<task>();

public set<id> sysid=new set<id>();

global void execute(SchedulableContext SC) {

try{

map<Id, User> user_id_sysadm = new map<Id, User>([SELECT Id, Name FROM User WHERE users_and_crm__c=true and Profile.Name IN ('East','Howrah','North and Central','Rajarhat','South I','South II','Newtown','System Admin')]);
system.debug('@@@@ include asst crm list users IDDDDD '+user_id_sysadm);

map<Id, User> crmuserid= new map<Id, User>([SELECT Id, Name FROM User WHERE Asst_crm_user__c=true and Profile.Name IN ('System Admin')]);
system.debug('@@@@  asst crm users IDDDDD '+crmuserid);


map<Id, User> syssernewid=new map<Id, User>([SELECT Id, Name FROM User WHERE Active_user__c=true and Profile.Name IN ('System Admin')]);
system.debug('@@@@ CRM system admin user IDDDDD '+syssernewid);

//--------------------------------------------------------------------------------------------------

clientreq2=[select id,name,RecordTypeid,Ownerid  from Client_Requirement__c];
system.debug('List of client requirement'+clientreq2);
for(Client_Requirement__c cr: clientreq2)
{
sysid.add(cr.id);// fetching the list of all client req IDS and ownerid='00590000001qNKB'
}
system.debug('list of idssss for system admin'+sysid);

// query for fetching the task that crm head user not completed the tasks
listtask3=[Select t.CreatedDate, t.Id, t.LastModifiedById, t.LastModifiedDate, t.OwnerId, t.Priority,
t.Status, t.Subject, t.WhatId, t.WhoId from Task t where whatid=:sysid and Status='Not Started' and Created_date_after_6_days__c=today and ActivityDate=null AND OwnerID IN :user_id_sysadm.keyset()];

system.debug('List of tasks that are not closed after 2 days '+listtask3);

if(listtask3.size()>0)
{
for(task t2: listtask3)
{
  for(user sysd1:syssernewid.values())
{

t2.OwnerId=sysd1.id;
// Assigning the system admin to the tasks that crm head user not completed

listtask4.put(t2.id,t2);
}
}
}

update listtask4.values();  // updating the tasks.
system.debug('List of tasks that are updated to user sysadmin head '+listtask4);
}catch(Exception e){system.debug('@@@@@@@@@@@@@@'+e);}
}
}


in my debug log its showing like this.

Query:

SOQL_EXECUTE_BEGIN|[36]|Aggregations:0|select t.CreatedDate, t.Id, t.LastModifiedById, t.LastModifiedDate, t.OwnerId, t.Priority, t.Status, t.Subject, t.WhatId, t.WhoId from Task t where (whatid = :tmpVar1 and Status = 'Not Started' and Created_date_after_6_days__c = today and ActivityDate = null and OwnerID = :tmpVar2)
SOQL_EXECUTE_END|[36]|Rows:1

USER_DEBUG|[39]|DEBUG|List of tasks that are not closed after 2 days (Task:{Status=Not Started, LastModifiedById=00590000001qNM7AAM, WhatId=a0N90000008OHtoEAG, Subject=Follow Up, OwnerId=00590000001qNKQAA2, CreatedDate=2014-01-25 08:04:06, LastModifiedDate=2014-01-27 10:30:02, Id=00T9000000dHsTXEA0, Priority=Normal})
SYSTEM_METHOD_EXIT|[39]|System.debug(ANY)

In Updating
10:00:02.047 (1047157000)|CODE_UNIT_FINISHED|GetUsableTaskDueDate on Task trigger event BeforeUpdate for [00T9000000dGZUu, 00T9000000dHaq1, 00T9000000dHcUq, 00T9000000dHdkb, 00T9000000dHe1k, 00T9000000dHeD8, 00T9000000dHewB, 00T9000000dHf0w, 00T9000000dHfAW, 00T9000000dHfPO, 00T9000000dHsTX]
10:00:02.181 (1181818000)|DML_END|[56]
10:00:02.181 (1181962000)|SYSTEM_METHOD_ENTRY|[57]|String.valueOf(Object)
10:00:02.182 (1182440000)|SYSTEM_METHOD_EXIT|[57]|String.valueOf(Object)
10:00:02.182 (1182458000)|SYSTEM_METHOD_ENTRY|[57]|System.debug(ANY)
10:00:02.182 (1182466000)|USER_DEBUG|[57]|DEBUG|List of tasks that are updated to user sysadmin head {00T9000000dGZUuEAO=Task:{Status=Not Started, LastModifiedById=00590000001qi8hAAA, WhatId=a0N90000006IPHUEA4, Subject=Call, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-23 06:04:31, LastModifiedDate=2014-01-23 06:04:31, Id=00T9000000dGZUuEAO, Priority=Normal}, 00T9000000dHaq1EAC=Task:{Status=Not Started, WhatId=a0N90000006IOihEAG, LastModifiedById=00590000001qNM7AAM, Subject=Call, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-24 10:06:54, LastModifiedDate=2014-01-24 10:07:09, Id=00T9000000dHaq1EAC, Priority=Normal}, 00T9000000dHcUqEAK=Task:{Status=Not Started, WhatId=a0N90000008OHEYEA4, LastModifiedById=00590000001qNM7AAM, Subject=Follow Up, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-24 10:29:03, LastModifiedDate=2014-01-24 10:31:30, Id=00T9000000dHcUqEAK, Priority=Normal}, 00T9000000dHdkbEAC=Task:{Status=Not Started, WhatId=a0N90000008OHIKEA4, LastModifiedById=00590000001qNM7AAM, Subject=Follow Up, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-24 10:46:09, LastModifiedDate=2014-01-24 10:50:06, Id=00T9000000dHdkbEAC, Priority=Normal}, 00T9000000dHe1kEAC=Task:{Status=Not Started, WhatId=a0N90000008OHK1EAO, LastModifiedById=00590000001qNM7AAM, Subject=Follow Up, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-24 11:24:12, LastModifiedDate=2014-01-24 11:27:04, Id=00T9000000dHe1kEAC, Priority=Normal}, 00T9000000dHeD8EAK=Task:{Status=Not Started, WhatId=a0N90000008OHJ3EAO, LastModifiedById=00590000001qNM7AAM, Subject=Follow Up, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-24 11:03:07, LastModifiedDate=2014-01-24 11:06:01, Id=00T9000000dHeD8EAK, Priority=Normal}, 00T9000000dHewBEAS=Task:{Status=Not Started, WhatId=a0N90000008OHKkEAO, LastModifiedById=00590000001qNM7AAM, Subject=Follow Up, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-24 11:50:25, LastModifiedDate=2014-01-24 11:53:14, Id=00T9000000dHewBEAS, Priority=Normal}, 00T9000000dHf0wEAC=Task:{Status=Not Started, WhatId=a0N90000008OHL0EAO, LastModifiedById=00590000001qNM7AAM, Subject=Follow Up, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-24 11:57:34, LastModifiedDate=2014-01-24 11:58:11, Id=00T9000000dHf0wEAC, Priority=Normal}, 00T9000000dHfAWEA0=Task:{Status=Not Started, WhatId=a0N90000008OHOwEAO, LastModifiedById=00590000001qNM7AAM, Subject=Follow Up, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-24 12:24:57, LastModifiedDate=2014-01-24 12:26:39, Id=00T9000000dHfAWEA0, Priority=Normal}, 00T9000000dHfPOEA0=Task:{Status=Not Started, WhatId=a0N90000008OHOcEAO, LastModifiedById=00590000001qNM7AAM, Subject=Follow Up, OwnerId=00590000001WzWyAAK, CreatedDate=2014-01-24 12:14:06, LastModifiedDate=2014-01-24 12:14:22, Id=00T9000000dHfPOEA0, Priority=Normal}, ...}
10:00:02.182 (1182491000)|SYSTEM_METHOD_EXIT|[57]|System.debug(ANY)
Hi

I need to know one thing its possible are not.
my client using salesforce what he need is,when he receive call from users to his mobile,with that mobile number i need to create lead in salesforce
It is possible or not,is there any app is there with that functionality.

Thanks for u r help

Regards
venkatesh
Hi
I written one Schedular class : assinging task to system admin
When user will create one client requirement record automatically one task is creating.if he is not completed with in 1 day am assining these task to system admin.

user is created one task he is not completed with in 1 day its assining to system admin.when system admin completed the task and he changed task status to complteds fine it,but in  next day when schedular class run the task status is changing again Not started .

Can any one tell me what is the wrong in my code

Thanks for your help

This is my code


global with sharing class Task_Esc_duedate_users_to_crm_user implements Schedulable
{
public List<Client_Requirement__c> clientreq=new list<Client_Requirement__c>();

public list<task> listtask=new List<task>();

map<id,task> listtask21=new map<id,task>();

public set<id> CRID=new set<id>();

global void execute(SchedulableContext SC) {


try
{
map<Id, User> Id2User = new map<Id, User>([SELECT Id, Name FROM User WHERE Profile.Name IN ('East','Howrah','North and Central','Rajarhat','South I','South II','Newtown')]);
map<Id, User> crmusernewid =new map<Id, User>([SELECT Id, Name FROM User WHERE Asst_crm_user__c=true and Profile.Name IN ('System Admin')]);
system.debug('asst crm user id'+crmusernewid);
clientreq=[select id,name,RecordTypeid,Ownerid  from Client_Requirement__c];
system.debug('List of all  client requirement'+clientreq);
for(Client_Requirement__c cr: clientreq)
{
CRID.add(cr.id);// fetching the list of all client req IDS
}

listtask=[Select t.CreatedDate, t.Id, t.LastModifiedById, t.LastModifiedDate, t.OwnerId, t.Priority,
t.Status, t.Subject, t.WhatId, t.WhoId,t.ActivityDate,t.Due_Date__c from Task t where Whatid=:CRID and Status='Not Started'  and  ActivityDate=YESTERDAY AND OwnerID IN :ID2User.keyset()];
system.debug('List of tasks that are not closed with in due date of all users '+listtask);


for(task t: listtask)
{
for(user crm:crmusernewid.values())
{

t.OwnerId=(crm.id);// Assigning the crm owner to the all the tasks

listtask21.put(t.id,t);
}
}

update listtask21.values(); //updating the tasks
system.debug('@@@@ List of tasks that are updated to user crm head '+listtask21);
}
catch(Exception e){system.debug('@@@@@@@@@@@@@@'+e);}
}
}


Regards
venkatesh
Am using salesforce developer free edition.

I have one email class i can send per a day 10 emails,after that am getting single limit is exceded.
Is there any way we can over come these email limit.?



Regards
venkatesh.
Hi
Am getting the this error "System.ListException: Duplicate id in list"
can any one please tell me,how to avoid this error
below is the my code.

global with sharing class Task_Esc_duedate_users_to_crm_user implements Schedulable
{
public List<Client_Requirement__c> clientreq=new list<Client_Requirement__c>();
public list<task> listtask=new List<task>();
public list<task> listtask2=new List<task>();
public set<id> CRID=new set<id>();
public list<user> crmusernewid=new list<user>();


global void execute(SchedulableContext SC) {
try
{
map<Id, User> Id2User = new map<Id, User>([SELECT Id, Name FROM User WHERE Profile.Name IN ('East','Howrah','North and Central','Rajarhat','South I','South II','Newtown')]);
crmusernewid =[SELECT Id, Name FROM User WHERE Active_user__c=false and Profile.Name IN ('System Admin')];

clientreq=[select id,name,RecordTypeid,Ownerid  from Client_Requirement__c];
system.debug('List of all  client requirement'+clientreq);
for(Client_Requirement__c cr: clientreq)
{
CRID.add(cr.id);// fetching the list of all client req IDS
}
listtask=[Select t.CreatedDate, t.Id, t.LastModifiedById, t.LastModifiedDate, t.OwnerId, t.Priority,
t.Status, t.Subject, t.WhatId, t.WhoId,t.ActivityDate,t.Due_Date__c from Task t where Whatid=:CRID and Status='Not Started'  and  ActivityDate=YESTERDAY AND OwnerID IN :ID2User.keyset()];
system.debug('List of tasks that are not closed with in due date of all users '+listtask);
for(task t: listtask)
{
for(user crm:crmusernewid)
{
t.OwnerId=crm.id;// Assigning the crm owner to the all the tasks
listtask2.add(t);
}
}
update listtask2; //updating the tasks
system.debug('@@@@ List of tasks that are updated to user crm head '+listtask2);
}
catch(Exception e){system.debug('@@@@@@@@@@@@@@'+e);}
}
}

Functionality is assiging the all users task to crm head user.after one day.

Regards
venkatesh
Hi
I have one picklist in opportunity
based on that picklist value i need to fetch the all products.
What i need is i need to create a button to search all products

Example: i craeted one opportunity with pick list value " Inernet banking "
when click on add products i need fetch all products  have inertnet banking
how can i do it can any one tell me.


Regards
Venkatesh.

Hi

Am getting this error SINGLE_EMAIL_LIMIT_EXCEEDED after sending 7 emails.

 

this my code can any one tell me where am missing.

its shwoing error on this line :Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

 

my code:

public with sharing class ctrlSendMailWithAttachmentg
{

    public String emailBody { get; set; }
    public String backURL{ get; set; }
    public String emailSubject { get; set; }

    //public ID parentId {get;set;}
    public String email { get; set; }
    public SFDC_Salary_History__c cRObj{get;set;}
    public Task task{get;set;}
    String emailId;
    public string clientEmail{get;set;}
    public string msg{get;set;}
    public Id parentId ;
   
    public ctrlSendMailWithAttachmentg()
    {
        cRObj = new SFDC_Salary_History__c();
        emailId = System.currentPagereference().getParameters().get('EmailId');
        
        email = emailId ;
        parentId = System.currentPagereference().getParameters().get('Id');        
        cRObj= [select  Employee_Email__c , id, name, Employee__r.id, Employee__r.name, Employee__r.Email_Address__c, Month__c,Year__c from SFDC_Salary_History__c where id=:parentId ];
         clientEmail=cRObj.Employee_Email__c ;
       
         system.debug('------20-------'+parentId );
         try
         {
            
            backURL='/'+parentId;
             
        }
        Catch(Exception ex)
        {
        }
         string cusname= cRObj.Employee__r.name;
            emailSubject='Payslip for '+cRObj.Month__c+', '+cRObj.Year__c;
            emailBody='Dear ' + cusname +', <br> <br>'+'Please find the attached Payslip of'+' '+cRObj.Month__c+','+cRObj.Year__c+'. If you have any additional questions, feel free to contact me directly.\n\n';
           
        
    }
public PageReference sendPdf()
    {
      
       
         Id parentId = System.currentPagereference().getParameters().get('Id');
         system.debug('------43-------'+parentId);
         
        
          if(clientEmail==null || clientEmail=='')
          {
                 ApexPages.addmessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please enter an email id in To field first'));
                 return null;
          }
           else
           {
             system.debug('------Client email id-------'+clientEmail);
                   
                PageReference pdf = Page.salarypage;
                pdf.getParameters().put('id',parentId);
                pdf.setRedirect(true);
                // the contents of the attachment from the pdf
                Blob body;
         
                try
                {
                  // returns the output of the page as a PDF
                  body = pdf.getContent();
                }
                catch (VisualforceException e)
                 {
                      body = Blob.valueOf('Internal Processing Error, Please Contact System Admin');
                 }
            
         //-----------------------------------------------------------------------------------------
                
                Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();
                attach.setContentType('application/pdf');
                attach.setFileName('Salary Slip');
                attach.setInline(false);
                attach.Body = body;
                
                List<Messaging.Emailfileattachment> efaList = new List<Messaging.Emailfileattachment>();
                efaList.add( attach );
                
                                String[] ccAddresses = new String[] {'xxx@gmail.com'};

              
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                mail.setUseSignature(false);
                mail.setToAddresses(new String[] { clientEmail  });
                mail.setCcAddresses(ccAddresses);
                mail.setSubject(emailSubject);
                mail.setHtmlBody(emailBody);
               
                mail.setFileAttachments(efaList );
             
            // Send the email
                Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
         
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'Email with PDF sent to '+email));
         
                return new PageReference('/'+parentId);
         }
  }

    
 

}

Hi ,
I have one opportunity for one opportunity i can add multiple products.

in my products i have one field descrption,for few products have same descrption .

ex : for one opportunity i added 9 products in this 9 products,3 have descption "AAA"

3  have descption "BBB"

3  have descption "CCC"

i have one preview pdf button in my opportunity for showing the all products details,

right now am fetching all the 9 products descrption in my pdf.
like this format

SR number                        descr

1        AAA
2        AAA
3        AAA
4        BBB
5        BBB
6        BBB
7        CCC
8        CCC
9        CCC


What i need to display in pdf is like this
SN       Description
1          AAA
2
3
4         BBB
5
6        
7         CCC
8
9


Advance Thanks for your help.

Regards
Venkatesh.
Hi
I written one Schedular class : assinging task to system admin
When user will create one client requirement record automatically one task is creating.if he is not completed with in 1 day am assining these task to system admin.

user is created one task he is not completed with in 1 day its assining to system admin.when system admin completed the task and he changed task status to complteds fine it,but in  next day when schedular class run the task status is changing again Not started .

Can any one tell me what is the wrong in my code

Thanks for your help

This is my code


global with sharing class Task_Esc_duedate_users_to_crm_user implements Schedulable
{
public List<Client_Requirement__c> clientreq=new list<Client_Requirement__c>();

public list<task> listtask=new List<task>();

map<id,task> listtask21=new map<id,task>();

public set<id> CRID=new set<id>();

global void execute(SchedulableContext SC) {


try
{
map<Id, User> Id2User = new map<Id, User>([SELECT Id, Name FROM User WHERE Profile.Name IN ('East','Howrah','North and Central','Rajarhat','South I','South II','Newtown')]);
map<Id, User> crmusernewid =new map<Id, User>([SELECT Id, Name FROM User WHERE Asst_crm_user__c=true and Profile.Name IN ('System Admin')]);
system.debug('asst crm user id'+crmusernewid);
clientreq=[select id,name,RecordTypeid,Ownerid  from Client_Requirement__c];
system.debug('List of all  client requirement'+clientreq);
for(Client_Requirement__c cr: clientreq)
{
CRID.add(cr.id);// fetching the list of all client req IDS
}

listtask=[Select t.CreatedDate, t.Id, t.LastModifiedById, t.LastModifiedDate, t.OwnerId, t.Priority,
t.Status, t.Subject, t.WhatId, t.WhoId,t.ActivityDate,t.Due_Date__c from Task t where Whatid=:CRID and Status='Not Started'  and  ActivityDate=YESTERDAY AND OwnerID IN :ID2User.keyset()];
system.debug('List of tasks that are not closed with in due date of all users '+listtask);


for(task t: listtask)
{
for(user crm:crmusernewid.values())
{

t.OwnerId=(crm.id);// Assigning the crm owner to the all the tasks

listtask21.put(t.id,t);
}
}

update listtask21.values(); //updating the tasks
system.debug('@@@@ List of tasks that are updated to user crm head '+listtask21);
}
catch(Exception e){system.debug('@@@@@@@@@@@@@@'+e);}
}
}


Regards
venkatesh

Hi 

Am doing salesforce to amazon integration 

when i upload data in salesforce it will store in amazon

for UI purpose what ever we are storing we are dispalying the uploaded file in salesforce visual force page and one down link

 

in the click of the download button we have to save the file in my system.

but now with my code when i click its opening in new window i can i save that file

 

am using these reference can any tel me where am missing

 

<a class="button Download chat" href="{!obj.objectURL}" target="_blank"  onclick='window.location.href="{!obj.objectURL}";return false;' ><span>Download &nbsp;</span></a>

 

 

regards

venkatesh

 

Hi
Am facing issue with deployment, am trying to deploy through ANT tool am not able to deploy its showing errors, But i tried the same with eclipse with out error its validated sucessfully,but through ANT am not able to deploy its showing error message "invalid cross reference id",I have to Deploy only through ANT.
Can any one faced same issue please let me know how to reslove Advance Thanks for your help.

Regards,
Venkatesh.
Hi,
I have a requirement parsing csv file into salesforce(insert and update.)
I have a date field called in Period Start Date (MM/DD/YYYY.)
But my client is giving me Date Format like this MARCH 2014,
So can anyone please guide me how to convert date filed into This format MARCH 2014,APRIL 2013
a.PeriodStart__c=date.ValueOf(inputvalues[10]);

Thanks for your help and guidance
Regards,
Venkatesh
Hi ,

I'm new to integration . Have referred Salesforce documents but didnt understood much . I do not know where to start , I have a requirement to integrate Salesforce with Amazon S3 . So if anyone can help me with the sample code will be very useful . 

Also nice blogs ,useful links for integrations if given would be great.


Thanks,
Marc.
Hi,

I have a requirement in that I want to save 100+ records at a time.

I am using Database.Insert(recordlist, false). If any of the record is failing during the insert (because of obj.AddError('enter name') in trigger) then i am caputuring the error from Database.SaveResult[].

Problem : If error (AddError() method ) is occured in trigger then it is displaying on the VF page as well. For validation rule it is not showing error on VF page. I don't want to show this error message, as i am generating result (success/fail) CSV file.

NOTE : I want <apex:pageMessages ></apex:pageMessages> on VF Page for other functionality on same page.

Thanks in advance.

VF page

<apex:page standardController="Account" extensions="DatabaseInsertPOCExt">
<apex:pageMessages ></apex:pageMessages>
<apex:form >
    <apex:pageBlock title="Account Insert">
        <apex:pageBlockButtons >
            <apex:commandButton value="Insert Account" action="{!insertAccount}"/>
        </apex:pageBlockButtons>
    </apex:pageBlock>
</apex:form>

</apex:page>

Controller

public with sharing class DatabaseInsertPOCExt
{
    public DatabaseInsertPOCExt(ApexPages.StandardController controller)
    {
       
    }

    public void insertAccount()
    {
        try
        {
            list<Account> accList = new list<Account>();
            for(integer i = 0; i < 3; i++)
            {
                Account a = new Account();
                a.name = 'omkar - ' + string.valueof(i);
                a.City__c = 'Pune-'+ string.valueof(i);
                accList.add(a);
            }
           
            Database.SaveResult[] sr = Database.insert(accList, False);
           
            for(Database.SaveResult s : sr)
            {
                system.debug('error--------->'+s.getErrors());
            }
        }
        catch(exception ex)
        {
            system.debug('ex---------->'+ex);
        }
    }
}

Trigger
trigger testTriggerAccount on Account (before insert, before update)
{
    for(Account a : Trigger.new)
    {
        if(a.City__c =='Pune-1')
        {
            a.addError('Other city plz');
        }
    }
}
Hi,

I have 2 objects Invoice and Target,
In invoice object am stroing  inovice related details(this invoice details coming from tally and storing in salesforce invoice object)
in targer object am giving target to users(Monthly target,yearly target),
What i have to do is i need to create report linking with this 2 objects and i have to do some calculation and i  need to dispaly in report

example i need to show like this
User name             target              total invoice         result
 
 X                                200                    150                     -50

Y                                 300                     350                    +50

Z                                  200                     200                    0


can any one please tell me this is possible by standard way.
or i have to create vf page and i have to inclde in report,
can any one tell me best way to do this scenario

Thanks for your help.


Regards,
Venkatesh.

Hi
i have one schedular class am facing this problem from so many days but am not able to achive.
my query is not fetching any records but when i see in debug log its updating my old records.

My requirement is if user is not completed task with in 2 days i need to escalte this task to system admin

map<Id, User> crmusernewid =new map<Id, User>([SELECT Id, Name FROM User WHERE Asst_crm_user__c=true and Profile.Name IN ('System Admin')]);

listtask=[Select t.CreatedDate, t.Id, t.LastModifiedById, t.LastModifiedDate, t.OwnerId, t.Priority,
t.Status, t.Subject, t.WhatId, t.WhoId from Task t where Whatid=:CRID and Status='Not Started'  and Created_date__c=today and ActivityDate=null AND OwnerID IN :ID2User.keyset()];
system.debug('List of tasks that are not closed with in 3 days '+listtask);

am updating this way

public Map<id,task> listtask2=new Map<id,task>();

if(listtask.size()>0)
{
for(task t: listtask)
{
  for(user crm:crmusernewid.values())
{
t.OwnerId=crm.id;
listtask2.put(t.id,t);
}
}
}
update listtask2.values(); //updating the tasks


Thanks
Advance for your help
Hi
Am getting the this error "System.ListException: Duplicate id in list"
can any one please tell me,how to avoid this error
below is the my code.

global with sharing class Task_Esc_duedate_users_to_crm_user implements Schedulable
{
public List<Client_Requirement__c> clientreq=new list<Client_Requirement__c>();
public list<task> listtask=new List<task>();
public list<task> listtask2=new List<task>();
public set<id> CRID=new set<id>();
public list<user> crmusernewid=new list<user>();


global void execute(SchedulableContext SC) {
try
{
map<Id, User> Id2User = new map<Id, User>([SELECT Id, Name FROM User WHERE Profile.Name IN ('East','Howrah','North and Central','Rajarhat','South I','South II','Newtown')]);
crmusernewid =[SELECT Id, Name FROM User WHERE Active_user__c=false and Profile.Name IN ('System Admin')];

clientreq=[select id,name,RecordTypeid,Ownerid  from Client_Requirement__c];
system.debug('List of all  client requirement'+clientreq);
for(Client_Requirement__c cr: clientreq)
{
CRID.add(cr.id);// fetching the list of all client req IDS
}
listtask=[Select t.CreatedDate, t.Id, t.LastModifiedById, t.LastModifiedDate, t.OwnerId, t.Priority,
t.Status, t.Subject, t.WhatId, t.WhoId,t.ActivityDate,t.Due_Date__c from Task t where Whatid=:CRID and Status='Not Started'  and  ActivityDate=YESTERDAY AND OwnerID IN :ID2User.keyset()];
system.debug('List of tasks that are not closed with in due date of all users '+listtask);
for(task t: listtask)
{
for(user crm:crmusernewid)
{
t.OwnerId=crm.id;// Assigning the crm owner to the all the tasks
listtask2.add(t);
}
}
update listtask2; //updating the tasks
system.debug('@@@@ List of tasks that are updated to user crm head '+listtask2);
}
catch(Exception e){system.debug('@@@@@@@@@@@@@@'+e);}
}
}

Functionality is assiging the all users task to crm head user.after one day.

Regards
venkatesh
Hi
I have one picklist in opportunity
based on that picklist value i need to fetch the all products.
What i need is i need to create a button to search all products

Example: i craeted one opportunity with pick list value " Inernet banking "
when click on add products i need fetch all products  have inertnet banking
how can i do it can any one tell me.


Regards
Venkatesh.

i'm new in creating scheduled jobs, i tried creating one and it worked. but can anyone help me how to create a test class for this?
this is the code:

global class automaticReportCreation implements Schedulable {

    global void execute(SchedulableContext arc) {
        Date dateToday = system.Today();
        Integer month = dateToday.month();
        Integer year = dateToday.year();
       
        Date firstDayOfMonth = System.today().toStartOfMonth();
        Date firstOfMonth = date.newinstance(year, month, 1);
        Date upToDate = date.newinstance(year, month, 15);
       
        Sales_Report__c createReport = new Sales_Report__c();
        createReport.Date_From__c = firstOfMonth;
        createReport.Date_To__c = upToDate;
       
        insert createReport;
    }
}

this code automatically creates new records every first day of the month. how can i test this code? help.

  • December 23, 2013
  • Like
  • 0

Hi

 

i have one custom button to send email. its working fine.

I have one email field.

 

what i have to do is in my email field if i give like this

test@gmail.com,test1@gmail.com,test2@gmail.com,test3@gmail.com

i need to send email to all emails i provided in the email field

 

Is this possibel in salesforce

can any one tell me how can i achive this

 

 

Regards

venkatesh.

Hi

I have 2 objects, purchase order(parent) and callup orders(child) lookup relation

 

in my parent object there is field called quantity

for one parent object i can create money child object,

in child object there is one field call up order,here i can enter the quantity ,

what i have to do is,if quantity cross more in my child object i need through error,

and i need to show balance in one field

right now am able to show error messag but am not able to shw balance

can u please tell me where am missing this is the my trigger

 

 

trigger Total_callup_order_Quantity on Call_Up_Order__c (after insert,after update)
{
   
    set<id> saleid=new set<id>();
    List<Call_Up_Order__c> calup=new List<Call_Up_Order__c>();
    
    if(trigger.isInsert || trigger.isUpdate)
    {
        for(Call_Up_Order__c co:trigger.new)
        {
             system.debug('-------Quote Quantity-------'+co.Quote_Quantity__c);
            saleid.add(co.Sale_Confirmation_Order__c);
        }
    }
    calup=[select id,Quote_Quantity__c,Balance_qty__c,Opp_pdt_detail_Quantity__c,Sale_Confirmation_Order__c,Call_Up_Quantity__c from Call_Up_Order__c  where Sale_Confirmation_Order__c in:saleid];
    
    system.debug('@@@@@@@@@!!!!!!!!!'+calup);
    decimal sum=0;
    decimal sum1=0;
    for(Call_Up_Order__c cp:calup)
    {
    
        sum=sum+cp.Call_Up_Quantity__c;
        
        
        if(cp.Sale_Confirmation_Order__c !=null)
        {
       cp.Balance_qty__c=cp.Quote_Quantity__c-sum;
            
        }
        system.debug('balnace qty m'+cp.Balance_qty__c);
        system.debug('@@@@@@@@@@@@ summmmm'+sum);
        if(sum >cp.Quote_Quantity__c)
        {
            system.debug('@@@@@@@@@');
            Trigger.New[0].adderror('you can not add more Quantity');
        }
    }
}

 

 

regards

venkatesh

I got the AmazonS3.wsdl from http://s3.amazonaws.com/doc/2006-03-01/AmazonS3.wsdl. But I get error meesage:

 

Error: Failed to parse wsdl: Unsupported Schema element found http://www.w3.org/2001/XMLSchema:include. At: 13:51

 

always!  Can some one post the apex for this wsdl if they have it ?

 

Thanks

Rao

  • October 18, 2010
  • Like
  • 0

I got the AmazonS3.wsdl from http://s3.amazonaws.com/doc/2006-03-01/AmazonS3.wsdl. But I get error meesage:

 

Error: Failed to parse wsdl: Unsupported Schema element found http://www.w3.org/2001/XMLSchema:include. At: 13:51

 

always! How do I fix this ? Lots of people seem to have done something to work around this issue.

 

Thanks

Rao

  • October 17, 2010
  • Like
  • 0

Hi,

 

I need all inbound and outbound email to be automated logged on contacts, accounts, leads, cases and opportunities if there is found an email address on one of the above modules which matches the inbound or outbound email.

 

What are the ways to implement this?

 

Thanks,