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

  • Chatter
    Feed
  • 1
    Best Answers
  • 9
    Likes Received
  • 0
    Likes Given
  • 140
    Questions
  • 118
    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,

How to add Files related list in visualforce detail page? (Lightning Experience not showing "Add Files" option, In Standard lightning files if we click on the "Add Files" it will redirect to Libraries.)
Now below code is redirecting to local system.
I have used below code
<apex:relatedList subject="{!Custom_Obj__c}" list="AttachedContentDocuments" />

Please advise.

Thanks
Hi Team,

Requirement : I want to display all objects last activity date using visualforce page or soql ?
Please advise how can we achieve this using SOQL or Visualforce pages?
Please let me know anyone..

Thanks in Advance
Lakshmi S
Hi Team,

I have installed some packages in my org, related to those packages there are 4 or 5 triggers in Account object. I need to write a custom trigger on Account object.

Please advise can we write custom trigger, if we have triggers on same object related to packages ?

Thanks,
Lakshmi S.
Hi Team,

I am calling batch apex from trigger.
I am updating a value in Account from custom object. Created two records in custom object, now two batches are running. But one value is in updated in account, another value is not updated.
Please advsie how can we resolve this issue ?

Thanks,
Lakshmi S.
Hi Team,

I am calling batch apex using trigger after deleting the record, but Start method returns null.
How to query deleted records in batch apex start method.
Trigger :
----------

if(Trigger.isDelete){
                
   Database.executeBatch(new BatchUpdateAcct(Trigger.OldMap),1);
               
}

Batch Class
-------------

global class BatchUpdateAcct implements Database.Batchable<sObject> {
    
    Map<Id,Object__c> mapRecs = new Map<Id,Object__c>();
    
    global BatchUpdateAcct(Map<Id,Object__c> oldValue){
        mapRecs = oldValue;
       
    }
    
    global Database.QueryLocator start (Database.BatchableContext BC){
        System.debug('----Start Method-----'+mapRecs.keySet());
        return Database.getQueryLocator([Select id,Name from Object__c where id in :mapRecs.KeySet()]);
    }
    
    global void execute (Database.BatchableContext BC, List<Object__c> objList){
        
    }
    
    global void finish(Database.BatchableContext BC){
        
    }

}

Please advise any one how to resolve this issue ?
Is it possible to call the batch apex after deleting the records ?


Thanks,
Lakshmi S
 
Hi Team,

Batch Apex Mass Upload Issue ?
Requirement : Need to Update Account fileds from Custom object based on condition.For 1 record we need to update around 5000 Account records with some value.
How can we achieve this request ?
I have tried with trigger and batch apex, for 1 record it is working. But mass upload it is not working.

Please advise any one.

Thanks,
Lakshmi S.
Hi Team,

Below code is not covered 75% code coverage, please advise any one how to resolve this issue ?
Handler class
-------------------------
public with sharing class ClientHandlerCtrl {
    
    public static boolean insertRecursiveStop = true;
    public static boolean updateRecursiveStop = true;
    
    public static void ClientInsert(Map<Id,Client__c> newMap){
        
        try{
            Set<String> usrName = new Set<String>();
        
            for(ID clientIds : newMap.keySet()){
                            
                Client__c client = newMap.get(clientIds);
                if(client.Client_Manager__c != Null){
                    usrName.add(client.Client_Manager__c);
                }
            }
            
            List<User> userList = [Select id,Name from User where name in :usrName and IsActive=true];
            
            for(ID clientIds : newMap.keySet()){
                Client__c client = newMap.get(clientIds);
                
                                
                    if(client.Client_Manager__c != Null && userList.size() > 0){
                        
                        for(user usr : userList){
                        
                        if(client.Client_Manager__c == usr.Name){
                            client.Client_Manager_Lookup__c = usr.Id;
                        }
                    }
                                        
                }
                else
                    {
                            client.Client_Manager_Lookup__c = Null;
                    }
                
            }
            
        }
        catch(Exception ex){
            System.debug('Exception caught in client insert method :'+ex.getMessage());
        }
    }
    
    public static void ClientUpdate(Map<Id,Client__c> updateMap){
        
        try{
            
            Set<String> usrName = new Set<String>();
        
            for(ID clientIds : updateMap.keySet()){
                            
                Client__c client = updateMap.get(clientIds);
                if(client.Client_Manager__c != Null){
                    usrName.add(client.Client_Manager__c);
                }
            }
            
            List<User> userList = [Select id,Name from User where name in :usrName and IsActive=true];
            
            for(ID clientIds : updateMap.keySet()){
                Client__c client = updateMap.get(clientIds);
                
                                
                    if(client.Client_Manager__c != Null && userList.size() > 0){
                        
                        for(user usr : userList){
                        
                        if(client.Client_Manager__c == usr.Name){
                            client.Client_Manager_Lookup__c = usr.Id;
                        }
                    }
                                        
                }
                else
                    {
                            client.Client_Manager_Lookup__c = Null;
                    }
                
            }
        }
        catch(Exception ex){
            System.debug('Exception caught in client update method :'+ex.getMessage());
        }
    }
    
}


