• Lakshmi S
  • SMARTIE
  • 514 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 6
    Likes Received
  • 0
    Likes Given
  • 106
    Questions
  • 86
    Replies
I am not getting any selectd options in the SelectOption list to show on my Visual Force page. Beow is the VF snippet and controller.

Example
public class sampleConSubmissions {
    
     String[] submissions = new String[]{};

    public sampleConSubmissions(ApexPages.StandardController controller) {

    }
        
            
        public PageReference test() {
            return null;
        }
            
        public List<SelectOption> getItems() {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('TR00025712016 - Umbr only','TR00025712016 - Umbr only'));
            options.add(new SelectOption('TR00028982016 - Casualty','TR00028982016 - Casualty'));
            options.add(new SelectOption('TR18622016 - Casualty','TR18622016 - Casualty'));
            options.add(new SelectOption('TR20612016 - Property','TR20612016 - Property'));
            return options;
        }
            
        public String[] getsubmissions() {
            return submissions;
        }
            
        public void setsubmissions(String[] submissions) {
            this.submissions = submissions;
        }
    }
 
<apex:selectList value="{!submissions}" multiselect="true">
            <apex:selectOptions value="{!items}"/>
        </apex:selectList><p/>

        <apex:commandButton value="Select Submissions" action="{!test}" rerender="out" status="status"/>
    

    <apex:outputPanel id="out">
        <apex:actionstatus id="status" startText="testing...">
            <apex:facet name="stop">
                <apex:outputPanel >
                    <p>You have selected:</p>
                    <apex:dataList value="{!submissions}" var="c">{!c}</apex:dataList>
                </apex:outputPanel>
            </apex:facet>
        </apex:actionstatus>
    </apex:outputPanel>

 
Hi Team,

I want to assign the different visualforce pages to different profiles or different record types on Same object.

Please let me know any one...

Thanks
Lakshmi
Hi Team,

How we can do the Report Scheduler SFTP configuration in Salesforce ?
Does Report Scheduler support authentication by public/private keys?
How do we generate the key pair / public key?

Please let me know any one...

Regards,
Lakshmi
Hi Team,

I am creating a button in opportunity record detail page.from here i am redirecting one visualforce page to another visualforce page after clicking button.
It's taking some time for redirecting. How can we resolve this performance issue?
(Requirement : Open child object record edit page with pre-populated values from Opportunity using button. For i have created two vf pages and controllers. From first page i have redirect to second page with opportunity record id, here i am using child object standard controller).
Note : I tried using URL hacking, but it is not working in Lightning. After that i did this using VF pages. Please let me know any alternative solutions.

Thanks,
Lakshmi.

Please let me know how to resolve this issue ?
 
Hi Team,
How to redirect the visualforce page to record detail page after clicking on Cancel Button ?

Controller Class
-------------------------
public with sharing class ControllerClass {
    
    public static String oppid;
    
    private ApexPages.StandardController sc{get;set;}
    public Opportunity opp = new Opportunity();
    public ControllerClass(ApexPages.StandardController sc){
        this.sc = sc;
        oppid = ApexPages.currentPage().getParameters().get('oppid');
        //system.debug('------'+oppid);
        opp =[select id,name,Account.name from Opportunity where id =:oppid limit 1];
 
    }
    }
    
    Public PageReference Cancel(){
        PageReference pr = new PageReference('/'+Schema.SObjectType.Opportunity.getKeyPrefix()+'/o');
        return pr;
        }

}
How to redirect this page to opportunity record detail page.
Please let me know any one.

Regrds
Lakshmi
 
Hi Team,

How to write test class for below code.
Controller
-----------------
public with sharing class TPipelineControllerClass {
    
    public static String oppid;
    
    public X360_Pipeline__c pipeline{get;set;}
    private ApexPages.StandardController sc{get;set;}
    public Opportunity opp = new Opportunity();
    public TPipelineControllerClass(ApexPages.StandardController sc){
        this.sc = sc;
        oppid = ApexPages.currentPage().getParameters().get('oppid');
        //system.debug('------'+oppid);
        opp =[select id,name,Account.name from Opportunity where id =:oppid limit 1];
        //system.debug('---'+hr.Name);
        //system.debug('---'+hr.Account.Name);
        pipeline = new X360_Pipeline__c();
        pipeline.Name = opp.Name;
        //system.debug('-------pipeline.Name'+pipeline.Name);
        pipeline.Account_Name__c= opp.AccountId;
        pipeline.Opportunity_Name__c = opp.Id;
    }
    
    public PageReference save(){
        try{
            insert pipeline;
            return new PageReference('/'+pipeline.Id);
        }catch(Exception ex){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, ex.getMessage()));
            return null;
        }
        
        
    }
    
    Public PageReference Cancel(){
        PageReference pr = new PageReference('/'+Schema.SObjectType.Opportunity.getKeyPrefix()+'/o');
        return pr;
        }

}
Test Class :
----------------
@isTest
public class TestTPipelineControllerClass {
    
    @isTest
    private static void test360Pipeline(){
        Test.startTest();
        
        PageReference pr = Page.TPipelineVFPage;
        Test.setCurrentPage(pr);
        
        Opportunity op = new Opportunity();
        try{
            Account acc = new Account(Name='Dummy Account');
            	insert acc;
        	
                op.Name = 'Dummy Oppty';
                op.AccountId = acc.Id;
                op.Lead_Country__c = 'India';
                op.Region__c = 'APAC';
                op.CloseDate = Date.newInstance(2018, 02, 20);
                op.ForecastCategoryName = 'Best Case';
                op.StageName = 'Red Zone / Awarded';
                op.Probability = 90;
                op.Category__c = 'Red Zone / Awarded, Negotiating Contract';
            insert op;
            X360_Pipeline__c pipe = new X360_Pipeline__c();
            pipe.Name = op.Name;
            pipe.Opportunity_Name__c = op.Id;
            pipe.Account_Name__c = op.AccountId;
            insert pipe;  
            
            pr.getParameters().put('id',pipe.Id);
        
            ApexPages.StandardController sc = new ApexPages.StandardController(pipe);
            TPipelineControllerClass pipeline = new TPipelineControllerClass(sc);
            
            pipeline.save();
            pipeline.Cancel();
        
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
        }
        
        System.assert(true);
        System.assertNotEquals(Null, op.id);
        
        Test.stopTest();
    }

}
Can any one please help me how to write test class.

Thanks
Lakshmi

 
Hi Team,

We have overiding Standard functionalities New and Edit using Visualforce pages. I want to display the pdf file link in New and Edit pages (we are storing pfd file in Static Resources).

Please let me know , how can we do this?

Thanks
Lakshmi
 
Hi Team,

In visualforce page i have created one pageblock section. Is it possible to hide this pageblock in lightning view.


please let me know anyone.

Thanks.
Lakshmi
 
