• Srinivas C
  • NEWBIE
  • 0 Points
  • Member since 2020
  • Salesforce Developer
  • Cognizant

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 6
    Replies
Hello , when ever dated exchange rates created or changed on daily basis, need to create custom object records based on the conversion rates, please help me how to achieve this,
regards,
srinivas
public class SupplierAccountListController {
    Public Integer size{get;set;} 
    Public Integer noOfRecords{get; set;} 
    public List<SelectOption> paginationSizeOptions{get;set;}
    
    public SupplierAccountListController(){
        size=10;
        paginationSizeOptions = new List<SelectOption>();
        paginationSizeOptions.add(new SelectOption('5','5'));
        paginationSizeOptions.add(new SelectOption('10','10'));
        paginationSizeOptions.add(new SelectOption('20','20'));
        paginationSizeOptions.add(new SelectOption('50','50'));
        paginationSizeOptions.add(new SelectOption('100','100'));
    }
    
    public ApexPages.StandardSetController ssc {
        get {
            if(ssc == null) {
                ssc = new ApexPages.StandardSetController(Database.getQueryLocator(
                    [SELECT Id, Name, AccountNumber ,
                     BillingStreet, BillingCity, BillingState, BillingCountry,
                     (SELECT Id,Email,Phone,FirstName,LastName 
                      FROM Contacts),
                     (SELECT Id, Sub_Category__c ,Commodity_Menu__c,Broad_Scope__c ,Commodity_Details__c  
                      FROM Suppliers_Introduction__r)
                     FROM Account]));
            }
            ListView l =[SELECT Id FROM ListView WHERE DeveloperName='USA_ACTIVE_SUPPLIER_ACCOUNTS'];
            ssc.setFilterId(l.Id);
            ssc.setPageSize(size);  
            noOfRecords = ssc.getResultSize();
            return ssc;
        }
        set;
    }
    
    public List<Account> getAccounts() 
    {
        return (List<Account>)ssc.getRecords();
    }
    public PageReference refreshPageSize() {
        ssc.setPageSize(size);
        return null;
    }
}
newEngagement = new Projects__c(Account__c = opp.Account_Name__c, Opportunityc__c = opp.Id, Name = opp.Name + ' - ' + System.today().format(),Project_Manager__c=opp.Project_Manager_list__c,End_Date__c=opp.End_Date__c);
        

list<Projects__c> upEngagement=[select id,name from Projects__c where id in: templateIds];
            newEngagement.Estimated_Project_Revenue__c = totalAmount;
            for(Projects_ESR__c templist:upEngagement)
            {
                system.debug('templateIds'+templatename);
                templatename+=templist.Name+',';
            }
            templatename=templatename.removeEnd(',');
            newEngagement.Template_Project__c=templatename;
            
            
            salesres=[select id,name,Sales_Responsible_Name__c,Email from user where Sales_Responsible_Name__c!=null and Sales_Responsible_Name__c=:newEngagement.Project_Manager__c];//'Anthony Kent'];//opp.Sales_Responsible__c];// id=:sales];
            if(salesres.size()>0){
                
                
                newEngagement.Sales_responsible_email__c=salesres[0].email;
            }
            newEngagement.Total_Sales_Price__c=opp.Total_Sales_Price__c;
            newEngagement.Labour_Cost__c=opp.Labour_Cost__c;
            newEngagement.External_Cost__c=opp.External_Cost__c;
            newEngagement.Contingency_Cost__c=opp.Contingency_Cost__c;
            
            insert newEngagement;
                        PageReference pr = new PageReference('/' + newEngagement.Id);
            pr.setRedirect(true);
            return pr;
        }

Regards,
Srinivas C
Please correct me,