Test Class
----------------
@isTest
private class TestClientTrigger {
    
    @testSetup
    private static void createTestData(){
        
        List<User> usrList = new List<User>();
        
        for(Integer i=0; i<3 ; i++){
            User usr = new User();
            usr.ProfileId = [SELECT Id FROM Profile WHERE Name = 'System Administrator'].Id;
           
            if(i==0){
                usr.FirstName = 'Lakshmi';
                usr.LastName = 'S';
                usr.Email = 'lakshmis@gmail.com';
                usr.Username = 'lakshmis@gmail.com';
                usr.Alias = 'laks';
            }
            else if(i==1){
                usr.FirstName = 'Ajay';
                usr.LastName = 'D';
                usr.Email = 'Ajayd@gmail.com';
                usr.Username = 'Ajayd@gmail.com';
                usr.Alias = 'ajayd';
            }
            else if(i==2){
                usr.FirstName = 'Naresh';
                usr.LastName = 'K';
                usr.Email = 'nareshk@gmail.com;
                usr.Username = 'nareshk@gmail.com';
                usr.Alias = 'naresh';
            }
            
            usr.CompanyName = 'TEST';
            usr.Title = 'title';
            usr.TimeZoneSidKey = 'America/Los_Angeles';
            usr.EmailEncodingKey = 'UTF-8';
            usr.LanguageLocaleKey = 'en_US';
            usr.LocaleSidKey = 'en_US';
            
            usrList.add(usr);
        }
        
        insert usrList;
        
        Account acc = new Account();
        acc.Name = 'Dummy Account';
        insert acc;
        
        Map<Id,Client__c> fsList = new Map<Id,Client__c>();
        
        for(Integer i=0 ; i<3 ; i++){
            Client__c fs = new Client__c();
            fs.Account__c = acc.Id;
            if(i==0){
                fs.Client_Manager__c = 'Lakshmi S';
            }
            else if(i==1){
                fs.Client_Manager__c = 'Ajay D';
            }
            else if(i==2){
                fs.Client_Manager__c = 'Naresh K';
            }
            
            fsList.put(fs.Id,fs);
            
        }
        insert fsList.values();
    }
    
   
    
    @isTest
    private static void updateTest(){
        
        Account acc = [Select id from account];
        
        Client__c fs = [Select id,Client_Manager__c from Client__c limit 1];
        fs.Client_Manager__c = 'Naresh K';
        update fs;
        
    }
    
}
Please let me know.

Thanks,
Lakshmi S

 
Hi Team,

Can we use SOQL Query in inner for loop ?

EX:
for(Opportunity opp : Trigger.New){
        
        for(User usr : [Select id from user where name =:opp.Manager__c]){

            opp.Manager_Lookup__c = usr.Id;

        }
    }
Please advise.

Thanks,
Lakshmi S.
 
Hi Team,