HI Team,
Need test class for below trigger.
trigger HRSFHistoryTracker on High_Risk_Success_Factors__c (after update) {
    
    if(checkRecursive.runOnce()){
        
        try{
            
            Set<Id> userIds = new Set<Id>();
            for(High_Risk_Success_Factors__c hrsf : trigger.new){
                userIds.add(hrsf.CreatedById);
            }
            Map<Id,User> userMap = new Map<Id,User>([Select id,name,userrole.name from User where id in :userIds]);
            
            final List<Schema.FieldSetMember> trackedFields = SObjectType.High_Risk_Success_Factors__c.FieldSets.HRSF_History_Tracking.getFields();
            if(trackedFields.isEmpty())
                return;
            
            final List<HRSF_History_Tracking__c> fieldChanges = new List<HRSF_History_Tracking__c>();
            if(!trigger.isUpdate)
                return;
            
            for(High_Risk_Success_Factors__c newHRSF : trigger.new){
                
                final High_Risk_Success_Factors__c oldHRSF = trigger.oldmap.get(newHRSF.Id);
                
                for(Schema.FieldSetMember fsm : trackedFields){
                    
                    String fieldName = fsm.getFieldPath();
                    String fieldLabel = fsm.getLabel();
                    
                    if(newHRSF.get(fieldName) == oldHRSF.get(fieldName))
                        continue;
                    String oldValue = String.valueOf(oldHRSF.get(fieldName));
                    String newValue = String.valueOf(newHRSF.get(fieldName));
                    
                    if(oldValue != null && oldValue.length()>255)
                        oldValue = oldValue.substring(0, 255);
                    
                    if(newValue != null && newValue.length()>255)
                        newValue = newValue.substring(0,255);
                    
                    final HRSF_History_Tracking__c hrsfHistory = new HRSF_History_Tracking__c();
                    
                    hrsfHistory.Name = fieldLabel;
                    hrsfHistory.APIName__c = fieldName;
                    hrsfHistory.RecordId__c = newHRSF.Id;
                    hrsfHistory.High_Risk_Success_Factor_Name__c = newHRSF.Name;
                    hrsfHistory.ChangedBy__c = userMap.get(newHRSF.CreatedById).userrole.name;
                    hrsfHistory.OldValue__c = oldValue;
                    hrsfHistory.NewValue__c = newValue;
                    hrsfHistory.HRSF_Owner_Name__c= userMap.get(newHRSF.CreatedById).Name;
                    
                    fieldChanges.add(hrsfHistory);
                }
            }
            if(!fieldChanges.isEmpty()){
                insert fieldChanges;
            }
            
        }
        Catch(Exception ex){
            ApexPages.addMessages(ex);
        }

    }
}
Can anyone please let me know how to write the Test Class.

Thaks
Lakshmi.
 
 
Hi Team,

How we can do Field Histroy Tracking using Apex classes and display the results in a Report?

Can any one please let me know how we can dot this......


Thanks.
Lakshmi
 
Hi Team,

I haveuploaded a ppt document in static resources.
I want to create formula field and display the link which we have uploaded in static resources.

please let me know how can we do this?


Thanks
Lakshmi.
 
Hi Team,

Visualforce new notes related list componet not working in Lightning.
<apex:relatedList subject="{!High_Risk_Success_Factors__c}" list="CombinedAttachments" />

Please let me know, how can we do this in lightning.

Thanks
Lakshmi
Hi Team,

We are using chrome extension - Mass Editor.
For admin it is working fine, for users it shows error like...
Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. For more information, see Insufficient Privileges Errors. 


How can we resolve this issue, please let me know...

Thanks
Lakshmi
Hi Team,

I am converting phone number from excel to csv the format is changing, how can we resolve this?

+91-9900453436 this number changed to like this -9900453345.

please any one let me know , how can i resolve this?


Thanks.
Lakshmi
HI Team,

Visualforce Error :
System.QueryException: List has no rows for assignment to SObject.
 
<apex:page standardController="High_Risk_Success_Factors__c" sidebar="true" tabStyle="Account" extensions="HighRiskSuccessFactorsDetailCls" >
    <apex:form >
        <apex:pageBlock title="Success Factors Details">
            
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!Save}" id="saveButton" style="display:none;"  />
                <apex:commandButton value="Edit" action="{!Edit}" id="editButton" />
                <apex:commandButton value="Delete" action="{!Delete}" onclick="if(!confirm('Are you sure?')){return false};" id="deleteButton" />
                <apex:commandButton value="Clone" action="{!doClone}" id="cloneButton" />
               <apex:commandButton value="Cancel" action="{!doCancel}" id="cancelButton" immediate="true" style="display:none;" />
                
            </apex:pageBlockButtons>
            <apex:pageMessages ></apex:pageMessages>
<apex:pageBlock>
<apex:form>
<apex:page>
public with sharing class HighRiskSuccessFactorsDetailCls {
    
    public boolean bool {get;set;}
    Private ApexPages.StandardController controller {get;set;}
    
    
    public HighRiskSuccessFactorsDetailCls(ApexPages.StandardController controller){
        bool = false;
        this.controller=controller;
       
    }
   
    public PageReference save(){
        try{
            controller.save();
            PageReference pr = Page.HighRiskSuccessFactorsDetailPage;
            pr.setRedirect(true);
            pr.getParameters().put('id',controller.getId());
            return pr;
        }catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
            return null;
        }
    }
    
   public PageReference doClone(){
       PageReference pr;
       try{
           if(controller.getId() != null)
           pr = Page.HighRiskSuccessFactorsClonePage;
           pr.getParameters().put('id',controller.getId());
           return pr;
       }
       catch(Exception e){
           ApexPages.addMessages(e);
           return null;
       }
        
    } 
    
    
        Public PageReference doCancel(){
            
            PageReference pr = new PageReference('/'+Schema.SObjectType.High_Risk_Success_Factors__c.getKeyPrefix()+'/o');
            return pr;

        }

}
If we click on clone button, if record is not available it shwos above error.
How can we handle these type of errors for vf pages.

Thanks
Lakshmi

 
Hi Team,

Requirement : I have created custom vf page for showing detailed record. Form here i have created custom clone button. I want to clone the record from detail page and i need to edit the fields as our own details (not existing record details) and create a new record.
How can we write additional vf page and controller class for cloning functionality.
Note : After clicking on clone button that page redirected to another page and show the record details, if i click on cancel button no need to create new record, until clicking on save button.

Please let me know any one , how can we achieve this functionality........


Thanks in Advance!....
Lakshmi.
 
Hi Team,
Requirement : cloning from custom detail page.
I got an issue, after clicking on clone button the record was saved to database.
I want to save the record after clicking on save button only, other wise the record dont want to save in database like standard functionality.
my code :
<apex:page standardController="High_Risk_Success_Factors__c" sidebar="true" extensions="HighRiskSuccessFactorsDetailCls" tabStyle="Account" >
    <apex:form >
       
        <apex:pageBlock title="High Risk Success Factors Details">
            
            <apex:pageBlockButtons >
                
                
                <apex:commandButton value="Clone" action="{!doClone}" id="cloneButton"/>
                <apex:commandButton value="Save" action="{!Save}" id="saveButton" style="display:none;" />
                <apex:commandButton value="Edit" action="{!Edit}" id="editButton" />
                <apex:commandButton value="Delete" action="{!Delete}" onclick="if(!confirm('Are you sure?')){return false};" id="deleteButton" />
               <apex:commandButton value="Cancel" action="{!doCancel}" id="cancelButton" immediate="true" style="display:none;" />
            </apex:pageBlockButtons>
            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton,deleteButton,cloneButton" />
                <apex:pageBlockSection title="Account/Opportunity Details" columns="2">
                <apex:outputField value="{!High_Risk_Success_Factors__c.Name}" />	
                <apex:outputField value="{!High_Risk_Success_Factors__c.Account_Name__c}" />
                <apex:outputField value="{!High_Risk_Success_Factors__c.Opportunity_Name__c}" />
                <apex:outputField value="{!High_Risk_Success_Factors__c.Opportunity_Stage__c}" />
                <apex:outputField value="{!High_Risk_Success_Factors__c.Primary_Division__c}" />
                <apex:pageBlockSectionItem >
                    <apex:outputText >Global Unique ID</apex:outputText>
                <apex:outputField value="{!High_Risk_Success_Factors__c.Global_Unique_ID__c}" />  
                    </apex:pageBlockSectionItem>                 
                
            </apex:pageBlockSection>
 </apex:pageBlock>
       
    </apex:form>
    
