• John Brodrick
  • NEWBIE
  • 40 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 12
    Replies
VF page not refreshing in LEX when child record created
Create a visualforce page that will override a standard salesforce detail page for a custom object.  On that visualforce page include the detail section as well as related lists.  Configure the view button to use the VF page as an override instead of the standard page.

Now when navigating to the page (view the object) in lightning experience, scroll to one of the related lists.  Click the new button on the related list.  The lightning experience record create popup will appear, you fill out required information and click save.  The child record is successfully inserted into the database but the visualforce override page for the parent does not refresh to show the new child record in the database.  You have to manually refresh the page.  No clue on a workaround to this - seems like a bug.

 
Hi All-  I am aware that joined reports are not supported in Lightning Experience... but why does it not automatically redirect you to classic?  Is there anything I can do to avoid having my users have to manually switch back to classic, find the report, do whatever they wanted to do, then switch back to Lightning Experience to continue working each time they want to view a joined report?  I feel like this is going to affect adoption of Lightning Experience for my userbase.

Thanks!

I have a tricky requirement in my project.  We are currently storing sets of up to 8 geolocation fields in a custom object that can represent anything from a point, a line, up to a 8 sided polygon for display on a map.  The client would like the ability that given a single shape (call it the "Selected" shape) only display other polygons that are within a certain distance to the selected shape (e.g. 1 mile).

So in short I am going to need to find a way to calculate the distance between two polygons represented by up to 8 geocode fields.  Now obviously calculating distance between two points is easy using the DISTANCE function which is accessible even in SOQL.  I'm looking for some better suggestions on how to approach this though for lines and polygons?

Currently I found this on stack overflow:

http://gis.stackexchange.com/questions/11409/calculating-the-distance-between-a-point-and-a-virtual-line-of-two-lat-lngs

I'm thinking I could use that formula by interating over all points in the selected polygon and finding the distance between the point and each side of a potential target polygon.  The shortest distance would be the distance between the polygons.

This is a pretty challenging problem IMO so I am open to all suggestions - just wondering if someone else has a better way of doing this than I do.

Hello All-

Maybe I'm doing something wrong here, but I am not getting the expected result.  I am trying to convert a UNIX timestamp to a DateTime object in Salesforce and the times that I am getting in the DateTime objects are way off.  Here are 3 examples:

System.debug(Datetime.newInstance(1426982400L).format());
       Debug Log: 1/17/1970 4:23 AM
       Expected: Sun, 22 Mar 2015 00:00:00 GMT

System.debug(Datetime.newInstance(1490140800L).format());
       Debug Log: USER_DEBUG|[197]|DEBUG|1/17/1970 9:55 PM
       Expected: Wed, 22 Mar 2017 00:00:00 GMT

System.debug(Datetime.newInstance(4645814400L).format());
       Debug Log: USER_DEBUG|[198]|DEBUG|2/23/1970 10:30 AM
       Expected: Mon, 22 Mar 2117 00:00:00 GMT

Again maybe there is something I am missing here.

Thanks,

John
Hello All-

When doing an Apex Callout to a secure site via HTTPS I am getting this error:

java.security.cert.CertificateException: No name matching xxx found

This site does have a valid ssl certificate installed and I have verified that the CA is listed here: https://developer.salesforce.com/page/Outbound_Messaging_SSL_CA_Certificates.

However, this site does have multiple domains and corresponding certificates all hosted on the same IP address.  From my research I have found that apparently salesforce doesn't support SNI (server name indication) which would be required in order to get the correct certificate back for the specific site I am trying to hit.  I am wondering what workarounds I can do other than:

1) Have them get more IP addresses
2) Make the call via HTTP instead of HTTPs

Does Salesforce have plans to support this in the future?  I would imagine that the need for this functionality is quite common.

Thanks,

John
Hello All-

When doing an Apex Callout to a secure site via HTTPS I am getting this error:

java.security.cert.CertificateException: No name matching xxx found

This site does have a valid ssl certificate installed and I have verified that the CA is listed here: https://developer.salesforce.com/page/Outbound_Messaging_SSL_CA_Certificates.