Can we use more if conditions in before insert or update trigger handler class?
Example
-----------------
public with sharing class A {
     public static void beforeInsert(List<ObjectA> objA){
    
      for(ObjectA ob : objA){

       if(condition){
        
        }
         else
         {
         }
         if(condition){
             if(codition)
                    {
                    }
          }
        }

    }

}


Please Advise..

Thanks in Advance
Lakshmi S.
Hi Team,

How to display related content in Lightning ?

Thanks,
Lakshmi S.
Hi Team,

We are overriding Standard detail page using visualforce page in that we are added related lists " Open Activities" and "Activity History". In Lightning after adding Event or Task the detail page is not refreshed and newly added Event or Task not visible in the detail page.

Please let me know how can we resolve this issue.

Thanks in Advance.

Regards,
Lakshmi S.
Hi Team,

Visualforce page inputfield reRender based on condition, i am getting alignment issue. Please check and let me know how can we resolve this issue .
<apex:pageBlockSectionItem >
                    <Label>Account currently use or Not </Label>
                    <apex:actionRegion >
                        <apex:inputField value="{!Account.Account_currently_use__c}">
                            <apex:actionSupport event="onchange" reRender="desc" />
                        </apex:inputField>
                    </apex:actionRegion>
                    
 </apex:pageBlockSectionItem>
  <apex:outputPanel id="desc" layout="None" >
                <apex:pageBlockSectionItem rendered="{!if(Account.Account_currently_use__c == 'Yes',true,false)}" >
                    Acct currently use(Des)  
                    <apex:inputTextarea cols="50" rows="3" value="{!Account.Acct_currently_use_Des__c}"/>
               </apex:pageBlockSectionItem>
 </apex:outputPanel>
Note : I am using these two fields in same pageblocksection.
Alignment is not showing correctly.

 
Hi Team,

How can we do Visualforce page block section hide & enable based on custom object picklist value ?


Thanks,
Lakshminarasimha.

 
Hi Team,

Requirement : We have two multiselect picklist fields called Country and Region.Based on country we need to update the Region.
Ex : Country - If we Select -- India, Ireland, Sweden, In Region we need to update like - MEA,UKI,Nordics.
Note : Both are Multiselect picklist fields and pre defined picklist values.
How can we achieve that.
Please let me know anyone.

Thanks,
Lakshmi.
 
Hi Team,
Requirement : Update Parent Object status based Task ?
Parent Object - A
Child Object - Task
Suppose one parent record has 2 tasks, if the 2 tasks status is completed then update status on parent A to completed other wise update to pending..
How can we do this using trigger or some other way.

Please let me know.

Thanks,
Lakshmi
 
Hi Team,

We are using trigger for updating count and sum from child to parent object. I am getting issue with one scenario.
Ex :
Parent -  A
Parent - B

Child -1.

Scenario : 1
------------------
Child -1 attached with Parent - A, now its updating Parent - A data.

Scenario : 2
---------------------
Child -1 attached with Parent- A, now i am updating the lookup field with Parent - B, Now Parent - B updating with child data but Parent - A data is not erased still it is showing Child - 1 data (sum and count).

Please let me know how can we resolve this issue.