</apex:page>
apex class :
public with sharing class HighRiskSuccessFactorsDetailCls {
    
    
    private ApexPages.StandardController con {get;set;}
    
    public HighRiskSuccessFactorsDetailCls(ApexPages.StandardController sc){
        this.con=sc;
       
    }
   
    public PageReference save(){
        try{
            con.save();
            PageReference pr = Page.HighRiskSuccessFactorsDetailPage;
            pr.setRedirect(true);
            pr.getParameters().put('id',con.getId());
            return pr;
        }catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
            return null;
        }
    }
    
   public PageReference doClone(){
        try{
            //con.save();
            PageReference pr = Page.HighRiskSuccessFactorsVFPage;
            pr.setRedirect(true);
            High_Risk_Success_Factors__c hr = [SELECTid,name,Account_Name__c,Opportunity_Name__c,Opportunity_Stage__c FROM High_Risk_Success_Factors__c where id =:con.getId()];
            High_Risk_Success_Factors__c clonedhr = hr.clone(false,false,false,false);
            insert clonedhr;
            pr.getParameters().put('id',clonedhr.Id);
            return pr;
        }catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
            return null;
        }
    } 
    
    
        Public PageReference doCancel(){
            
            PageReference pr = new PageReference('/'+Schema.SObjectType.High_Risk_Success_Factors__c.getKeyPrefix()+'/o');
            return pr;

        }

}
Please let me know anyone, how can we resolve this issue?

Thanks
Lakshmi

 
Hi Team,

I have created visualforce page for detailed record without using the apex:detail attribute.
How to hide the Save and Cancel button before inline edit.
<apex:pageBlockButtons >
                
                <apex:commandButton value="Save" action="{!Save}" id="saveButton" />
              <!--  <apex:commandButton value="Save & New" action="{!saveNew}"/> -->
                <apex:commandButton value="Edit" action="{!Edit}" id="editButton" />
                <apex:commandButton value="Delete" action="{!Delete}" onclick="if(!confirm('Are you sure?')){return false};" id="deleteButton" />
                <apex:commandButton value="Clone" action="{!doClone}" id="cloneButton" />
               <apex:commandButton value="Cancel" action="{!doCancel}" id="cancelButton" immediate="true" />
            </apex:pageBlockButtons>

Please let me know, how to achieve this ......

Thanks
Lakshmi.
Hi Team,

I have created custom detail page using visualforce pages, How to clone the record using Visualforce pages ?

Thanks,
Lakshmi.
Hi Team,

I am using analytical report chart in visualforce page.
I want to pass the record id to report for filtering process?
<apex:pageBlockSection title="Dashboard" columns="2">
                <analytics:reportChart reportId="00O4F000000JUVJ" filter="[{column:'HIGH_RISK_SUCCESS_FACTORS__C.ID',operator:'equals',value:'{!High_Risk_Success_Factors__c.Id}'}]" size="tiny" showRefreshButton="true" />
</apex:pageBlockSection>
I am getting error like, Invalid column variables.
Please let me know how can we resolve this?

Thanks
Lakhsmi
 
Hi Team,

I am using standard clone functionality for cloning the record. but my code override the existing record, instead of creating new record.
public PageReference doClone(){
        try{
            //con.save();
            PageReference pr = Page.HighRiskSuccessFactorsVFPage;
            pr.setRedirect(true);
            pr.getParameters().put('id',con.getId());
            return pr;
        }catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
            return null;
        }
    }
Please let me know, how can we achieve this using custom functionality.

Thanks
Lakshmi.
 
Hi All,

Q). One object (s1) & 3 tasks (t1, t2, t3) are there. Each task performing discount related stuff.
   Write a trigger that should calculate the sum of 3 tasks.  And if any task is modified than trigger should fire automatically & perform the same.


Can any one reply for this post..
Thanks in advance
 
Hi All,

Q). what is the difference between actionFunction and actionSupport, Explain with funcionality?

can anyone reply for this post...
Thanks in advance..
Hi All,

Q). 3 users with same profile (R/W permissions), need to remove Read permission for one user, how can we achieve that?

Can anyone reply for this post...
Thanks in advance.
Hi All,

Q). What is a future method ? When we are going to use Future methods? Example program for Future method and Schedulable class for Future method?

Give me reply anyone.....
HI All,

Q). What is a Batch Apex,Queueable Apex and @Future methods?, What are the differences between them and when we are going to use these classes?
Can anyone explain these classes.......
 
Hi Team,
How to redirect the visualforce page to record detail page after clicking on Cancel Button ?

Controller Class
-------------------------
public with sharing class ControllerClass {
    
    public static String oppid;
    
    private ApexPages.StandardController sc{get;set;}
    public Opportunity opp = new Opportunity();
    public ControllerClass(ApexPages.StandardController sc){
        this.sc = sc;
        oppid = ApexPages.currentPage().getParameters().get('oppid');
        //system.debug('------'+oppid);
        opp =[select id,name,Account.name from Opportunity where id =:oppid limit 1];
 
    }
    }
    
    Public PageReference Cancel(){
        PageReference pr = new PageReference('/'+Schema.SObjectType.Opportunity.getKeyPrefix()+'/o');
        return pr;
        }

}
How to redirect this page to opportunity record detail page.
Please let me know any one.

Regrds
Lakshmi
 
Hi Team,

How to write test class for below code.
Controller
-----------------
public with sharing class TPipelineControllerClass {
    
    public static String oppid;
    
    public X360_Pipeline__c pipeline{get;set;}
    private ApexPages.StandardController sc{get;set;}
    public Opportunity opp = new Opportunity();
    public TPipelineControllerClass(ApexPages.StandardController sc){
        this.sc = sc;
        oppid = ApexPages.currentPage().getParameters().get('oppid');
        //system.debug('------'+oppid);
        opp =[select id,name,Account.name from Opportunity where id =:oppid limit 1];
        //system.debug('---'+hr.Name);
        //system.debug('---'+hr.Account.Name);
        pipeline = new X360_Pipeline__c();
        pipeline.Name = opp.Name;
        //system.debug('-------pipeline.Name'+pipeline.Name);
        pipeline.Account_Name__c= opp.AccountId;
        pipeline.Opportunity_Name__c = opp.Id;
    }
    
    public PageReference save(){
        try{
            insert pipeline;
            return new PageReference('/'+pipeline.Id);
        }catch(Exception ex){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, ex.getMessage()));
            return null;
        }
        
        
    }
    
    Public PageReference Cancel(){
        PageReference pr = new PageReference('/'+Schema.SObjectType.Opportunity.getKeyPrefix()+'/o');
        return pr;
        }

}
Test Class :
----------------
@isTest
public class TestTPipelineControllerClass {
    
    @isTest
    private static void test360Pipeline(){
        Test.startTest();
        
        PageReference pr = Page.TPipelineVFPage;
        Test.setCurrentPage(pr);
        
        Opportunity op = new Opportunity();
        try{
            Account acc = new Account(Name='Dummy Account');
            	insert acc;
        	
                op.Name = 'Dummy Oppty';
                op.AccountId = acc.Id;
                op.Lead_Country__c = 'India';
                op.Region__c = 'APAC';
                op.CloseDate = Date.newInstance(2018, 02, 20);
                op.ForecastCategoryName = 'Best Case';
                op.StageName = 'Red Zone / Awarded';
                op.Probability = 90;
                op.Category__c = 'Red Zone / Awarded, Negotiating Contract';
            insert op;
            X360_Pipeline__c pipe = new X360_Pipeline__c();
            pipe.Name = op.Name;
            pipe.Opportunity_Name__c = op.Id;
            pipe.Account_Name__c = op.AccountId;
            insert pipe;  
            
            pr.getParameters().put('id',pipe.Id);
        
            ApexPages.StandardController sc = new ApexPages.StandardController(pipe);
            TPipelineControllerClass pipeline = new TPipelineControllerClass(sc);
            
            pipeline.save();
            pipeline.Cancel();
        
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
        }
        
        System.assert(true);
        System.assertNotEquals(Null, op.id);
        
        Test.stopTest();
    }

}
Can any one please help me how to write test class.

