• Lalitha Pavani Rallabandi 13
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
Hi,
How to generate a unique session ID when the user login and logout from the sites login page
I created sites and assigned a custom login page as a home page.I want to redirect users to portal login page if their session is timeout. There is no document even mentioned how to handle it from Apex. Can someone help me on this problem please?


 
Hi,
I am trying to remove the change owner button on lead object. I removed the modify all permission and unchecked the Transfer records permission on the respective profile. Still I am not able to remove the button.User-added imageUser-added imageUser-added imagePlease help me out on this
Hi,
Is there any way to change the text "Select a record type" text to some other custom text.
This is the standard dialogue box upon clicking new button to create a new record

Hi,
I recetly started working on Financial Service Cloud and I am new to Salesforce. When I am trying to convert a lead, it is converting in to person account irrespective of the record type. How can i convert it into business account or how to select an option while converting. 

I tried by choosing new account upon conversion and i selected business record type. When I click on convert , it is throwing a error messages to select only person accounts. 

Please help me on it

Hi,
I am trying to display the records in coloumns using <apex:selectRadio> in <apex:repeat>, but the alignment is differing based on the number of characters field having. Here is the output User-added image
Please help me on this
Hi,
I stored all the editable fields in a variable and calling the variable in a dynamic SOQL query.
My Query: 
String fieldApiList = String.join(fieldsApiNames, ',');
        query = 'SELECT Name,'+ fieldApiList +' from EP_Service_License__c WHERE ID IN:recordIdSet';
        
        SelectedEpserviceRecords=Database.query(query);
Now, using a VF page I am displaying the fields and its values like as follows
User-added imagemy requirement is, if any field value is null or blank in the selected records or any field values is same in all the selected records then I should not display that field. 
For example, here in the picture, product license number is same for all the selected records and Copy Primary Prod Co License(s) field is null for all the selected records. Now, I should avoid displaying those two in the output. This should happen dynamically for all the fields.

Kindly help me on this
 

Hi,
I am trying to fetch the object name dynamically from the key prefix of current recordID. I am able to get the fields dynamically using a lightning component from every sobject. I tried to fetch the record names and I succeeded. From the same I trying to fetch the duplicate records upon clicking a button on the record page. 

Scenario: Upon clicking the button on the record page, it should redirect to the other tab/window and display similar kinds of records with the record name. Here I wrote two SOQLs. 

1. Fetch the record names
2. T fetch the duplicate records based on name.

Here, I wrote a soql query and it is returning the list of records available on the object in a lightning component. Now I want to store the record name in a variable. Here I am getting the error:
 Here is the code I wrote:
 

public class LightningSchemaGlobalDescribe {
    
    @AuraEnabled
    public static list<sobject> fetchlables(String recordIdOrPrefix){
        List<String> objFields = new  List<String>();
        list<string> fields = new  list<string>();
        list<string>    fieldvalues = new list<string>();
        list<sobject> records;
        
        String objectName = '';
        list<Sobject> lists;
        try{
            
            String myIdPrefix = String.valueOf(recordIdOrPrefix).substring(0,3); 
            
            
            Map<String, Schema.SObjectType> gd =  Schema.getGlobalDescribe(); 
            
            
            for(Schema.SObjectType stype : gd.values()){
                
                
                Schema.DescribeSObjectResult r = stype.getDescribe();
                
                String prefix = r.getKeyPrefix();
                
                if(prefix!=null && prefix.equals(myIdPrefix)){
                    
                    objectName = r.getName();
                    
                    String getRecordNameQuery= 'Select Id,name from '+ objectName +' WHERE ' +' id = :recordIdOrPrefix ';
                    
                    //	lists= Database.query(getRecordNameQuery);
                    
                    //	system.debug(lists);
                    
                    String sObjectName = objectName;
                    Schema.SObjectType t = Schema.getGlobalDescribe().get(sObjectName);
                    SObject s = t.newSObject();
                    system.debug(s);
                    //we are storing names of the Object
                    lists= Database.query(getRecordNameQuery);
                    
                    system.debug(lists);
                    
                    string recordname=lists.name;  
                    
                    if(objectName!=null){
                        Map<String, Schema.SObjectField> efields = Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap();
                        
                        list<string> editableFields = new list<string> ();
                        
                        
                        for(schema.SObjectField editfieds :efields.values()){
                            
                            schema.DescribeFieldResult fieldResult = editfieds.getDescribe();
                            
                            
                            if(fieldResult.isUpdateable() ){
                                
                                editableFields.add(fieldResult.getName());
                                
                                objFields = new List<String>(editableFields);
                                system.debug('editableFields::' + editableFields);
                                system.debug('objFields::' + objFields);
                                string fieldnamess = 'SELECT '+ objFields + ' FROM '+ objectName + ' WHERE  Name LIKE %'+lists ;	
                                list<Sobject> listoffields = Database.query(fieldnamess);
                                system.debug(listoffields); 
                                
                                // system.debug('Fields:::'+objFields);
                                
                            }
                            
                            
                        }
                        
                    }  
                    
                }
                
            }
            
        }
        
        
        catch(Exception e){
            //print the error message
            System.debug(e);
        }
        return lists;
    }
    
    
}
I am getting the following error:
User-added image