Code :
----------
public static void rollupSumUpdate(Map<Id, child1__c> newRecs, Map<Id, child1__c> oldRecs){
   
        try{
            
            Set<String> parentIds = new Set<String>();
            
            for(Id chIds : newRecs.keySet()){
                
                child1__c tr = newRecs.get(chIds);
                
                if(tr.parentId__c != Null){
                    
                    parentIds.add(tr.parentId__c);
                    
                    System.debug('******If block -  Update Method - parentIds : **********'+parentIds);
                }
                else
                {
                    parentIds.add(oldRecs.get(chIds).parentId__c);
                    System.debug('******else block -  Update Method - parentIds : **********'+parentIds);
                }
                
            }
            
            Map<Id,parent__c> mapToUpdate = new Map<Id,parent__c>();
            
            if(parentIds.size() > 0){
                
                Map<Id,parent__c> fsOppMap = new Map<Id,parent__c>([Select Id,Amount__c,Trade_Count__c from parent__c where Id In :parentIds]);
                
                parent__c fsOpp = new parent__c();
                
                List<AggregateResult> ar = [Select parentId__c,Count(Id)tradeCount,Sum(Annual_Recurring_Revenue__c)arrSum,Sum(Non_Recurring_Revenue__c)nrrSum 
                                           from child1__c where parentId__c In :parentIds Group By parentId__c];
                System.debug('--------Aggregate Result : '+ar);
                
                If(ar.size() > 0){
                    
                    for(AggregateResult res : ar){
                        
                        Id fsId = (Id)res.get('parentId__c');
                        fsOpp = fsOppMap.get(fsId);
                        
                        fsOpp.Trade_Count__c = (Integer)res.get('tradeCount');
                        System.debug('---Update Method-----Trade Count : '+fsOpp.Trade_Count__c);
                        
                        Decimal arr = (Decimal)res.get('arrSum');
                        System.debug('----Update Method----ARR : '+arr);
                        
                        Decimal nrr = (Decimal)res.get('nrrSum');
                        System.debug('----Update Method----NRR : '+nrr);
                        
                        fsOpp.Amount__c = arr + nrr ;
                        System.debug('----Update Method----Amount : '+fsOpp.Amount__c);
                        
                        mapToUpdate.put(fsOpp.Id,fsOpp);
                        
                    }
                }
                else
                {
                    for(Id ids : parentIds){
                        
                        fsOpp = new parent__c(id = ids); 
                        
                        fsOpp.Trade_Count__c = Null;
                        System.debug('----Update Method--Else Block--Trade Count : '+fsOpp.Trade_Count__c);
                        
                        fsOpp.Amount__c = 0;
                        System.debug('----Update Method--Else Block--Amount : '+fsOpp.Amount__c);
                        
                        mapToUpdate.put(fsOpp.Id,fsOpp);
                        
                    }
                }
                
            }
            
            Database.SaveResult[] res = Database.update(mapToUpdate.values(), false);
            
            
        }
        catch(Exception ex){
            System.debug('---Exception caught in Rollup Sum Update Method :'+ex.getLineNumber());
        }
        
    }
Please let me know any one..

Thanks,
Lakshmi
 
Hi Team,

Requirement : Case (P) <-- Child Obj <-- Sub Child Obj :
Case is the parent to Child Obj and Child Obj is the parent to Sub Child Obj. If we delete the case record need to delete child and sub child records also. How can we achieve using Flow.

Please let me know anyone.

Thanks,
Lakshmi.
Hi Team,

Using trigger how can we do self lookup hierarchy rollup summary?
Please let me know.

Thanks,
Laskhmi.
Hi Team,

I have a requirement, Hierarchy Rollup Summary on Opportunity using Trigger . Please let me know how can we do this using Trigger.

Thanks,
Lakshmi
Hi Team,

We have updated the field in same object using before insert & Update triggers, Is it necessary to use Recursive class for this trigger.

Please let me know.

Thanks,
Lakshmi.
Hi Team,

AutoRabit is usful for small teams like 1 or 2 developers in salesforce.

Please let me know any one.

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,

I am calling batch apex using trigger after deleting the record, but Start method returns null.
How to query deleted records in batch apex start method.
Trigger :
----------

if(Trigger.isDelete){
                
   Database.executeBatch(new BatchUpdateAcct(Trigger.OldMap),1);
               
}

Batch Class
-------------

global class BatchUpdateAcct implements Database.Batchable<sObject> {
    
    Map<Id,Object__c> mapRecs = new Map<Id,Object__c>();
    
    global BatchUpdateAcct(Map<Id,Object__c> oldValue){
        mapRecs = oldValue;
       
    }
    
    global Database.QueryLocator start (Database.BatchableContext BC){
        System.debug('----Start Method-----'+mapRecs.keySet());
        return Database.getQueryLocator([Select id,Name from Object__c where id in :mapRecs.KeySet()]);
    }
    
    global void execute (Database.BatchableContext BC, List<Object__c> objList){
        
    }
    
    global void finish(Database.BatchableContext BC){
        
    }

}

Please advise any one how to resolve this issue ?
Is it possible to call the batch apex after deleting the records ?