However, this site does have multiple domains and corresponding certificates all hosted on the same IP address.  From my research I have found that apparently salesforce doesn't support SNI (server name indication) which would be required in order to get the correct certificate back for the specific site I am trying to hit.  I am wondering what workarounds I can do other than:

1) Have them get more IP addresses
2) Make the call via HTTP instead of HTTPs

Does Salesforce have plans to support this in the future?  I would imagine that the need for this functionality is quite common.

Thanks,

John
VF page not refreshing in LEX when child record created
Create a visualforce page that will override a standard salesforce detail page for a custom object.  On that visualforce page include the detail section as well as related lists.  Configure the view button to use the VF page as an override instead of the standard page.

Now when navigating to the page (view the object) in lightning experience, scroll to one of the related lists.  Click the new button on the related list.  The lightning experience record create popup will appear, you fill out required information and click save.  The child record is successfully inserted into the database but the visualforce override page for the parent does not refresh to show the new child record in the database.  You have to manually refresh the page.  No clue on a workaround to this - seems like a bug.

 
I have a dashboard with various reports shown as charts in lightning in two environments. One is my dev and another is a test environment. Now for some odd reason, the charts are displayed a little differently between the two environments even though the the settings look identical in classic.
The issue is that we have two variables on the Y-axis. In the one environment, the two variable are displayed as so:

User-added image

The two scales are even height but different values and on opposite sides. This is not what I want. In the other environment is looks as so:

User-added image

With both variables on one side, separated by a comma. In classic, the chart options are the same! One interesting thing is that for the chart that looks how i want (comma separated), i can click the edit button in lightning, but I cannot click that button for the other environment. Any help on this would be greatly appreciated!
Thanks
Hi All-  I am aware that joined reports are not supported in Lightning Experience... but why does it not automatically redirect you to classic?  Is there anything I can do to avoid having my users have to manually switch back to classic, find the report, do whatever they wanted to do, then switch back to Lightning Experience to continue working each time they want to view a joined report?  I feel like this is going to affect adoption of Lightning Experience for my userbase.

Thanks!
I am having an issue passing an input field from a Visualforce page to new inserted records. The field I am trying to pass is 'Remarks_Special_Instructions__c' but when I put info in there it is not saving into the newly created records. I have tried a few different ways but no luck on any front. What are my issues? Thanks in advance!

Apex: 
public with sharing class quoteAssociatedSiteExtension {

	//Our collection of the class/wrapper objects cContact 
	public Quote theQuote {get; set;}
    public List<assLoc> assLocList {get; set;}
    
    public quoteAssociatedSiteExtension(ApexPages.StandardController controller) { 

        String quoteId = ApexPages.currentPage().getParameters().get('quoteId');
		theQuote = [select Id, AccountId from Quote where Id =:quoteId limit 1];
    }

	//This method uses a simple SOQL query to return a List of Contacts
	public List<assLoc> getAssLoc() {
		if(assLocList == null) {
			assLocList = new List<assLoc>();
			for(Site__c s: [select Id, Name, Account__r.Id, City__c, Country__c,Order_Master_ID__c, Order_Master_Link__c, Site_ID__c, Site_Main_Phone__c, State__c, Street__c, Zip__c
                            from Site__c 
                            where Account__r.Id=:theQuote.AccountId
                           ]) {
				// As each contact is processed we create a new cContact object and add it to the contactList
				assLocList.add(new assLoc(s));
			}
		}
		return assLocList;
	}
    
	public PageReference processSelected() {

                //We create a new list of Contacts that we be populated only with Contacts if they are selected
		List<Site__c> selectedAssociatedLocations = new List<Site__c>();

		//We will cycle through our list of cContacts and will check to see if the selected property is set to true, if it is we add the Contact to the selectedContacts list
		for(assLoc aLoc: getAssLoc()) {
			if(aLoc.selected == true) {
				selectedAssociatedLocations.add(aLoc.st);
			}
		}

		// Now we have our list of selected contacts and can perform any type of logic we want, sending emails, updating a field on the Contact, etc
		List<Associated_Location__c> nmal = new List<Associated_Location__c>();
        for(Site__c al: selectedAssociatedLocations) {          
            Associated_Location__c nal = new Associated_Location__c();
            nal.Site__c = al.Id;
            nal.Quote__c = theQuote.Id;
            nmal.add(nal);
		}
		insert nmal; 
        return new PageReference('/'+ApexPages.currentPage().getParameters().get('quoteId'));
	}


	// This is our wrapper/container class. A container class is a class, a data structure, or an abstract data type whose instances are collections of other objects. In this example a wrapper class contains both the standard salesforce object Contact and a Boolean value
	public class assLoc {
		public Associated_Location__c ac {get; set;}
        public Site__c st {get; set;}
        public Quote qt {get; set;}
		public Boolean selected {get; set;}

		//This is the contructor method. When we create a new cContact object we pass a Contact that is set to the con property. We also set the selected value to false
		public assLoc(Associated_Location__c a) {
			ac = a;
			selected = false;
		}        
        
        public assLoc(Site__c s) {
			st = s;
			selected = false;
		}
        
		public assLoc(Quote q) {
			qt = q;
			selected = false;
		}        
	}
}