Please help me with this
 

Hi,
I am trying to remove the change owner button on lead object. I removed the modify all permission and unchecked the Transfer records permission on the respective profile. Still I am not able to remove the button.User-added imageUser-added imageUser-added imagePlease help me out on this
Hi,
I stored all the editable fields in a variable and calling the variable in a dynamic SOQL query.
My Query: 
String fieldApiList = String.join(fieldsApiNames, ',');
        query = 'SELECT Name,'+ fieldApiList +' from EP_Service_License__c WHERE ID IN:recordIdSet';
        
        SelectedEpserviceRecords=Database.query(query);
Now, using a VF page I am displaying the fields and its values like as follows
User-added imagemy requirement is, if any field value is null or blank in the selected records or any field values is same in all the selected records then I should not display that field. 
For example, here in the picture, product license number is same for all the selected records and Copy Primary Prod Co License(s) field is null for all the selected records. Now, I should avoid displaying those two in the output. This should happen dynamically for all the fields.

Kindly help me on this
 

Hi,
I am trying to fetch the object name dynamically from the key prefix of current recordID. I am able to get the fields dynamically using a lightning component from every sobject. I tried to fetch the record names and I succeeded. From the same I trying to fetch the duplicate records upon clicking a button on the record page. 

Scenario: Upon clicking the button on the record page, it should redirect to the other tab/window and display similar kinds of records with the record name. Here I wrote two SOQLs. 

1. Fetch the record names
2. T fetch the duplicate records based on name.

Here, I wrote a soql query and it is returning the list of records available on the object in a lightning component. Now I want to store the record name in a variable. Here I am getting the error:
 Here is the code I wrote:
 

public class LightningSchemaGlobalDescribe {
    
    @AuraEnabled
    public static list<sobject> fetchlables(String recordIdOrPrefix){
        List<String> objFields = new  List<String>();
        list<string> fields = new  list<string>();
        list<string>    fieldvalues = new list<string>();
        list<sobject> records;
        
        String objectName = '';
        list<Sobject> lists;
        try{
            
            String myIdPrefix = String.valueOf(recordIdOrPrefix).substring(0,3); 
            
            
            Map<String, Schema.SObjectType> gd =  Schema.getGlobalDescribe(); 
            
            
            for(Schema.SObjectType stype : gd.values()){
                
                
                Schema.DescribeSObjectResult r = stype.getDescribe();
                
                String prefix = r.getKeyPrefix();
                
                if(prefix!=null && prefix.equals(myIdPrefix)){
                    
                    objectName = r.getName();
                    
                    String getRecordNameQuery= 'Select Id,name from '+ objectName +' WHERE ' +' id = :recordIdOrPrefix ';
                    
                    //	lists= Database.query(getRecordNameQuery);
                    
                    //	system.debug(lists);
                    
                    String sObjectName = objectName;
                    Schema.SObjectType t = Schema.getGlobalDescribe().get(sObjectName);
                    SObject s = t.newSObject();
                    system.debug(s);
                    //we are storing names of the Object
                    lists= Database.query(getRecordNameQuery);
                    
                    system.debug(lists);
                    
                    string recordname=lists.name;  
                    
                    if(objectName!=null){
                        Map<String, Schema.SObjectField> efields = Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap();
                        
                        list<string> editableFields = new list<string> ();
                        
                        
                        for(schema.SObjectField editfieds :efields.values()){
                            
                            schema.DescribeFieldResult fieldResult = editfieds.getDescribe();
                            
                            
                            if(fieldResult.isUpdateable() ){
                                
                                editableFields.add(fieldResult.getName());
                                
                                objFields = new List<String>(editableFields);
                                system.debug('editableFields::' + editableFields);
                                system.debug('objFields::' + objFields);
                                string fieldnamess = 'SELECT '+ objFields + ' FROM '+ objectName + ' WHERE  Name LIKE %'+lists ;	
                                list<Sobject> listoffields = Database.query(fieldnamess);
                                system.debug(listoffields); 
                                
                                // system.debug('Fields:::'+objFields);
                                
                            }
                            
                            
                        }
                        
                    }  
                    
                }
                
            }
            
        }
        
        
        catch(Exception e){
            //print the error message
            System.debug(e);
        }
        return lists;
    }
    
    
}
I am getting the following error:
User-added image

Please help me with this