Thanks,
Lakshmi S
 
Hi Team,

Batch Apex Mass Upload Issue ?
Requirement : Need to Update Account fileds from Custom object based on condition.For 1 record we need to update around 5000 Account records with some value.
How can we achieve this request ?
I have tried with trigger and batch apex, for 1 record it is working. But mass upload it is not working.

Please advise any one.

Thanks,
Lakshmi S.
Hi Team,

Below code is not covered 75% code coverage, please advise any one how to resolve this issue ?
Handler class
-------------------------
public with sharing class ClientHandlerCtrl {
    
    public static boolean insertRecursiveStop = true;
    public static boolean updateRecursiveStop = true;
    
    public static void ClientInsert(Map<Id,Client__c> newMap){
        
        try{
            Set<String> usrName = new Set<String>();
        
            for(ID clientIds : newMap.keySet()){
                            
                Client__c client = newMap.get(clientIds);
                if(client.Client_Manager__c != Null){
                    usrName.add(client.Client_Manager__c);
                }
            }
            
            List<User> userList = [Select id,Name from User where name in :usrName and IsActive=true];
            
            for(ID clientIds : newMap.keySet()){
                Client__c client = newMap.get(clientIds);
                
                                
                    if(client.Client_Manager__c != Null && userList.size() > 0){
                        
                        for(user usr : userList){
                        
                        if(client.Client_Manager__c == usr.Name){
                            client.Client_Manager_Lookup__c = usr.Id;
                        }
                    }
                                        
                }
                else
                    {
                            client.Client_Manager_Lookup__c = Null;
                    }
                
            }
            
        }
        catch(Exception ex){
            System.debug('Exception caught in client insert method :'+ex.getMessage());
        }
    }
    
    public static void ClientUpdate(Map<Id,Client__c> updateMap){
        
        try{
            
            Set<String> usrName = new Set<String>();
        
            for(ID clientIds : updateMap.keySet()){
                            
                Client__c client = updateMap.get(clientIds);
                if(client.Client_Manager__c != Null){
                    usrName.add(client.Client_Manager__c);
                }
            }
            
            List<User> userList = [Select id,Name from User where name in :usrName and IsActive=true];
            
            for(ID clientIds : updateMap.keySet()){
                Client__c client = updateMap.get(clientIds);
                
                                
                    if(client.Client_Manager__c != Null && userList.size() > 0){
                        
                        for(user usr : userList){
                        
                        if(client.Client_Manager__c == usr.Name){
                            client.Client_Manager_Lookup__c = usr.Id;
                        }
                    }
                                        
                }
                else
                    {
                            client.Client_Manager_Lookup__c = Null;
                    }
                
            }
        }
        catch(Exception ex){
            System.debug('Exception caught in client update method :'+ex.getMessage());
        }
    }
    
}


Test Class
----------------
@isTest
private class TestClientTrigger {
    
    @testSetup
    private static void createTestData(){
        
        List<User> usrList = new List<User>();
        
        for(Integer i=0; i<3 ; i++){
            User usr = new User();
            usr.ProfileId = [SELECT Id FROM Profile WHERE Name = 'System Administrator'].Id;
           
            if(i==0){
                usr.FirstName = 'Lakshmi';
                usr.LastName = 'S';
                usr.Email = 'lakshmis@gmail.com';
                usr.Username = 'lakshmis@gmail.com';
                usr.Alias = 'laks';
            }
            else if(i==1){
                usr.FirstName = 'Ajay';
                usr.LastName = 'D';
                usr.Email = 'Ajayd@gmail.com';
                usr.Username = 'Ajayd@gmail.com';
                usr.Alias = 'ajayd';
            }
            else if(i==2){
                usr.FirstName = 'Naresh';
                usr.LastName = 'K';
                usr.Email = 'nareshk@gmail.com;
                usr.Username = 'nareshk@gmail.com';
                usr.Alias = 'naresh';
            }
            
            usr.CompanyName = 'TEST';
            usr.Title = 'title';
            usr.TimeZoneSidKey = 'America/Los_Angeles';
            usr.EmailEncodingKey = 'UTF-8';
            usr.LanguageLocaleKey = 'en_US';
            usr.LocaleSidKey = 'en_US';
            
            usrList.add(usr);
        }
        
        insert usrList;
        
        Account acc = new Account();
        acc.Name = 'Dummy Account';
        insert acc;
        
        Map<Id,Client__c> fsList = new Map<Id,Client__c>();
        
        for(Integer i=0 ; i<3 ; i++){
            Client__c fs = new Client__c();
            fs.Account__c = acc.Id;
            if(i==0){
                fs.Client_Manager__c = 'Lakshmi S';
            }
            else if(i==1){
                fs.Client_Manager__c = 'Ajay D';
            }
            else if(i==2){
                fs.Client_Manager__c = 'Naresh K';
            }
            
            fsList.put(fs.Id,fs);
            
        }
        insert fsList.values();
    }
    
   
    