Thanks
Lakshmi

 
Hi Team,

We have overiding Standard functionalities New and Edit using Visualforce pages. I want to display the pdf file link in New and Edit pages (we are storing pfd file in Static Resources).

Please let me know , how can we do this?

Thanks
Lakshmi
 
Hi Team,

How we can do Field Histroy Tracking using Apex classes and display the results in a Report?

Can any one please let me know how we can dot this......


Thanks.
Lakshmi
 
Hi Team,

Visualforce new notes related list componet not working in Lightning.
<apex:relatedList subject="{!High_Risk_Success_Factors__c}" list="CombinedAttachments" />

Please let me know, how can we do this in lightning.

Thanks
Lakshmi
Hi Team,

I am converting phone number from excel to csv the format is changing, how can we resolve this?

+91-9900453436 this number changed to like this -9900453345.

please any one let me know , how can i resolve this?


Thanks.
Lakshmi
HI Team,

Visualforce Error :
System.QueryException: List has no rows for assignment to SObject.
 
<apex:page standardController="High_Risk_Success_Factors__c" sidebar="true" tabStyle="Account" extensions="HighRiskSuccessFactorsDetailCls" >
    <apex:form >
        <apex:pageBlock title="Success Factors Details">
            
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!Save}" id="saveButton" style="display:none;"  />
                <apex:commandButton value="Edit" action="{!Edit}" id="editButton" />
                <apex:commandButton value="Delete" action="{!Delete}" onclick="if(!confirm('Are you sure?')){return false};" id="deleteButton" />
                <apex:commandButton value="Clone" action="{!doClone}" id="cloneButton" />
               <apex:commandButton value="Cancel" action="{!doCancel}" id="cancelButton" immediate="true" style="display:none;" />
                
            </apex:pageBlockButtons>
            <apex:pageMessages ></apex:pageMessages>
<apex:pageBlock>
<apex:form>
<apex:page>
public with sharing class HighRiskSuccessFactorsDetailCls {
    
    public boolean bool {get;set;}
    Private ApexPages.StandardController controller {get;set;}
    
    
    public HighRiskSuccessFactorsDetailCls(ApexPages.StandardController controller){
        bool = false;
        this.controller=controller;
       
    }
   
    public PageReference save(){
        try{
            controller.save();
            PageReference pr = Page.HighRiskSuccessFactorsDetailPage;
            pr.setRedirect(true);
            pr.getParameters().put('id',controller.getId());
            return pr;
        }catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
            return null;
        }
    }
    
   public PageReference doClone(){
       PageReference pr;
       try{
           if(controller.getId() != null)
           pr = Page.HighRiskSuccessFactorsClonePage;
           pr.getParameters().put('id',controller.getId());
           return pr;
       }
       catch(Exception e){
           ApexPages.addMessages(e);
           return null;
       }
        
    } 
    
    
        Public PageReference doCancel(){
            
            PageReference pr = new PageReference('/'+Schema.SObjectType.High_Risk_Success_Factors__c.getKeyPrefix()+'/o');
            return pr;

        }

}
If we click on clone button, if record is not available it shwos above error.
How can we handle these type of errors for vf pages.

Thanks
Lakshmi

 
Hi Team,

Requirement : I have created custom vf page for showing detailed record. Form here i have created custom clone button. I want to clone the record from detail page and i need to edit the fields as our own details (not existing record details) and create a new record.
How can we write additional vf page and controller class for cloning functionality.
Note : After clicking on clone button that page redirected to another page and show the record details, if i click on cancel button no need to create new record, until clicking on save button.

Please let me know any one , how can we achieve this functionality........


Thanks in Advance!....
Lakshmi.
 
Hi Team,
Requirement : cloning from custom detail page.
I got an issue, after clicking on clone button the record was saved to database.
I want to save the record after clicking on save button only, other wise the record dont want to save in database like standard functionality.
my code :
<apex:page standardController="High_Risk_Success_Factors__c" sidebar="true" extensions="HighRiskSuccessFactorsDetailCls" tabStyle="Account" >
    <apex:form >
       
        <apex:pageBlock title="High Risk Success Factors Details">
            
            <apex:pageBlockButtons >
                
                
                <apex:commandButton value="Clone" action="{!doClone}" id="cloneButton"/>
                <apex:commandButton value="Save" action="{!Save}" id="saveButton" style="display:none;" />
                <apex:commandButton value="Edit" action="{!Edit}" id="editButton" />
                <apex:commandButton value="Delete" action="{!Delete}" onclick="if(!confirm('Are you sure?')){return false};" id="deleteButton" />
               <apex:commandButton value="Cancel" action="{!doCancel}" id="cancelButton" immediate="true" style="display:none;" />
            </apex:pageBlockButtons>
            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton,deleteButton,cloneButton" />
                <apex:pageBlockSection title="Account/Opportunity Details" columns="2">
                <apex:outputField value="{!High_Risk_Success_Factors__c.Name}" />	
                <apex:outputField value="{!High_Risk_Success_Factors__c.Account_Name__c}" />
                <apex:outputField value="{!High_Risk_Success_Factors__c.Opportunity_Name__c}" />
                <apex:outputField value="{!High_Risk_Success_Factors__c.Opportunity_Stage__c}" />
                <apex:outputField value="{!High_Risk_Success_Factors__c.Primary_Division__c}" />
                <apex:pageBlockSectionItem >
                    <apex:outputText >Global Unique ID</apex:outputText>
                <apex:outputField value="{!High_Risk_Success_Factors__c.Global_Unique_ID__c}" />  
                    </apex:pageBlockSectionItem>                 
                
            </apex:pageBlockSection>
 </apex:pageBlock>
       
    </apex:form>
    
</apex:page>
apex class :
public with sharing class HighRiskSuccessFactorsDetailCls {
    
    
    private ApexPages.StandardController con {get;set;}
    
    public HighRiskSuccessFactorsDetailCls(ApexPages.StandardController sc){
        this.con=sc;
       
    }
   
    public PageReference save(){
        try{
            con.save();
            PageReference pr = Page.HighRiskSuccessFactorsDetailPage;
            pr.setRedirect(true);
            pr.getParameters().put('id',con.getId());
            return pr;
        }catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
            return null;
        }
    }
    
   public PageReference doClone(){
        try{
            //con.save();
            PageReference pr = Page.HighRiskSuccessFactorsVFPage;
            pr.setRedirect(true);
            High_Risk_Success_Factors__c hr = [SELECTid,name,Account_Name__c,Opportunity_Name__c,Opportunity_Stage__c FROM High_Risk_Success_Factors__c where id =:con.getId()];
            High_Risk_Success_Factors__c clonedhr = hr.clone(false,false,false,false);
            insert clonedhr;
            pr.getParameters().put('id',clonedhr.Id);
            return pr;
        }catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
            return null;
        }
    } 
    
    
        Public PageReference doCancel(){
            
            PageReference pr = new PageReference('/'+Schema.SObjectType.High_Risk_Success_Factors__c.getKeyPrefix()+'/o');
            return pr;

        }

}
Please let me know anyone, how can we resolve this issue?

Thanks
Lakshmi

 
Hi Team,