Visualforce:
<apex:page standardController="Associated_Location__c" extensions="quoteAssociatedSiteExtension" >
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton value="Process Selected" action="{!processSelected}" rerender="table"/>
            </apex:pageBlockButtons>
            <!-- In our table we are displaying the cContact records -->
            <apex:pageBlockTable value="{!AssLoc}" var="a" id="table">
                <apex:column >
                    <!-- This is our selected Boolean property in our wrapper class -->
                    <apex:inputCheckbox value="{!a.selected}"/>
                </apex:column>
                <!-- This is how we access the contact values within our cContact container/wrapper -->
                <apex:column value="{!a.st.Street__c}" />
                <apex:column value="{!a.st.City__c}" />
                <apex:column value="{!a.st.State__c}" />
                <apex:column value="{!a.st.Zip__c}" />
                <apex:column headerValue="{!$ObjectType.Associated_Location__c.Fields.Remarks_Special_Instructions__c.Label}">
                    <apex:inputField value="{!a.ac.Remarks_Special_Instructions__c}" required="false"/>
                </apex:column>
               	<apex:column value="{!a.st.Site_Main_Phone__c}" />
                
                <apex:column value="{!a.st.Order_Master_Link__c}" />
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
Hello All-

Maybe I'm doing something wrong here, but I am not getting the expected result.  I am trying to convert a UNIX timestamp to a DateTime object in Salesforce and the times that I am getting in the DateTime objects are way off.  Here are 3 examples:

System.debug(Datetime.newInstance(1426982400L).format());
       Debug Log: 1/17/1970 4:23 AM
       Expected: Sun, 22 Mar 2015 00:00:00 GMT

System.debug(Datetime.newInstance(1490140800L).format());
       Debug Log: USER_DEBUG|[197]|DEBUG|1/17/1970 9:55 PM
       Expected: Wed, 22 Mar 2017 00:00:00 GMT

System.debug(Datetime.newInstance(4645814400L).format());
       Debug Log: USER_DEBUG|[198]|DEBUG|2/23/1970 10:30 AM
       Expected: Mon, 22 Mar 2117 00:00:00 GMT

Again maybe there is something I am missing here.

Thanks,

John
Hello All-

When doing an Apex Callout to a secure site via HTTPS I am getting this error:

java.security.cert.CertificateException: No name matching xxx found

This site does have a valid ssl certificate installed and I have verified that the CA is listed here: https://developer.salesforce.com/page/Outbound_Messaging_SSL_CA_Certificates.

However, this site does have multiple domains and corresponding certificates all hosted on the same IP address.  From my research I have found that apparently salesforce doesn't support SNI (server name indication) which would be required in order to get the correct certificate back for the specific site I am trying to hit.  I am wondering what workarounds I can do other than:

1) Have them get more IP addresses
2) Make the call via HTTP instead of HTTPs

Does Salesforce have plans to support this in the future?  I would imagine that the need for this functionality is quite common.

Thanks,

John