• K_T
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
I have a lighting app record detail page (The one where you drag and drop). I've created a new Action to display on the highlights panel.
In the SFDC Classic page layout, I've added the action to the section "Salesforce1 and Lightning Experience Actions". However, it doesn't display on the highlight panels. I have a few other actions which I've created in the same way and they display just fine. I can change the order of the actions and they change immediately on the lightning app record detail page so I know it's updating properly.
Any suggestions as to why it's not displaying my action?
Thanks!


In the list below, I'm expecting to see "New Contact Report" in the dropdown list since I've added it to the layout. However the second picture shows it doesn't have it.

User-added imageUser-added image
  • June 26, 2017
  • Like
  • 0
In lightning you are not able to do URL hacking. In order to do any prepopulation of fields, it is suggested to use a quick action.
If we have a related list object and we are trying to prepopulate the object of the related list, we would make a quick action and remove the "New" button. However, to a user, this will probably be very confusing since sometimes the new button is on the related list, sometimes you have to go to the top right/highlights panel to find the quick action button. Is there anyway to standardize both quick action and "new" button?
The link below mentions that it is not possible to put the quick action onto the related list.
https://success.salesforce.com/answers?id=9063A000000pDJlQAM
I thought about the idea of overriding the "New" button to call a quick action, but that doesn't seem to be possible.
Any suggestions is greatly appreciated!
  • June 08, 2017
  • Like
  • 0
I am trying to retrieve a child sobject's parent's field, but I'm getting an invalid field error. This is the code snippet:

The account Id would be the Id of an account with contacts, of course. 
List<Sobject> sobjectList = [SELECT Id, (SELECT Owner.Name, ownerId FROM Contacts) FROM Account where Id = '001E000000nG22yIAC' ];

List<Sobject> contList = sobjectList.get(0).getSobjects('contacts');
System.debug(loggingLevel.ERROR, 'cont list: ' + contList);
for (Sobject cont : contList) {

    String name = (String)cont.get('Owner.Name');
    System.debug(loggingLevel.ERROR, ' name: ' + name);
}

Is this a known limitation of Salesforce? 

  • August 08, 2014
  • Like
  • 0
If anyone could answer within the next couple of days, it would be greatly appreciated.
I'm running into a problem when I try to import data using the data loader. I want to import about 800 account records but everytime I try the records fail.
Here is my batch apex
global class LocationCallouts_2  implements Database.Batchable<sObject>, Database.AllowsCallouts{
        
    Id accountId; 
    Account[] a = [SELECT BillingCity,BillingCountry,BillingPostalCode,BillingState,BillingStreet FROM Account WHERE id =: accountId];
    
    global Iterable<sObject> start(Database.BatchableContext BC){
        return (a);
    }
    
    global void execute(Database.BatchableContext BC, List<sObject> scope){
        Account a = [SELECT BillingCity,BillingCountry,BillingPostalCode,BillingState,BillingStreet FROM Account WHERE id =: accountId];
        String geocodeKey = 'AIzaSyBo-6WwACjhUdg-I81NDtZK87r2xpv8b0U';
        String address = '';
        
        for (sObject s : scope){     
             
            if (a.BillingStreet != null)
                address += a.BillingStreet +', ';
            if (a.BillingCity != null)
                address += a.BillingCity +', ';
            if (a.BillingState != null)
                address += a.BillingState +' ';
            if (a.BillingPostalCode != null)
                address += a.BillingPostalCode +', ';
            if (a.BillingCountry != null)
                address += a.BillingCountry;
            
            address = EncodingUtil.urlEncode(address, 'UTF-8');
            
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            req.setEndpoint('http://maps.googleapis.com/maps/api/geocode/json?address='+address+ '&key='+geocodeKey+'&sensor=false');
            req.setMethod('GET');
            req.setTimeout(60000);
            
            try{
                // callout
                HttpResponse res = h.send(req);
                
                // parse coordinates from response
                JSONParser parser = JSON.createParser(res.getBody());
                double lat = null;
                double lon = null;
                
                while (parser.nextToken() != null){
                    if ((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&
                        (parser.getText() == 'location')){
                            parser.nextToken(); // object start
                            while (parser.nextToken() != JSONToken.END_OBJECT) {
                                String txt = parser.getText();
                                parser.nextToken();
                                if (txt == 'lat')
                                    lat = parser.getDoubleValue();
                                else if (txt == 'lng')
                                    lon = parser.getDoubleValue();
                            }
                        }
                }
                
                // update coordinates if we get back
                if (lat != null){
                    lat = a.Geocodes__Latitude__s;
                    lon = a.Geocodes__Longitude__s;
                    update a;
                }
                
            } 
            catch (Exception e){
            }
            
        }
	//LocationCallouts_2 batch = new LocationCallouts_2();
	//Database.executeBatch(new LocationCallouts_2(),20);
    }
      @future (callout=true)
    public static void startbatch(){
        LocationCallouts_2 batch = new LocationCallouts_2();
        Id batchprocessId = database.executeBatch(batch);
        System.debug('Apex Job Id' + batchprocessId);
    }
    
    global void finish(Database.BatchableContext BC){
        
    }
    
    
}

And here is my trigger
// Trigger runs getLocation() on Accounts with no Geolocation
/*
trigger SetGeolocation on Account (after insert, after update) 
    {
        for (Account a : trigger.new)
            {
                Boolean addressChangedFlag = false;
                
                if (a.Geocodes__Latitude__s == null)
                    {
                        LocationCallouts.getLocation(a.id);
                    }
            }
    }
*/

trigger SetGeolocation on Account (after insert, after update) 
    {
        for (Account a : trigger.new)
            {
                Boolean addressChangedFlag = false;
                
                if (a.Geocodes__Latitude__s == null)
                    {
                        Database.executeBatch(new LocationCallouts_2());
                    }
            }
    }

 
Hello all, 

I hope that you can give me some tips, tricks or recommendations, I´m 2 weeks from merging three orgs from a customer into one.

I think that it´s easy even if they have custom objects, I just can decide if I do it like this:

Option A: Metadata retrieve all the Information (Accounts, Opportunities, Cases, Custom Objects, etc..) from each one into a Test Environment and from there merge the accounts and start cleaning the information.
NOTE: I´m just an admin learning my way into Development, NO CODE background, learning as I post about Javascript, Apex, HTML, etc..

Option B: Salesforce Connect - Share the data and clean all the information manually! I think this will take more time but for my level of knowledge is a safe way of doing it.

Option C: The old export/import information to csv and validate the information there and then set it in the global org. 

Any help is great!

Thanks!!
I have input address details in the "company" but wish to export the data to the address within the "contact" en mass.  Is this possible?
I have use batch class to perform DML operation but I got a an email saying I have " System.LimitException :Too many DML rows: 10001". I try to solve this issue but could not figure out. Would be glad if anyone could help me out with this issue.
I am trying to retrieve a child sobject's parent's field, but I'm getting an invalid field error. This is the code snippet:

The account Id would be the Id of an account with contacts, of course. 
List<Sobject> sobjectList = [SELECT Id, (SELECT Owner.Name, ownerId FROM Contacts) FROM Account where Id = '001E000000nG22yIAC' ];

List<Sobject> contList = sobjectList.get(0).getSobjects('contacts');
System.debug(loggingLevel.ERROR, 'cont list: ' + contList);
for (Sobject cont : contList) {

    String name = (String)cont.get('Owner.Name');
    System.debug(loggingLevel.ERROR, ' name: ' + name);
}

Is this a known limitation of Salesforce? 

  • August 08, 2014
  • Like
  • 0