I have created visualforce page for detailed record without using the apex:detail attribute.
How to hide the Save and Cancel button before inline edit.
<apex:pageBlockButtons >
                
                <apex:commandButton value="Save" action="{!Save}" id="saveButton" />
              <!--  <apex:commandButton value="Save & New" action="{!saveNew}"/> -->
                <apex:commandButton value="Edit" action="{!Edit}" id="editButton" />
                <apex:commandButton value="Delete" action="{!Delete}" onclick="if(!confirm('Are you sure?')){return false};" id="deleteButton" />
                <apex:commandButton value="Clone" action="{!doClone}" id="cloneButton" />
               <apex:commandButton value="Cancel" action="{!doCancel}" id="cancelButton" immediate="true" />
            </apex:pageBlockButtons>

Please let me know, how to achieve this ......

Thanks
Lakshmi.
Hi Team,

I have created custom detail page using visualforce pages, How to clone the record using Visualforce pages ?

Thanks,
Lakshmi.
Hi Team,

I am using analytical report chart in visualforce page.
I want to pass the record id to report for filtering process?
<apex:pageBlockSection title="Dashboard" columns="2">
                <analytics:reportChart reportId="00O4F000000JUVJ" filter="[{column:'HIGH_RISK_SUCCESS_FACTORS__C.ID',operator:'equals',value:'{!High_Risk_Success_Factors__c.Id}'}]" size="tiny" showRefreshButton="true" />
</apex:pageBlockSection>
I am getting error like, Invalid column variables.
Please let me know how can we resolve this?

Thanks
Lakhsmi
 
Hi Team,

I am using standard clone functionality for cloning the record. but my code override the existing record, instead of creating new record.
public PageReference doClone(){
        try{
            //con.save();
            PageReference pr = Page.HighRiskSuccessFactorsVFPage;
            pr.setRedirect(true);
            pr.getParameters().put('id',con.getId());
            return pr;
        }catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
            return null;
        }
    }
Please let me know, how can we achieve this using custom functionality.

Thanks
Lakshmi.
 
Hi Team,

How to redirect the custom vf page to custom object after clicking on Cancel button?
public with sharing class HighRiskSuccessFactorsCls {
    
    public High_Risk_Success_Factors__c hrsf {get;set;}
    ApexPages.StandardController con;
    public HighRiskSuccessFactorsCls(ApexPages.StandardController sc){
        con=sc;
    }
    
    public PageReference saveNew()
     { 
         PageReference pr; 
         try{ con.save();
         Schema.DescribeSObjectResult describeResult = con.getRecord().getSObjectType().getDescribe();
         pr = new PageReference('/' + describeResult.getKeyPrefix() + '/e');
         pr.setRedirect(true);
         return pr;
         }catch(Exception e){ 
         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
         return null; }
     
     }
    Public PageReference doCancel(){
        PageReference pageRef = new PageReference('/apex/High_Risk_Success_Factors__c?id='+hrsf.id+'&Sfdc.override=1');
    	pageRef.getParameters().put('tab','High Risk Success Factors');
    	return pageRef;	
    }

}
Please let me know how can i redirect to custom object tab.

Thanks.
Lakshmi
 
Hi Team,