    @isTest
    private static void updateTest(){
        
        Account acc = [Select id from account];
        
        Client__c fs = [Select id,Client_Manager__c from Client__c limit 1];
        fs.Client_Manager__c = 'Naresh K';
        update fs;
        
    }
    
}
Please let me know.

Thanks,
Lakshmi S

 
Hi Team,

Can we use SOQL Query in inner for loop ?

EX:
for(Opportunity opp : Trigger.New){
        
        for(User usr : [Select id from user where name =:opp.Manager__c]){

            opp.Manager_Lookup__c = usr.Id;

        }
    }
Please advise.

Thanks,
Lakshmi S.
 
Hi Team,

We are overriding Standard detail page using visualforce page in that we are added related lists " Open Activities" and "Activity History". In Lightning after adding Event or Task the detail page is not refreshed and newly added Event or Task not visible in the detail page.

Please let me know how can we resolve this issue.

Thanks in Advance.

Regards,
Lakshmi S.
Hi Team,

Visualforce page inputfield reRender based on condition, i am getting alignment issue. Please check and let me know how can we resolve this issue .
<apex:pageBlockSectionItem >
                    <Label>Account currently use or Not </Label>
                    <apex:actionRegion >
                        <apex:inputField value="{!Account.Account_currently_use__c}">
                            <apex:actionSupport event="onchange" reRender="desc" />
                        </apex:inputField>
                    </apex:actionRegion>
                    
 </apex:pageBlockSectionItem>
  <apex:outputPanel id="desc" layout="None" >
                <apex:pageBlockSectionItem rendered="{!if(Account.Account_currently_use__c == 'Yes',true,false)}" >
                    Acct currently use(Des)  
                    <apex:inputTextarea cols="50" rows="3" value="{!Account.Acct_currently_use_Des__c}"/>
               </apex:pageBlockSectionItem>
 </apex:outputPanel>
Note : I am using these two fields in same pageblocksection.
Alignment is not showing correctly.

 
Hi Team,

How can we do Visualforce page block section hide & enable based on custom object picklist value ?


Thanks,
Lakshminarasimha.

 
Hi Team,

Requirement : We have two multiselect picklist fields called Country and Region.Based on country we need to update the Region.
Ex : Country - If we Select -- India, Ireland, Sweden, In Region we need to update like - MEA,UKI,Nordics.
Note : Both are Multiselect picklist fields and pre defined picklist values.
How can we achieve that.
Please let me know anyone.

Thanks,
Lakshmi.
 
Hi Team,

We are using trigger for updating count and sum from child to parent object. I am getting issue with one scenario.
Ex :
Parent -  A
Parent - B

Child -1.

Scenario : 1
------------------
Child -1 attached with Parent - A, now its updating Parent - A data.

Scenario : 2
---------------------
Child -1 attached with Parent- A, now i am updating the lookup field with Parent - B, Now Parent - B updating with child data but Parent - A data is not erased still it is showing Child - 1 data (sum and count).

Please let me know how can we resolve this issue.