public class SendReminderMail{ 
    public void approveRecord(){
        list<Change_Order__c> coList=[select id,Name,Submitted_Date__c 
                                                           from Change_Order__c limit1];
        List<ProcessInstance> PI = [Select Id,TargetObjectId FROM ProcessInstance WHERE TargetObjectId=:coList AND Status='Pending'];  
 if(PI.size() > 0)  
 {  
  List<ProcessInstanceWorkitem> PIWI = [Select Id ,ActorId,Actor.Name,Actor.Email FROM ProcessInstanceWorkitem WHERE ProcessInstanceId=:PI[0].Id];  
  if(PIWI.size() > 0)  
  {  
   Approval.ProcessWorkitemRequest req2 = new Approval.ProcessWorkitemRequest();  
   req2.setComments('Approving request.');  
   req2.setAction('Approve');  
   req2.setNextApproverIds(new Id[] {UserInfo.getUserId()});  
   req2.setWorkitemId(PIWI[0].Id);  
   Approval.ProcessResult result2 = Approval.process(req2);  
  }  
 }
    }
Hi, how to send automatic emails from batch apex, when approval record is pending, for approving the record.
I have a approval process ,
if status is pending need to send auto email to assigned user for remainding not approved,
after 24hrs after the remainder mail sent, if the status still pending then that record should be auto approved and send email that record approved.
please help is it possible through shcedule apex ? or any other possibility.
if yes please help me out with the logic,
thanks,
Hi, how to query Assigned To, Actual Approver from approval process and
if the status is pending need to send auto email to assigned user for remainding not approved,
after 24hrs after the remainder mail status still pending then that record should be auto approved and send email that record approved.

thanks,
srinivas
Hi,
I have standard objects Lead, Account, Contact and
custom object Opportunity__c , after the lead conversion need to create records in account , contact and custom opportunity records.
please help me out in the solution with the required code.

thanks,
srinivas 
I have a custom object called Task__c,task records will be assigned to contacts or resources
when they are done with the assigned task (from and to date with time will be entered by them who is working),

requirment:(Only)task name and Date with working hours should be shown in calendar of a particular task instead of object records.

Thanks,
I have a custom object called Task__c,task records will be assigned to contacts or resources
when they are done with the assigned task (from and to date with time will be entered by them who is working),

requirment:(Only)task name and Date with working hours should be shown in calendar of a particular task instead of object records.


Thanks,
Srinivas
User-added image need to show list of tasks in vf or lightning please suggest how to get this interface .to the right calendar this should have a field should update 8 hours per day so should show all the working hours. got stuck how to get this interface in vf .


Thanks,
srinivas
want a date picker in visualforce " fri 25-09-2020 " please suggest 

Thanks & Regards,
Srinivas.
pardot prospect should redirect to customer  center agency profile without redirecting to otherr profile moving to lead in salescloud
User-added imageUser-added image
global class ForeignExchangeBatch implements Database.Batchable<sObject>, Database.Stateful {
    
    global Database.QueryLocator start(Database.BatchableContext bc) {
        String der='SELECT Id,ConversionRate,IsoCode FROM DatedConversionRate where startDate=today AND CreatedDate = TODAY ';
        return Database.getQueryLocator(der);
          
    }
    global void execute(Database.BatchableContext bc, List<DatedConversionRate> scope){
        List<foreign rate__c> exchangeList = new List<foreign rate__c>();
        for(DatedConversionRate dCR: scope){
            foreign rate__c foreignExchange = new foreign rate__c();
            foreignExchange.foreign rate__c_exchrate__c = dCR.ConversionRate;
            foreignExchange.foreign rate__c_desc__c = 'Change in Currency Exchange Rate';
            foreignExchange.foreign rate__c_schedtype__c = 'Current Spot Rate';
            foreignExchange.foreign rate__c_foreigncurr__c =dCR.IsoCode;
            foreignExchange.foreign rate__c_funccurr__c=dCR.IsoCode;
            foreignExchange.foreign rate__c_frmdate__c =system.today();
            foreignExchange.foreign rate__c_thrudate__c=system.today();
            foreignExchange.foreign rate__c_inactive__c=false;
            
            foreignExchange.foreign rate__c_cmpno__c = 'company1';
            exchangeList.add(foreignExchange);
            
            foreign rate__c exchangeforcompany2 = foreignExchange.clone();
            exchangeforcompany2.foreign rate_cmpno__c ='company2';
            exchangeList.add(exchangeforcompany2);
            
            foreign rate__c exchangeforcompany3 = foreignExchange.clone();
            exchangeforcompany3.foreign rate__c_cmpno__c = 'company3';
            exchangeList.add(exchangeforcompany3);
            
            foreign rate__c exchangeforcompany4 = foreignExchange.clone();
            exchangeforcompany4.foreign rate_cmpno__c = 'company4';
            exchangeList.add(exchangeforcompany4);
            
            foreign rate__c exchangeforcompany5 = foreignExchange.clone();
                        exchangeforcompany5.foreign rate_cmpno__c = 'company5';
            exchangeList.add(exchangeforcompany5);
        }
        insert exchangeList;
 
    }    
    global void finish(Database.BatchableContext bc){
        
    }    
}
Hi, how to send automatic emails from batch apex, when approval record is pending, for approving the record.
Hi, how to query Assigned To, Actual Approver from approval process and
if the status is pending need to send auto email to assigned user for remainding not approved,
after 24hrs after the remainder mail status still pending then that record should be auto approved and send email that record approved.

thanks,
srinivas
I have a custom object called Task__c,task records will be assigned to contacts or resources
when they are done with the assigned task (from and to date with time will be entered by them who is working),

requirment:(Only)task name and Date with working hours should be shown in calendar of a particular task instead of object records.

Thanks,
User-added image need to show list of tasks in vf or lightning please suggest how to get this interface .to the right calendar this should have a field should update 8 hours per day so should show all the working hours. got stuck how to get this interface in vf .


Thanks,
srinivas
want a date picker in visualforce " fri 25-09-2020 " please suggest 

Thanks & Regards,
Srinivas.
I was wondering if it is possible to call the new(ish) enhanced Lead conversion process with a Flow. Specifically, I would like to replace the Convert button in Lightning with a custom buitton that calls a Flow, evaluates the record, requires various input or actions based on variables with the record and then completes by presenting the "standard" Convert process. Has anyone done this?