Requirement : Calculating sum and  count using Trigger. We have to calculate for 20 fields in child object.
1. For each field we have to check condition  : year, accountname(parent id) and field value.
2. For this i am using aggregate result function individually, because of that i am getting soql query exception.
SOQL Query Exception : AggregateResult caused too many rows exception?
Trigger:
------------
trigger KingsleyRollupSummaryTrig on KingsleyTranscript__c (after insert, after Update, after delete, after undelete) {
    
    /*
    if(Trigger.isAfter && (Trigger.isInsert || Trigger.isUndelete)){
        KingsleyRollupSummaryTrigHandlerCls.insertRecords((List<KingsleyTranscript__c>)Trigger.New);
    }
    
    if(Trigger.isAfter && Trigger.isUpdate){
        //KingsleyRollupSummaryTrigHandlerCls.updateRecords((List<KingsleyTranscript__c>)Trigger.old);
    }
    
    if(Trigger.isAfter && Trigger.isDelete){
       // KingsleyRollupSummaryTrigHandlerCls.deleteRecords((List<KingsleyTranscript__c>)Trigger.old);
    }
*/
    String recordYear = '2017';
      Decimal amsum ;
      Integer amcount ;
      Decimal emeasum ;
      Integer emeacount ;
      Decimal apacsum ;
      Integer apaccount ;
      Decimal osrsum ;
      Integer osrcount ;
      Decimal vcrsum ;
      Integer vcrcount ;
      Decimal adorsum ;
      Integer adorcount ;
      Decimal tmpaorsum ;
      Integer tmpaorcount ;
      Decimal tmlrsum ;
      Integer tmlrcount ;
	  Decimal tmpa_off_acct_sum ;
      Integer tmpa_off_acct_count ;
      Decimal fm_or_sum ;
      Integer fm_or_count ;
      Decimal fm_lr_sum ;
      Integer fm_lr_count ;
      Decimal fm_off_acct_lr_sum ;
      Integer fm_off_acct_lr_count ;
      Decimal pjm_off_acct_lr_sum ;
      Integer pjm_off_acct_lr_count ;
      Decimal pjm_or_sum ;
      Integer pjm_or_count ;
      Decimal pjm_lr_sum ;
      Integer pjm_lr_count ;
      Decimal remc_or_sum ;
      Integer remc_or_count ;
      Decimal off_acct_remc_sum ;
      Integer off_acct_remc_count ;
      Decimal thought_lp_sum ;
      Integer thought_lp_count ;
      Decimal exec_or_sum ;
      Integer exec_or_count ;
      Decimal peer_nps_sum ;
      Integer peer_nps_count ;

        
      List<Account> updateAccs = new List<Account>();
      Set<Id> accIds = new Set<Id>();
      
    
    
    if(Trigger.isAfter && (Trigger.isInsert || Trigger.isUpdate || Trigger.isUndelete)){
        
        
        for(KingsleyTranscript__c kt : Trigger.New){
            
            if(kt.Account_Name__c != null){
                accIds.add(kt.Account_Name__c);
            }
        }
    }
    
    if(Trigger.isAfter && (Trigger.isUpdate || Trigger.isDelete)){
        
        
        for(KingsleyTranscript__c kt : Trigger.New){
            
            if(kt.Account_Name__c != null){
                accIds.add(kt.Account_Name__c);
            }
        }
    }
    
   
        
        if(accIds.size() > 0){
            List<Account> acclist = [Select id,name,RS_Reg_Client_Satisfaction_Ams_Sum__c,RS_Reg_Client_Satisfaction_Ams_Count__c,RS_Reg_Client_Satisfaction_EMEA_Sum__c,
                               RS_Reg_Client_Satisfaction_EMEA_Count__c,RS_Reg_Client_Satisfaction_APAC_Sum__c,RS_Reg_Client_Satisfaction_APAC_Count__c,
                               RS_Overall_Satisfaction_Rating_Sum__c,RS_Overall_Satisfaction_Rating_Count__c,RS_Value_Contribution_Rating_Sum__c,
                               RS_Value_Contribution_Rating_Count__c,RS_AD_Overall_Rating_Sum__c,RS_AD_Overall_Rating_Count__c,RS_TM_PA_Overall_Rating_Sum__c,
                               RS_TM_PA_Overall_Rating_Count__c,RS_TM_Leader_Rating_Sum__c,RS_TM_Leader_Rating_Count__c,RS_TM_PA_Off_Acct_Leader_Rating_Sum__c,
                               RS_TM_PA_Off_Acct_Leader_Rating_Count__c,RS_FM_Overall_Rating_Sum__c,RS_FM_Overall_Rating_Count__c,RS_FM_Leader_Rating_Sum__c,
                               RS_FM_Leader_Rating_Count__c,RS_FM_Off_Acct_Leadership_Rating_Sum__c,RS_FM_Off_Acct_Leadership_Rating_Count__c,RS_PJM_Overall_Rating_Sum__c,
                               RS_PJM_Overall_Rating_Count__c,RS_PJM_Leader_Rating_Sum__c,RS_PJM_Leader_Rating_Count__c,RS_PJM_Off_Acct_Leadership_Rating_Sum__c,
                               RS_PJM_Off_Acct_Leadership_Rating_Count__c,RS_REMC_Overall_Rating_Sum__c,RS_REMC_Overall_Rating_Count__c,RS_Off_Acct_REMC_Leader_Rating_Sum__c,
                               RS_Off_Acct_REMC_Leader_Rating_Count__c,RS_Thought_Leadership_progs_Rating_Sum__c,RS_Thought_Leadership_prog_Rating_Count__c,
                               RS_Exec_Leadership_Overall_Rating_Sum__c,RS_Exec_Leadership_Overall_Rating_Count__c,RS_Peer_Recommendation_NPS_Rating_Sum__c,RS_Peer_Recommend_NPS_Rating_Count__c,
                               (Select id,Regional_Client_Satisfaction_Americas__c,Regional_Client_Satisfaction_EMEA__c,Regional_Client_Satisfaction_APAC__c,
                                Overall_satisfaction_Rating__c,Value_Contribution_Rating__c,Additional_Vakue_Focus_Areas__c,AD_Overall_Rating__c,
                                TM_PA_Overall_Rating__c,TM_Leader_Rating__c,TM_PA_Off_Account_Leader_Rating__c,FM_Overall_Rating__c,FM_Leader_Rating__c,
                                FM_Off_Acct_Lship_Rating__c,PJM_Overall_Rating__c,PJM_Leader_Rating__c,PJM_Off_Acct_Leadership_Rating__c,REMC_Overall_Rating__c,
                                Off_Account_REMC_Leader_Rating__c,Thought_Ldrship_Pgm_Rating__c,Exec_Ldrship_Overall_Rating__c,Peer_Recomend_NPS_Rating__c,
                                Recorded_Year__c from Kingsley_Transcript__r) from Account where Id In :accIds];
            
            for(Account acc : acclist){
                                   
                // for 'Regional_Client_Satisfaction_Americas__c' field value calculation
                AggregateResult[] agres = [Select SUM(Regional_Client_Satisfaction_Americas__c)amsum,COUNT(Regional_Client_Satisfaction_Americas__c)amcount 
                                   	            from KingsleyTranscript__c where Account_Name__c =: acc.id and Regional_Client_Satisfaction_Americas__c > 0 and Recorded_Year__c=: recordYear];
                
                
                if(agres.size() > 0){
                    
                     for(AggregateResult ag : agres){
                                                                 
                          amsum = (Decimal)ag.get('amsum');
                          amcount = (Integer)ag.get('amcount');
                      }
                      acc.RS_Reg_Client_Satisfaction_Ams_Sum__c = amsum;
                      acc.RS_Reg_Client_Satisfaction_Ams_Count__c = amcount;
                    
                }
               // for 'Regional_Client_Satisfaction_EMEA__c' field value calculation
                AggregateResult[] agres2 = [Select SUM(Regional_Client_Satisfaction_EMEA__c)emeasum,COUNT(Regional_Client_Satisfaction_EMEA__c)emeacount 
                                               from KingsleyTranscript__c where Account_Name__c =: acc.id and Regional_Client_Satisfaction_EMEA__c > 0 and Recorded_Year__c=: recordYear];                   
                if(agres2.size() > 0){
                    
                    for(AggregateResult ag : agres2){
                                                                 
                                                                 emeasum = (Decimal)ag.get('emeasum');
                                                                 emeacount = (Integer)ag.get('emeacount');
                                                                 
                                                             }
                                   acc.RS_Reg_Client_Satisfaction_EMEA_Sum__c = emeasum;
                                   acc.RS_Reg_Client_Satisfaction_EMEA_Count__c = emeacount;
                    
                }               
                                   // for 'Regional_Client_Satisfaction_APAC__c' field value calculation
                AggregateResult[] agres3 = [Select SUM(Regional_Client_Satisfaction_APAC__c)apacsum,COUNT(Regional_Client_Satisfaction_APAC__c)apaccount 
                                                from KingsleyTranscript__c where Account_Name__c =: acc.id and Regional_Client_Satisfaction_APAC__c > 0 and Recorded_Year__c=: recordYear];                   
                if(agres3.size() > 0){
                    for(AggregateResult ag : agres3){
                                                                 
                                                                 apacsum = (Decimal)ag.get('apacsum');
                                                                 apaccount = (Integer)ag.get('apaccount');
                                                                 
                                                             }
                                   acc.RS_Reg_Client_Satisfaction_APAC_Sum__c = apacsum;
                                   acc.RS_Reg_Client_Satisfaction_APAC_Count__c = apaccount;
             
                }
            
                                    
                                   // for 'Overall_satisfaction_Rating__c' field value calculation
                AggregateResult[] agres4 = [Select SUM(Overall_satisfaction_Rating__c)osrsum,COUNT(Overall_satisfaction_Rating__c)osrcount 
                                                from KingsleyTranscript__c where Account_Name__c =: acc.id and Overall_satisfaction_Rating__c > 0 and Recorded_Year__c=: recordYear];                 
                
                if(agres4.size() > 0){
                    for(AggregateResult ag : agres4){
                                                                 
                                                                 osrsum = (Decimal)ag.get('osrsum');
                                                                 osrcount = (Integer)ag.get('osrcount');
                                                                 
                                                             }
                                   acc.RS_Overall_Satisfaction_Rating_Sum__c = osrsum;
                                   acc.RS_Overall_Satisfaction_Rating_Count__c = osrcount;

                }
                				   // for 'Value_Contribution_Rating__c' field value calculation
                AggregateResult[] agres5 = [Select SUM(Value_Contribution_Rating__c)vcrsum,COUNT(Value_Contribution_Rating__c)vcrcount from KingsleyTranscript__c where Account_Name__c =: acc.id and Value_Contribution_Rating__c > 0 and Recorded_Year__c=: recordYear];                   
                
                if(agres5.size() > 0){
                    for(AggregateResult ag : agres5){
                                                                 
                                                                 vcrsum = (Decimal)ag.get('vcrsum');
                                                                 vcrcount = (Integer)ag.get('vcrcount');
                                                                 
                                                             }
                                   acc.RS_Value_Contribution_Rating_Sum__c = vcrsum;
                                   acc.RS_Value_Contribution_Rating_Count__c = vcrcount;

                }
               
                                   // for 'AD_Overall_Rating__c' field value calculation
                AggregateResult[] agres6 = [Select SUM(AD_Overall_Rating__c)adorsum,COUNT(AD_Overall_Rating__c)adorcount from KingsleyTranscript__c where Account_Name__c =: acc.id and AD_Overall_Rating__c > 0 and Recorded_Year__c=: recordYear];                  
                if(agres6.size() > 0){
                    for(AggregateResult ag : agres6){
                                                                 
                                                                 adorsum = (Decimal)ag.get('adorsum');
                                                                 adorcount = (Integer)ag.get('adorcount');
                                                                 
                                                             }
                                   acc.RS_AD_Overall_Rating_Sum__c = adorsum;
                                   acc.RS_AD_Overall_Rating_Count__c = adorcount;

                }                                   
                                   
 								   // for 'TM_PA_Overall_Rating__c' field value calculation
                AggregateResult[] agres7 = [Select SUM(TM_PA_Overall_Rating__c)tmpaorsum,COUNT(TM_PA_Overall_Rating__c)tmpaorcount 
                                                from KingsleyTranscript__c where Account_Name__c =: acc.id and TM_PA_Overall_Rating__c > 0 and Recorded_Year__c=: recordYear];                   
                if(agres7.size() > 0){
                    for(AggregateResult ag : agres7){
                                                                 
                                                                 tmpaorsum = (Decimal)ag.get('tmpaorsum');
                                                                 tmpaorcount = (Integer)ag.get('tmpaorcount');
                                                                 
                                                             }
                                   acc.RS_TM_PA_Overall_Rating_Sum__c = tmpaorsum;
                                   acc.RS_TM_PA_Overall_Rating_Count__c = tmpaorcount;

                }

 							       // for 'TM_Leader_Rating__c' field value calculation
                AggregateResult[] agres8 = [Select SUM(TM_Leader_Rating__c)tmlrsum,COUNT(TM_Leader_Rating__c)tmlrcount 
                                                from KingsleyTranscript__c where Account_Name__c =: acc.id and TM_Leader_Rating__c > 0 and Recorded_Year__c=: recordYear];                   
                
                if(agres8.size() > 0){
                    for(AggregateResult ag : agres8){
                                                                 
                                                                 tmlrsum = (Decimal)ag.get('tmlrsum');
                                                                 tmlrcount = (Integer)ag.get('tmlrcount');
                                                                 
                                                             }
                                   acc.RS_TM_Leader_Rating_Sum__c = tmlrsum;
                                   acc.RS_TM_Leader_Rating_Count__c = tmlrcount;

                }

								 // for 'TM_PA_Off_Account_Leader_Rating__c' field value calculation
                AggregateResult[] agres9 = [Select SUM(TM_PA_Off_Account_Leader_Rating__c)tmpa_off_acct_sum,COUNT(TM_PA_Off_Account_Leader_Rating__c)tmpa_off_acct_count 
                                                from KingsleyTranscript__c where Account_Name__c =: acc.id and TM_PA_Off_Account_Leader_Rating__c > 0 and Recorded_Year__c=: recordYear];                   
                if(agres9.size() > 0){
                    for(AggregateResult ag :agres9 ){
                                                                 
                                                                 tmpa_off_acct_sum = (Decimal)ag.get('tmpa_off_acct_sum');
                                                                 tmpa_off_acct_count = (Integer)ag.get('tmpa_off_acct_count');
                                                                 
                                                             }
                                   acc.RS_TM_PA_Off_Acct_Leader_Rating_Sum__c = tmpa_off_acct_sum;
                                   acc.RS_TM_PA_Off_Acct_Leader_Rating_Count__c = tmpa_off_acct_count;

                }                                    
                                    // for 'FM_Overall_Rating__c' field value calculation
                AggregateResult[] agres10 = [Select SUM(FM_Overall_Rating__c)fm_or_sum,COUNT(FM_Overall_Rating__c)fm_or_count 
                                                 from KingsleyTranscript__c where Account_Name__c =: acc.id and FM_Overall_Rating__c > 0 and Recorded_Year__c=: recordYear];                   
                if(agres10.size() > 0){
                    for(AggregateResult ag : agres10){
                                                                 
                                                                 fm_or_sum = (Decimal)ag.get('fm_or_sum');
                                                                 fm_or_count = (Integer)ag.get('fm_or_count');
                                                                 
                                                             }
                                   acc.RS_FM_Overall_Rating_Sum__c = fm_or_sum;
                                   acc.RS_FM_Overall_Rating_Count__c = fm_or_count;

                }
 								// for 'FM_Leader_Rating__c' field value calculation
                                   
                AggregateResult[] agres11 = [Select SUM(FM_Leader_Rating__c)fm_lr_sum,COUNT(FM_Leader_Rating__c)fm_lr_count 
                                                 from KingsleyTranscript__c where Account_Name__c =: acc.id and FM_Leader_Rating__c > 0 and Recorded_Year__c=: recordYear];
                if(agres11.size() > 0){
                    for(AggregateResult ag : agres11){
                                                                 
                                                                 fm_lr_sum = (Decimal)ag.get('fm_lr_sum');
                                                                 fm_lr_count = (Integer)ag.get('fm_lr_count');
                                                                 
                                                             }
                                   acc.RS_FM_Leader_Rating_Sum__c = fm_lr_sum;
                                   acc.RS_FM_Leader_Rating_Count__c = fm_lr_count;

                }
								 // for 'FM_Off_Acct_Lship_Rating__c' field value calculation
                AggregateResult[] agres12 = [Select SUM(FM_Off_Acct_Lship_Rating__c)fm_off_acct_lr_sum,COUNT(FM_Off_Acct_Lship_Rating__c)fm_off_acct_lr_count 
                                                 from KingsleyTranscript__c where Account_Name__c =: acc.id and FM_Off_Acct_Lship_Rating__c > 0 and Recorded_Year__c=: recordYear];                   
                if(agres12.size() >0){
                    for(AggregateResult ag : agres12){
                                                                 
                                                                 fm_off_acct_lr_sum = (Decimal)ag.get('fm_off_acct_lr_sum');
                                                                 fm_off_acct_lr_count = (Integer)ag.get('fm_off_acct_lr_count');
                                                                 
                                                             }
                                   acc.RS_FM_Off_Acct_Leadership_Rating_Sum__c = fm_off_acct_lr_sum;
                                   acc.RS_FM_Off_Acct_Leadership_Rating_Count__c = fm_off_acct_lr_count;

                }                                    
                                    
                                    // for 'PJM_Overall_Rating__c' field value calculation
                AggregateResult[] agres13 = [Select SUM(PJM_Overall_Rating__c)pjm_or_sum,COUNT(PJM_Overall_Rating__c)pjm_or_count 
                                                 from KingsleyTranscript__c where Account_Name__c =: acc.id and PJM_Overall_Rating__c > 0 and Recorded_Year__c=: recordYear];                   
                if(agres13.size() > 0){
                    for(AggregateResult ag : agres13){
                                                                 
                                                                 pjm_or_sum = (Decimal)ag.get('pjm_or_sum');
                                                                 pjm_or_count = (Integer)ag.get('pjm_or_count');
                                                                 
                                                             }
                                   acc.RS_PJM_Overall_Rating_Sum__c = pjm_or_sum;
                                   acc.RS_PJM_Overall_Rating_Count__c = pjm_or_count;

                }
 								// for 'PJM_Leader_Rating__c' field value calculation
                AggregateResult[] agres14 = [Select SUM(PJM_Leader_Rating__c)pjm_lr_sum,COUNT(PJM_Leader_Rating__c)pjm_lr_count 
                                                 from KingsleyTranscript__c where Account_Name__c =: acc.id and PJM_Leader_Rating__c > 0 and Recorded_Year__c=: recordYear];
                if(agres14.size()>0){
                    for(AggregateResult ag : agres14){
                                                                 
                                                                 pjm_lr_sum = (Decimal)ag.get('pjm_lr_sum');
                                                                 pjm_lr_count = (Integer)ag.get('pjm_lr_count');
                                                                 
                                                             }
                                   acc.RS_PJM_Leader_Rating_Sum__c = pjm_lr_sum;
                                   acc.RS_PJM_Leader_Rating_Count__c = pjm_lr_count;

                }
                
								 // for 'PJM_Off_Acct_Leadership_Rating__c field value calculation
	             AggregateResult[] agres15 = [Select SUM(PJM_Off_Acct_Leadership_Rating__c)pjm_off_acct_lr_sum,COUNT(PJM_Off_Acct_Leadership_Rating__c)pjm_off_acct_lr_count 
                                                  from KingsleyTranscript__c where Account_Name__c =: acc.id and PJM_Off_Acct_Leadership_Rating__c > 0 and Recorded_Year__c=: recordYear];
                if(agres15.size() > 0){
                    for(AggregateResult ag : agres15){
                                                                 
                                                                 pjm_off_acct_lr_sum = (Decimal)ag.get('pjm_off_acct_lr_sum');
                                                                 pjm_off_acct_lr_count = (Integer)ag.get('pjm_off_acct_lr_count');
                                                                 
                                                             }
                                   acc.RS_PJM_Off_Acct_Leadership_Rating_Sum__c = pjm_off_acct_lr_sum;
                                   acc.RS_PJM_Off_Acct_Leadership_Rating_Count__c = pjm_off_acct_lr_count;
                                   
                }
                                    
                                    // for 'REMC_Overall_Rating__c' field value calculation
                 AggregateResult[] agres16 = [Select SUM(REMC_Overall_Rating__c)remc_or_sum,COUNT(REMC_Overall_Rating__c)remc_or_count
                                                  from KingsleyTranscript__c where Account_Name__c =: acc.id and REMC_Overall_Rating__c > 0 and Recorded_Year__c=: recordYear];
                if(agres16.size()>0){
                                   for(AggregateResult ag : agres16){
                                                                 
                                                                 remc_or_sum = (Decimal)ag.get('remc_or_sum');
                                                                 remc_or_count = (Integer)ag.get('remc_or_count');
                                                                 
                                                             }
                                   acc.RS_REMC_Overall_Rating_Sum__c = remc_or_sum;
                                   acc.RS_REMC_Overall_Rating_Count__c = remc_or_count;

                }
                    
 								// for 'Off_Account_REMC_Leader_Rating__c' field value calculation
 				AggregateResult[] agres17 = [Select SUM(Off_Account_REMC_Leader_Rating__c)off_acct_remc_sum,COUNT(Off_Account_REMC_Leader_Rating__c)off_acct_remc_count 
                                                 from KingsleyTranscript__c where Account_Name__c =: acc.id and Off_Account_REMC_Leader_Rating__c > 0 and Recorded_Year__c=: recordYear];
                if(agres17.size()>0){
                                   for(AggregateResult ag : agres17) {
                                                                 
                                                                 off_acct_remc_sum = (Decimal)ag.get('off_acct_remc_sum');
                                                                 off_acct_remc_count = (Integer)ag.get('off_acct_remc_count');
                                                                 
                                                             }
                                   acc.RS_Off_Acct_REMC_Leader_Rating_Sum__c = off_acct_remc_sum;
                                   acc.RS_Off_Acct_REMC_Leader_Rating_Count__c = off_acct_remc_count;

                }
                    
								 // for 'Thought_Ldrship_Pgm_Rating__c field value calculation
		        AggregateResult[] agres18 = [Select SUM(Thought_Ldrship_Pgm_Rating__c)thought_lp_sum,COUNT(Thought_Ldrship_Pgm_Rating__c)thought_lp_count 
                                                 from KingsleyTranscript__c where Account_Name__c =: acc.id and Thought_Ldrship_Pgm_Rating__c > 0 and Recorded_Year__c=: recordYear];
                if(agres18.size()>0){
                                   for(AggregateResult ag : agres18){
                                                                 
                                                                 thought_lp_sum = (Decimal)ag.get('thought_lp_sum');
                                                                 thought_lp_count = (Integer)ag.get('thought_lp_count');
                                                                 
                                                             }
                                   acc.RS_Thought_Leadership_progs_Rating_Sum__c = thought_lp_sum;
                                   acc.RS_Thought_Leadership_prog_Rating_Count__c = thought_lp_count;

                }
 								// for 'Exec_Ldrship_Overall_Rating__c' field value calculation
                AggregateResult[] agres19 = [Select SUM(Exec_Ldrship_Overall_Rating__c)exec_or_sum,COUNT(Exec_Ldrship_Overall_Rating__c)exec_or_count 
                                                 from KingsleyTranscript__c where Account_Name__c =: acc.id and Exec_Ldrship_Overall_Rating__c > 0 and Recorded_Year__c=: recordYear];
                if(agres19.size()>0){
                    for(AggregateResult ag : agres19){
                                                                 
                                                                 exec_or_sum = (Decimal)ag.get('exec_or_sum');
                                                                 exec_or_count = (Integer)ag.get('exec_or_count');
                                                                 
                                                             }
                                   acc.RS_Exec_Leadership_Overall_Rating_Sum__c = exec_or_sum;
                                   acc.RS_Exec_Leadership_Overall_Rating_Count__c = exec_or_count;
                }
 								// for 'Peer_Recomend_NPS_Rating__c' field value calculation
                AggregateResult[] agres20 = [Select SUM(Peer_Recomend_NPS_Rating__c)peer_nps_sum,COUNT(Peer_Recomend_NPS_Rating__c)peer_nps_count 
                                                 from KingsleyTranscript__c where Account_Name__c =: acc.id and Peer_Recomend_NPS_Rating__c > 0 and Recorded_Year__c=: recordYear];
                if(agres20.size()>0){
                    for(AggregateResult ag : agres20){
                                                                 
                                                                 peer_nps_sum = (Decimal)ag.get('peer_nps_sum');
                                                                 peer_nps_count = (Integer)ag.get('peer_nps_count');
                                                                 
                                                             }
                                   acc.RS_Peer_Recommendation_NPS_Rating_Sum__c = peer_nps_sum;
                                   acc.RS_Peer_Recommend_NPS_Rating_Count__c = peer_nps_count;               
                }
                                   updateAccs.add(acc);
            }         
               Database.update(updateAccs,false);   
        }   
}
Can any one let me know how to solve this problem?

