-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
5Questions
-
8Replies
Embedded VF page on Lightning not redirecting the same as in Classic (screenshots included)
In SF Classic, I added a home page component to the home page layout, like so:
When I click the "Edit" button, the iframe redirects to a new page (the only difference being a GET parameter I add to the URL called "edit"). You can see the address bar in both screenshots holds the same URL. The page itself does not reload, just the iframe.
Now I want this same behavior to happen on Lightning Experience. To start, I add the VF page as a component within the Lightning App Builder, and here's the initial result:
After clicking "Edit", the entire page gets redirected (rather than just the iframe), as seen below:
I'm brought to a completely new page altogether. How can I prevent this from happening? I want the iframe to reload seamlessly, while remaining on the home page.
VF Page:
<apex:page controller="TestRedirect"> <apex:pageBlock > <apex:pageBlockButtons location="top"> <apex:form > <apex:commandButton action="{!test}" value="Edit" /> </apex:form> </apex:pageBlockButtons> </apex:pageBlock> <apex:outputPanel rendered="{!editing}"> Editing </apex:outputPanel> </apex:page>
Controller:
public class TestRedirect { public Boolean editing {get;set;} public TestRedirect() { editing = ApexPages.currentPage().getParameters().get('edit') == 'true'; } public PageReference test() { PageReference pageRef = Page.TestRedirect; pageRef.getParameters().put('edit', 'true'); pageRef.setRedirect(true); return pageRef; } }
- E.J.R
- May 18, 2021
- Like
- 0
- Continue reading or reply
Custom object permissions are ignored for Site Guest User
- E.J.R
- February 05, 2021
- Like
- 0
- Continue reading or reply
The only time my code works is when developer console is open
I have a custom visualforce page that plots opportunities on the map, and color codes the map markers based on the driver's assigned color.
When I load the page with the developer console closed, the map markers don't get colored in:
To fix this, all I need to do is open the developer console, and voila, the colors show up:
I assume this is some kind of coding issue, but I don't want to confuse things by posting sample code. My main interest is how this is even possible. What effect does the developer console have on the execution of code? Any info would be helpful and speculation is welcome.Thanks!
- E.J.R
- October 15, 2018
- Like
- 0
- Continue reading or reply
Apex trigger only fires when developer console is open or trace flags are set.
I created a fairly simple 'before insert' trigger for opportunity products. When I test the trigger under the administrator account, with the developer console on, the code runs perfectly as intended. But when I close the developer console window, the trigger no longer fires.
The same thing happens for different users as well. If I set a trace flag for a particular user, the trigger fires just fine when logged in as that user. But after deleting the trace flag, the trigger stops firing. I can duplicate this behavior back and forth over and over.
If anyone could point me in the right direction, I would really appreciate it. Right now it's a struggle finding any relevant info.
Note sure if this will help but here's the code for the trigger:
trigger OpportunityProductInsert on OpportunityLineItem (before insert) { // List of all line items IDs before being inserted List<Id> oliIds = new List<Id>(); // List of all opportunity IDs of the line items List<Id> oliOppIds = new List<Id>(); // List of all product IDs associated to the line items List<Id> oliProductIds = new List<Id>(); for ( OpportunityLineItem newOli : trigger.new ) { oliIds.add(newOli.Id); oliOppIds.add(newOli.OpportunityId); oliProductIds.add(newOli.Product2Id); } // Map to retrieve the account ID for each opportunity Map<Id, Id> oliAccountIdMap = new Map<Id, Id>(); List<Opportunity> opps = [SELECT Id, AccountId FROM Opportunity WHERE Id IN: oliOppIds]; for ( Opportunity opp : opps ) { oliAccountIdMap.put(opp.Id, opp.AccountId); } // List of all product IDs that are inventory items List<Id> inventoryProductIds = new List<Id>(); List<Product2> products = [SELECT Id FROM Product2 WHERE IsNonInventory__c = false AND Id IN: oliProductIds]; for ( Product2 product : products ) { inventoryProductIds.add(product.Id); } // Map to retrieve a list of available products for each account Map<Id, List<Id>> accProductMap = new Map<Id, List<Id>>(); List<Id> accProductIds; List<AccountProduct__c> accProducts = [SELECT Account__c, Product__c FROM AccountProduct__c WHERE Account__c IN: oliAccountIdMap.values()]; for ( AccountProduct__c accProduct : accProducts ) { accProductIds = new List<Id>(); if ( accProductMap.containsKey(accProduct.Account__c) ) { accProductIds = accProductMap.get(accProduct.Account__c); } accProductIds.add(accProduct.Product__c); accProductMap.put(accProduct.Account__c, accProductIds); } // Check that the product is available on the account for ( OpportunityLineItem checkOli : trigger.new ) { accProductIds = new List<Id>(); Id accId; // Retrieve the account ID from the line item ID if ( oliAccountIdMap.containsKey(checkOli.OpportunityId) ) { accId = oliAccountIdMap.get(checkOli.OpportunityId); } if ( accId != null ) { // If the product ID on the line item is in the list of inventory items if ( inventoryProductIds.contains(checkOli.Product2Id) ) { accProductIds = new List<Id>(); // Retrieve list of available products on the account if ( accProductMap.containsKey(accId) ) { accProductIds = accProductMap.get(accId); } // If the product ID is not in the list of account product IDs if ( !accProductIds.contains(checkOli.Product2Id) ) { checkOli.addError('This product isn\'t available for this account.'); } } } } }
- E.J.R
- September 04, 2018
- Like
- 0
- Continue reading or reply
Unable to locate dependant components of a managed package during uninstallation
Hi,
I'm looking for some general advice. I've been desperately trying to uninstall this package from production for a few days. I started with 50 component conflicts and have gotten the list down to just 2, which are listed next. In bold are the components relying on the package, however I have not been able to locate them and there's no direct link like there was for the other conflicts.
Component Type: Package
Name: ServiceMax
Problem:This extension depends on the package you are trying to uninstall. ExpressCustomConfig
Component Type: Package
Name: ServiceMax
Problem: This extension depends on the package you are trying to uninstall. Email Service Report
Steps taken so far:
- Searched entire bank of meta data within Eclipse for "ExpressCustomConfig", "Email Service Report", and possible variations.
- Followed advice here: https://help.salesforce.com/apex/HTViewSolution?id=000199298
- Followed advice here: https://help.salesforce.com/apex/HTViewHelpDoc?id=distribution_uninstalling_packages.htm
- Found this post with almost identical problem but no replies: https://developer.salesforce.com/forums/?id=906F0000000kBccIAE
- Checked every section of the setup, especially under "Build" looking for components associated to the package that could be removed
If you could point me in the right direction or if you have any advice at all it would be greatly appreciated!
Thanks for your time.
- E.J.R
- August 16, 2016
- Like
- 1
- Continue reading or reply
Unable to locate dependant components of a managed package during uninstallation
Hi,
I'm looking for some general advice. I've been desperately trying to uninstall this package from production for a few days. I started with 50 component conflicts and have gotten the list down to just 2, which are listed next. In bold are the components relying on the package, however I have not been able to locate them and there's no direct link like there was for the other conflicts.
Component Type: Package
Name: ServiceMax
Problem:This extension depends on the package you are trying to uninstall. ExpressCustomConfig
Component Type: Package
Name: ServiceMax
Problem: This extension depends on the package you are trying to uninstall. Email Service Report
Steps taken so far:
- Searched entire bank of meta data within Eclipse for "ExpressCustomConfig", "Email Service Report", and possible variations.
- Followed advice here: https://help.salesforce.com/apex/HTViewSolution?id=000199298
- Followed advice here: https://help.salesforce.com/apex/HTViewHelpDoc?id=distribution_uninstalling_packages.htm
- Found this post with almost identical problem but no replies: https://developer.salesforce.com/forums/?id=906F0000000kBccIAE
- Checked every section of the setup, especially under "Build" looking for components associated to the package that could be removed
If you could point me in the right direction or if you have any advice at all it would be greatly appreciated!
Thanks for your time.
- E.J.R
- August 16, 2016
- Like
- 1
- Continue reading or reply
Embedded VF page on Lightning not redirecting the same as in Classic (screenshots included)
In SF Classic, I added a home page component to the home page layout, like so:
When I click the "Edit" button, the iframe redirects to a new page (the only difference being a GET parameter I add to the URL called "edit"). You can see the address bar in both screenshots holds the same URL. The page itself does not reload, just the iframe.
Now I want this same behavior to happen on Lightning Experience. To start, I add the VF page as a component within the Lightning App Builder, and here's the initial result:
After clicking "Edit", the entire page gets redirected (rather than just the iframe), as seen below:
I'm brought to a completely new page altogether. How can I prevent this from happening? I want the iframe to reload seamlessly, while remaining on the home page.
VF Page:
<apex:page controller="TestRedirect"> <apex:pageBlock > <apex:pageBlockButtons location="top"> <apex:form > <apex:commandButton action="{!test}" value="Edit" /> </apex:form> </apex:pageBlockButtons> </apex:pageBlock> <apex:outputPanel rendered="{!editing}"> Editing </apex:outputPanel> </apex:page>
Controller:
public class TestRedirect { public Boolean editing {get;set;} public TestRedirect() { editing = ApexPages.currentPage().getParameters().get('edit') == 'true'; } public PageReference test() { PageReference pageRef = Page.TestRedirect; pageRef.getParameters().put('edit', 'true'); pageRef.setRedirect(true); return pageRef; } }
- E.J.R
- May 18, 2021
- Like
- 0
- Continue reading or reply
Custom object permissions are ignored for Site Guest User
- E.J.R
- February 05, 2021
- Like
- 0
- Continue reading or reply
Apex trigger only fires when developer console is open or trace flags are set.
I created a fairly simple 'before insert' trigger for opportunity products. When I test the trigger under the administrator account, with the developer console on, the code runs perfectly as intended. But when I close the developer console window, the trigger no longer fires.
The same thing happens for different users as well. If I set a trace flag for a particular user, the trigger fires just fine when logged in as that user. But after deleting the trace flag, the trigger stops firing. I can duplicate this behavior back and forth over and over.
If anyone could point me in the right direction, I would really appreciate it. Right now it's a struggle finding any relevant info.
Note sure if this will help but here's the code for the trigger:
trigger OpportunityProductInsert on OpportunityLineItem (before insert) { // List of all line items IDs before being inserted List<Id> oliIds = new List<Id>(); // List of all opportunity IDs of the line items List<Id> oliOppIds = new List<Id>(); // List of all product IDs associated to the line items List<Id> oliProductIds = new List<Id>(); for ( OpportunityLineItem newOli : trigger.new ) { oliIds.add(newOli.Id); oliOppIds.add(newOli.OpportunityId); oliProductIds.add(newOli.Product2Id); } // Map to retrieve the account ID for each opportunity Map<Id, Id> oliAccountIdMap = new Map<Id, Id>(); List<Opportunity> opps = [SELECT Id, AccountId FROM Opportunity WHERE Id IN: oliOppIds]; for ( Opportunity opp : opps ) { oliAccountIdMap.put(opp.Id, opp.AccountId); } // List of all product IDs that are inventory items List<Id> inventoryProductIds = new List<Id>(); List<Product2> products = [SELECT Id FROM Product2 WHERE IsNonInventory__c = false AND Id IN: oliProductIds]; for ( Product2 product : products ) { inventoryProductIds.add(product.Id); } // Map to retrieve a list of available products for each account Map<Id, List<Id>> accProductMap = new Map<Id, List<Id>>(); List<Id> accProductIds; List<AccountProduct__c> accProducts = [SELECT Account__c, Product__c FROM AccountProduct__c WHERE Account__c IN: oliAccountIdMap.values()]; for ( AccountProduct__c accProduct : accProducts ) { accProductIds = new List<Id>(); if ( accProductMap.containsKey(accProduct.Account__c) ) { accProductIds = accProductMap.get(accProduct.Account__c); } accProductIds.add(accProduct.Product__c); accProductMap.put(accProduct.Account__c, accProductIds); } // Check that the product is available on the account for ( OpportunityLineItem checkOli : trigger.new ) { accProductIds = new List<Id>(); Id accId; // Retrieve the account ID from the line item ID if ( oliAccountIdMap.containsKey(checkOli.OpportunityId) ) { accId = oliAccountIdMap.get(checkOli.OpportunityId); } if ( accId != null ) { // If the product ID on the line item is in the list of inventory items if ( inventoryProductIds.contains(checkOli.Product2Id) ) { accProductIds = new List<Id>(); // Retrieve list of available products on the account if ( accProductMap.containsKey(accId) ) { accProductIds = accProductMap.get(accId); } // If the product ID is not in the list of account product IDs if ( !accProductIds.contains(checkOli.Product2Id) ) { checkOli.addError('This product isn\'t available for this account.'); } } } } }
- E.J.R
- September 04, 2018
- Like
- 0
- Continue reading or reply
Unable to locate dependant components of a managed package during uninstallation
Hi,
I'm looking for some general advice. I've been desperately trying to uninstall this package from production for a few days. I started with 50 component conflicts and have gotten the list down to just 2, which are listed next. In bold are the components relying on the package, however I have not been able to locate them and there's no direct link like there was for the other conflicts.
Component Type: Package
Name: ServiceMax
Problem:This extension depends on the package you are trying to uninstall. ExpressCustomConfig
Component Type: Package
Name: ServiceMax
Problem: This extension depends on the package you are trying to uninstall. Email Service Report
Steps taken so far:
- Searched entire bank of meta data within Eclipse for "ExpressCustomConfig", "Email Service Report", and possible variations.
- Followed advice here: https://help.salesforce.com/apex/HTViewSolution?id=000199298
- Followed advice here: https://help.salesforce.com/apex/HTViewHelpDoc?id=distribution_uninstalling_packages.htm
- Found this post with almost identical problem but no replies: https://developer.salesforce.com/forums/?id=906F0000000kBccIAE
- Checked every section of the setup, especially under "Build" looking for components associated to the package that could be removed
If you could point me in the right direction or if you have any advice at all it would be greatly appreciated!
Thanks for your time.
- E.J.R
- August 16, 2016
- Like
- 1
- Continue reading or reply