Code :
----------
public static void rollupSumUpdate(Map<Id, child1__c> newRecs, Map<Id, child1__c> oldRecs){
   
        try{
            
            Set<String> parentIds = new Set<String>();
            
            for(Id chIds : newRecs.keySet()){
                
                child1__c tr = newRecs.get(chIds);
                
                if(tr.parentId__c != Null){
                    
                    parentIds.add(tr.parentId__c);
                    
                    System.debug('******If block -  Update Method - parentIds : **********'+parentIds);
                }
                else
                {
                    parentIds.add(oldRecs.get(chIds).parentId__c);
                    System.debug('******else block -  Update Method - parentIds : **********'+parentIds);
                }
                
            }
            
            Map<Id,parent__c> mapToUpdate = new Map<Id,parent__c>();
            
            if(parentIds.size() > 0){
                
                Map<Id,parent__c> fsOppMap = new Map<Id,parent__c>([Select Id,Amount__c,Trade_Count__c from parent__c where Id In :parentIds]);
                
                parent__c fsOpp = new parent__c();
                
                List<AggregateResult> ar = [Select parentId__c,Count(Id)tradeCount,Sum(Annual_Recurring_Revenue__c)arrSum,Sum(Non_Recurring_Revenue__c)nrrSum 
                                           from child1__c where parentId__c In :parentIds Group By parentId__c];
                System.debug('--------Aggregate Result : '+ar);
                
                If(ar.size() > 0){
                    
                    for(AggregateResult res : ar){
                        
                        Id fsId = (Id)res.get('parentId__c');
                        fsOpp = fsOppMap.get(fsId);
                        
                        fsOpp.Trade_Count__c = (Integer)res.get('tradeCount');
                        System.debug('---Update Method-----Trade Count : '+fsOpp.Trade_Count__c);
                        
                        Decimal arr = (Decimal)res.get('arrSum');
                        System.debug('----Update Method----ARR : '+arr);
                        
                        Decimal nrr = (Decimal)res.get('nrrSum');
                        System.debug('----Update Method----NRR : '+nrr);
                        
                        fsOpp.Amount__c = arr + nrr ;
                        System.debug('----Update Method----Amount : '+fsOpp.Amount__c);
                        
                        mapToUpdate.put(fsOpp.Id,fsOpp);
                        
                    }
                }
                else
                {
                    for(Id ids : parentIds){
                        
                        fsOpp = new parent__c(id = ids); 
                        
                        fsOpp.Trade_Count__c = Null;
                        System.debug('----Update Method--Else Block--Trade Count : '+fsOpp.Trade_Count__c);
                        
                        fsOpp.Amount__c = 0;
                        System.debug('----Update Method--Else Block--Amount : '+fsOpp.Amount__c);
                        
                        mapToUpdate.put(fsOpp.Id,fsOpp);
                        
                    }
                }
                
            }
            
            Database.SaveResult[] res = Database.update(mapToUpdate.values(), false);
            
            
        }
        catch(Exception ex){
            System.debug('---Exception caught in Rollup Sum Update Method :'+ex.getLineNumber());
        }
        
    }
Please let me know any one..

Thanks,
Lakshmi
 
Hi Team,

We have updated the field in same object using before insert & Update triggers, Is it necessary to use Recursive class for this trigger.

Please let me know.

Thanks,
Lakshmi.
Hi Team,

Requirement : Update the Field A based on Field B value using trigger, Filed B value updated using Work flow. How can we achieve that using trigger (Insert and update events) .

Please let me know.

Thanks,
Lakshmi.
Hi Team,

Please advise below trigger format is correct or not, we are avoiding recursive triggers using static methods in helper class.
trigger testTrigger on Account(before insert, before update, after insert){
        if(Trigger.isInsert){
            if(Trigger.isAfter){
           TriggerHandlerCls.testMethod(Trigger.New);
          }
    }

}

class:
---------
public class TriggerHandlerCls{

public static void testMethod(List<Account> acc){
// logic

}

}
Please let me know.

Thanks,
Lakshmi
 
Hi Team,

Can we use System.debug(' caught exception'+ex.getMessage()) this statement in catch block (Production).
Please advise is this any issue in production.

Thanks,
Lakshmin.