Regards
Lakshmi S
 
Hi Team,

How can we simplify below formula.

OR(AND(OR(ISPICKVAL(Region__c,"West"),ISPICKVAL(Region__c,"North"),ISPICKVAL(Region__c,"South"),ISPICKVAL(Region__c,"East"),ISPICKVAL(Region__c,"Northeast"),ISPICKVAL(Region__c,"Latin America")),Annualized_EBITDA__c >=1500000),AND(OR(ISPICKVAL(Region__c,"A&T AMS"),ISPICKVAL(Region__c,"A&T APAC"),ISPICKVAL(Region__c,"A&T EMEA"),ISPICKVAL(Region__c,"APAC"),ISPICKVAL(Region__c,"Competitors"),ISPICKVAL(Region__c,"DCS"),ISPICKVAL(Region__c,"EMEA"),ISPICKVAL(Region__c,"Govt & PS"),ISPICKVAL(Region__c,"Healthcare"),ISPICKVAL(Region__c,"I&M"),ISPICKVAL(Region__c,"Life Sciences"),ISPICKVAL(Region__c,"LFM")),Annualized_EBITDA__c >=1000000),AND(OR(ISPICKVAL(StageName,"Win (Contract Signed)"),ISPICKVAL(StageName,"Lost Accounts"),ISPICKVAL(StageName,"Lost Pursuits"),ISPICKVAL(StageName,"On Hold"),ISPICKVAL(StageName,"Dead"),ISPICKVAL(StageName,"Declined")),!ISPICKVAL(Win_Loss_Year__c ,"2018"),Annualized_EBITDA__c >=1000000))


Regards
Lakshmi
Hi Team,

How to validate the fields in Flow?
1. validation profile or user ( Make it madatory based on profile)
2. How to validate blank or null values (for text)

Can someone let me know how I can do this?

Regards
Lakshmi