• Big Ears
  • SMARTIE
  • 625 Points
  • Member since 2008

  • Chatter
    Feed
  • 14
    Best Answers
  • 10
    Likes Received
  • 1
    Likes Given
  • 119
    Questions
  • 214
    Replies
I took from trailhead the simple example of taking the accounts object and showing the related contacts in a form.

I used two custom objects in my org

We have Employees (SFDC_Employee__c) and we have Reviews (SFDC_SkillsDev_Review__c)

All I am trying to do is have a form that brings up the employee with their related reviews

However I am getting an error each time I try to  reference the Id of the reviews in line 27 which is related to lines 22 to 35

Code Below
<apex:page standardController="SFDC_Employee__c">
    <apex:form>
    
    <apex:pageBlock title="Edit Employee">
        <apex:pageMessages/>

        <apex:pageBlockSection>
            <apex:inputField value="{! SFDC_Employee__c.Name }"/>    
            <apex:pageBlockSection columns="1">
    <apex:inputField value="{! SFDC_Employee__c.Name }"/>
    <apex:inputField value="{! SFDC_Employee__c.Job_Function__c }"/>        
    <apex:inputField value="{! SFDC_Employee__c.Start_Date__c }"/>        
    <apex:inputField value="{! SFDC_Employee__c.Email_Address__c }"/>
</apex:pageBlockSection>
        </apex:pageBlockSection>

        <apex:pageBlockButtons>
            <apex:commandButton action="{! save }" value="Save" />        
        </apex:pageBlockButtons>

    </apex:pageBlock>
        
        <apex:pageBlock title="Reviews">
    <apex:pageBlockTable value="{!SFDC_Employee__c.Reviews__c}" var="review">
        <apex:column>
            <apex:outputLink
                value="{! URLFOR($Action.SFDC_SkillsDev_Review__c.Edit, review.Id) }">
                Edit
            </apex:outputLink>
            &nbsp;
          
        </apex:column>
        <apex:column value="{!review.Name}"/>
        <apex:column value="{!review.Period_Review__c}"/>
        <apex:column value="{!review.Review_Type__c}"/>
    </apex:pageBlockTable>
</apex:pageBlock>
    
    </apex:form>
</apex:page>User-added image
Hello,

I want to increment a Counter Variable that is incremented when products are added to a list. I've been failing at doing this. Either it throws a Null Pointer exception on the Visualforce page, or it doesn't show any incrementing in the OutPutPanel. Any assistance would be helpful.

Thanks.

Apex
public class StoreFront {

    public String message { get; set; }
    public Integer shopCart{get;set;}
    
   

    
    public PageReference shop(){
        shopCart = 0;
    message = 'You bought: ';
        for (DisplayMerchandise p:products){
            if(p.count > 0){
               message += p.merchandise.name + ' (' + p.count + ') ' ;
                shopCart++;
            }
        }
        return null;
    }
    
    DisplayMerchandise[] products;
  
        
   
    

    
    
        public class DisplayMerchandise {
        public Merchandise__c merchandise{get; set;}
        public Decimal count{get; set;}
        public DisplayMerchandise(Merchandise__c item){
            this.merchandise = item;
        }
       }
    
    public DisplayMerchandise[] getProducts() {
        
        if (products == null){
            products = new DisplayMerchandise[]{};
            for (Merchandise__c item : 
            [SELECT id, name, description__c, price__c
            FROM Merchandise__c
            WHERE Total_Inventory__c > 0]) {
            
            products.add(new DisplayMerchandise(item));
         	
            }
    
    }
        
    return products;
    }

}
VF
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" controller="StoreFront">
  <apex:stylesheet value="{!URLFOR($Resource.styles)}"/>
  <h1>Store Front</h1>
  
  <apex:form >
      <apex:dataTable value="{!products}" var="pitem" rowClasses="odd,even">
          
          <apex:column headerValue="Product">
              <apex:outputText value="{!pitem.merchandise.name}" />
          </apex:column>
          <apex:column headervalue="Price">
              <apex:outputText value="{!pitem.merchandise.Price__c}" />
          </apex:column>
          <apex:column headerValue="#Items">
              <apex:inputText value="{!pitem.count}"/>
          </apex:column>
   
      </apex:dataTable>
      
      <br/>
      <apex:commandButton action="{!shop}" value="buy" reRender="msg"/>
  </apex:form>
  
  <apex:outputPanel id="msg">{!message}</apex:outputPanel>    
 
    <apex:outputPanel id="cart">{!shopCart}</apex:outputPanel>
  
</apex:page>




 
Hey everyone,

I need to write a test class for a trigger that heavily involves the CreatedById and CreatedDate of a task. I can't input values for these fields in a test class, since they're not writeable.

How can I set the CreatedById and CreatedDate for the insertion of a task record in a test class?

Thanks!
-Greg
I have a field called Type on My Case which contains 3 Values ROE, Interfirm and Nasdaq, and I have a custom object in which I want to bring the type field into when I create a new record. My new field will be called Type as well in the related object called rejections.
 
What would the ISPICKVAL formula look like? I can not write formulas!! Help please...
The one thing that Eclipse IDE seemed to do really well that I've not yet worked out in VS Code is comparing metadata in different orgs.

Using VS Code, I know how to compare files which are in the same project, but it seems that different orgs always need to be different projects. Is there an easy way to do this? We have multiple sandboxes which occassionally get a little bit out of sync and a quick code compare really helps take the mystery out of where the differences have cropped up.

Thanks!
The new "lightning-record-form" Lightning Web Component is great, but it doesn't fully replicate layouts. For instance, layout sections aren't replicated. Is there any way to do this? Or plans for the sections to be supported in future?
We're working on a migration from Classic to LEX. However, it will be a long transition, so we need the ability to work in both for as long as possible. The documentation states/strongly implies that there should be an ability to leave an action override in place in Salesforce Classic, whilst removing it in Lightning/Mobile:

Remove Overrides for Standard Buttons and Tab Home Pages (https://help.salesforce.com/articleView?id=links_customize_override_remove.htm&type=5)

However, step 3 describes options which not available within our org:

"Select No override (default behavior) for the experience whose override you want to remove (Salesforce Classic, Lightning Experience, or mobile)."

User-added image
We've had a case open with Salesforce for a few weeks now and I can't seem to make any headway (they say the documentation team say that their documentation is correct, but also can't explain why I don't see the options that the documentation says should be there)
Being able to switch off the override in LEX would be ideal.

As we're in Lightning Console, using Lightning Components to override the override behaviour specifically for LEX still results in unwanted behaviours (tabs being opened unnecessarily, no access to inline editing, etc.) The only option remaining to us may be to have to re-build an object model specifically for LEX, which I'm sure isn't the desired approach when migrating to LEX

Is anybody able to confirm which is the expected behaviour and best practice for dealing with it?
I have an org with Lightning Experience switched on and I'm seeing inconsistent behaviours on action overrides:
  • It is a Lightning Console App
  • I have Edit overrides on one Standard Object (Task) and one Custom Object
  • In both cases, the override is as follows:
    • The Class override is a VF Page
    • The Lightning override states to "use the Classic override"
  • In both cases, the selected VF page has not been marked as available for Lightning Experience
When I try and edit a Task, I'm directed to the VF page in a new tab. However, when I try to edit the Custom object, the console opens a new tab and then opens an edit modal.

What are the expected behaviours if Lightning reverts to a classic override to a VF page which hasn't been marked as available for Lightning?

Also - When will it be possible to select "No override" in Lightning specifically?
I'm creating a new Lightning Record Page layout for the standard Contact SObject. As part of this, we'd like to include the detail page for a related child record (it has a one-to-one relationship with the current record). We can't use a standard "Related Record" lightning component, as those only apply to parent records. We could make the related record a parent record (in theory), but I'd like to explore our options if we kept it as a child record.

I have created a Lightning Web Component which uses a lightning-record-form to pull in the details of the child record which is related to the current record. This is handled using a pretty simple set-up:

Template
<template>
    <lightning-record-form 
         record-id={childRecord.data} 
         object-api-name="childRecord__c" 
         layout-type="Full" 
         columns="1" 
         mode="view"> </lightning-record-form>
</template>

Javascript
import { LightningElement, wire, api, track } from 'lwc';
import getChildRecord from '@salesforce/apex/Contact_getChildRecordController.getChildRecord'; 

export default class Contact_CRSProfileLayout extends LightningElement { 
    @api recordId; 
    @track childRecordId; 

    @wire(getChildRecord, {contactId : '$recordId'})
    childRecordId; 
}

Apex Class
This is just a simple class which accepts the ContactId and returns the appropriate child record ID - Just a single line SOQL, effectively.

This works just fine, if the child record is already in the system.

However, if there isn't yet a child record in the system, I want the form to be displayed with the lookup to the current contact already populated. What I need to be able to do is access the lookup field and populate it with the current context record Id.

With aura components, this was possible, but I'm not sure how it would be achieved now? Is the record created in memory by lightning-record-form accessible to the javascript controller? If so, how?
Hey all,

I'm working my way through the "Lightning Web Components Basics" trailhead and I've been directed to the following resource:

https://github.com/trailheadapps/ebikes-lwc#installing-e-bikes-using-salesforce-dx

As part of that, we need to create scratch orgs. However, the scratch orgs being created from my dev hub are marked as "Sandbox" and also seem to be stuck in Classic, so I can't progress.

I've updated to the latest versions of the SFDX CLI and plug-ins, so I'm not sure what the issue is here.
We need a conditional override in Lightning Experience which may return a custom component/VF page or will return the standard edit behaviour. We've been investigating various options which each seem to have their own blockers/issues:

1) Rely on the VF overrides which exist in classic This has numerous issues with navigation on multi-screen overrides (meaningful retURL attributes are not available to the VF page controller, so all button presses would need to be re-developed to handle LEX)
Lightning Component which uses e.force:editRecord event This event can't have "nooverride=1" applied to it, so forces the Browser into an infinite loop, as the edit behaviour gets caught in its own override.

Here is the component controller:
 
({ 
    onInit : function(component, event, helper) { 
         /*CAUSES INFINITE LOOP IN OVERRIDE CONTEXT*/ 
        var editRecordEvent = $A.get("e.force:editRecord"); 
        editRecordEvent.setParams({ "recordId": component.get("v.recordId") }); 
        editRecordEvent.fire(); 
    } 
})

2) Lightning Component which uses lightning:navigation component This can have nooverride=1 applied, but opens the Edit modal with blank context underneath it, rather than on top of the existing context. This means that the user flow is broken (hitting cancel leaves the user on a blank page, hitting save breaks the user flow completely - pictures below (POTENTIAL BUG?))

Component
<aura:component implements="lightning:actionOverride,force:hasRecordId" access="global" >
    <lightning:Navigation aura:Id="navService" />
    <aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
</aura:component>

Controller
({
    onInit : function(component, event, helper) {
        /*THIS OPENS THE MODAL IN A BLANK LIGHTNING EXPERIENCE PAGE, RATHER THAN IN THE CONTEXT OF THE CURRENT PAGE*/ 
        
        var nav = component.find("navService"); 
        var pageReference = { 
                                             "type": "standard__recordPage", 
                                             "attributes": {
                                                                  "recordId": component.get("v.recordId"), 
                                                                  "actionName": "edit"
                                                                }, 
                                             state: { 
                                                        nooverride: '1'
                                                        } 
                                          } 
        var URL = nav.navigate(pageReference); 
     }
})
This leaves the user with a modal over a blank page (the original page context is lost)
Hitting Edit opens a new page with a modal (which is not what the documentation states should happen)

If the user cancels, they are left with a blank page
Hitting Cancel leaves the user on a blank page

If the user hits save, they page is broken
Hitting Save breaks the page

3) Complete re-development of entire flow This has issues because lightning:recordform does not replicate the detail page layout, so we would need to manually build the edit page and keep it in-line with any page layout changes which we make in the administration interface. This is an unrealistic expectation.

Are we missing the best practice way of creating overrides which can conditionally return users to the "Standard" behaviour? This was possible in Classic but seems to be unavailable in Lightning (despite the documentation implying this should be possible.
Hey all,

We'd like to explore the possibility of a use case whereby the user can navigate to a record and the detail section of the page is in inline-edit mode automatically. We are using lightning:navigation in a lightning Action, but only seem to be able to edit in a modal, or navigate to the full-page view of the record.

I think being able to navigate to the full-page edit would be a better user experience, as the modal can feel cramped for users (or confusing, if you need to edit another record and then finish the user flow on that new record).

Has anybody else managed to meet this use case?

Andy
I’ve been experimenting with the new lightning:inputfield and it seems that the lookup fields don’t work in the mobile app or in Lightning Components which have been embedded in VF pages. Do people know if that is the case?
 
If so, does anybody know if there are plans to make them work in those environments? There not a danger that Salesforce is making migration pathways to Lightning Experience that much harder for larger organisations with complex/slow migration plans? It seems that the option is either to:
  • Develop functionality as both VF pages and Lightning Components so that the use case can work in either environment during the migration
  • Develop VF pages to embed in lightning experience (which has all sorts of issues with passing data out of the VF controllers to the pages they’re embedded in, etc.
It would be good to understand whether this is a thing we can wait for, or will need to consider as part of an eventual migration strategy.
I've been getting a few errors lately where user Id provided by the email is not one of our users. If I put the user ID into the URL, I get an "Insufficient Privileges" error. As I'm the admin, I'm assuming that this user actually relates to some sort of automated process. Is there any way of knowing who/what that Id is or identifying the process?

The issue itself that was causing this error can be fixed, so I'm not too worried about that. However, it would be good to know how to identify this mysterious user/process.

Thanks,
I have an inline Visualforce page in the Contact record which I'm viewing in Chrome. Sometimes the page loads and it recognises it is in Lightning and other times it doesn't. I have put the "$User.UITheme" and "$User.UIThemeDisplayed" variables into the page to see where it thinks it it:
VF page with UITheme merge fields

In both cases, the VF page thinks that it is in Salesforce Classic. Is there any chance this is a bug?
Hey all,

This is probably a stupid question, but just wanted confirmation - There is an upcoming change in Summer '17 relating to LockerService and I just wanted to confirm that it will only impact Lightning Components and not Visualforce pages. Whilst the item is within the LockerService section of the notes, the text doesn't explicitly call out the technology it will impact.

https://releasenotes.docs.salesforce.com/en-us/spring17/release-notes/rn_networks_head_markup.htm

With thanks,
Andy
All,

I'm trying to pass an instance of a wrapper class into a Component and I'm getting the following error:
Wrong type for attribute <c:ea1_outcomeaction action="com.sun.faces.application.MethodBindingMethodExpressionAdapter@e94c054f">. Expected EA1_OutcomeAction, found MethodBindingMethodExpressionAdapter
The type "EA1_OutcomeAction" is a wrapper class with some attributes and a few methods. However, I've managed to comment almost all of the class out (and all of the contents of the component, with the exception of the attribute) and I'm still getting this error. It seems like a pretty deep Java error. Has anybody else seen this before?

Andy
 
I have a scenario whereby one of our Sandboxes is used as a training environment. We frequently have to spend time setting up users so they can log into the sandbox (they can't reset their own passwords, because their email address in the sandbox isn't real) and this can take up a lot of time. One potential solution is to use SSO between the sandbox and production org. However, I have a couple of questions:
  • I'm guessing that the URLs would need to changed every time the sandbox is updated?
  • Has anybody used user provisioning in a scenario like this? How do you apply profiles/permission sets, etc? Or is it automatically copied over from production?
With thanks,
Andy
I'm attempting to use force:recordView and force:recordEdit. They've worked in the past, but in this case they are producing a really long error:

Code:
<aura:application extends="force:slds">
    <force:recordView aura:id="details" recordId="0034E00000Az9OV"/>
</aura:application>

Error:
Something has gone wrong. afterRender threw an error in 'layout://rl-Contact-VIEW-FULL-012700000009b4BAAQ---force_highlights-_1-0-554b47494d493539522f4366576866475665533843413d3d.c' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://force:pageBlock' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://force:pageBlockSectionView' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://force:pageBlockSectionRow' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://force:pageBlockItemView' [afterRender threw an error in 'markup://aura:if' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:if' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://ui:tooltip' [Assertion Failed!: No cmp wrapper has been set : null]]]]]]]]]]]]]]]]]]]]
Failing descriptor: {layout://rl-Contact-VIEW-FULL-012700000009b4BAAQ---force_highlights-_1-0-554b47494d493539522f4366576866475665533843413d3d.c}.
Please try again.

It looks like the error is in the afterRender, but I'd have no idea how to fix it. I've tried it with different records on different SObjects and with different browsers (Chrome and EDge) and am getting the same error. I'm on Winter '17 version.

Andy
Dear all,

We're looking at the various options of using Salesforce mobile (Salesforce1 application, SF1 Browser, Salesforce Classic in the browser) and are finding limitations with each:

Salesforce 1
  • Overriding the "View" action on an SObject appears to have no effect at all in SF1 and the standard page is displayed
  • The lack of ability to override the Edit action and then return to the normal edit page if the override logic requires it
What have people done to fix their existing overrides when they move to SF1?
 
Salesforce Classic in Mobile
  • If you direct to the full Salesforce classic site in mobile (i.e. switching off the "Enable the Salesforce1 mobile browser app" setting), the UIThemeDisplayed variable still seems to think that the user is in SF1
Lightning Experience
  • With Lightning Experience switched on and "Enable the Salesforce1 mobile browser app" switched off, the user cannot log-in on mobile
  • With Lightning Experience switched on and "Enable the Salesforce1 mobile browser app" switched on, the user is directed to SF1, despite Lightning Experience being responsive to different screen sizes, etc.
Does anybody have any advice, answers or workarounds to these questions? It makes mobile development very difficult when the navigation behaviours/capabilities in the desktop and mobile version differ so wildly.

With thanks,
Andy
Dear all,

The Lightning Component reference contains a component called "force:recordEdit" which allows the developer to put en edit page for a record in place. However, it is unstyled and ugly. Is there best practice guidance on how/whether it is supposed to be wrapped in particular divs/classes, etc?

If I inspect the individual input fields / labels / markup etc. that gets rendered, I can see that a lot of the usual CSS classes are included, but don't seem to be having an effect on how the field is rendered.

A field in force:recordEdit looks like this:
User-added image

I'd like it to look like this:
User-added image

I've tried wrapping it in the SLDS class, but the classes in the force:recordEdit component don't seem to exist in SLDS, so that can't be the right source.

Any help appreciated.
Andy
 
All,

I've been working through the "Lightning Components Basics" Trailhead module and found it to be, in the main, really helpful. However, there are a few points in the examples where methods/techniques are used which aren't clarified and I can't find in the documentation either. I'm trying to work out if these are specific to the Lightning implementation of Javascript, standard Javascript methods or something else that I should read for additional understanding:
  • When setting up asyncronous callback responses, there are 2 methods that I can't find in the Lightning documentation or with a Google search, so what are they native to?
    • getReturnValue()
    • getState()
  • When setting up a variable to run an apex method, there are methods which I have a similar issue with:
    • setParams()
  • ​In another module, 2 methods in the Helper class for a component call another method within the same Helper class with the "this." nomenclature. Given that these methods are all held in a map, is this a standard Javascript technique or something else?
If I've just missed stuff in the documentation, sorry! Feel free to tell me to RTM or link me to the appropriate resources.

Thanks!
 
As of Spring '16, we can now retrieve the distance, as well as sort/filter by it:

https://releasenotes.docs.salesforce.com/en-us/spring16/release-notes/rn_api_soql.htm

However, the documentation doesn't seem to indicate how we are supposed to access and retrieve this value from the returned results. It just seems to not be included along with the other columns.

Has anybody else used this functionality? It would be very useful to get my head around it.

Andy
Hey all,

Is there a way to reliably return a list of all Users with a particular level of access to a particular record?
  • UserRecordAccess looked useful, but the use case seems to be about returning a number of records that pertain to a single user's access
  • CustomObject__Share could work, but then this can contain groups (which can be nested) so that can result in multiple queries

Is there a recommended approach?

With thanks, Andy.

We need a conditional override in Lightning Experience which may return a custom component/VF page or will return the standard edit behaviour. We've been investigating various options which each seem to have their own blockers/issues:

1) Rely on the VF overrides which exist in classic This has numerous issues with navigation on multi-screen overrides (meaningful retURL attributes are not available to the VF page controller, so all button presses would need to be re-developed to handle LEX)
Lightning Component which uses e.force:editRecord event This event can't have "nooverride=1" applied to it, so forces the Browser into an infinite loop, as the edit behaviour gets caught in its own override.

Here is the component controller:
 
({ 
    onInit : function(component, event, helper) { 
         /*CAUSES INFINITE LOOP IN OVERRIDE CONTEXT*/ 
        var editRecordEvent = $A.get("e.force:editRecord"); 
        editRecordEvent.setParams({ "recordId": component.get("v.recordId") }); 
        editRecordEvent.fire(); 
    } 
})

2) Lightning Component which uses lightning:navigation component This can have nooverride=1 applied, but opens the Edit modal with blank context underneath it, rather than on top of the existing context. This means that the user flow is broken (hitting cancel leaves the user on a blank page, hitting save breaks the user flow completely - pictures below (POTENTIAL BUG?))

Component
<aura:component implements="lightning:actionOverride,force:hasRecordId" access="global" >
    <lightning:Navigation aura:Id="navService" />
    <aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
</aura:component>

Controller
({
    onInit : function(component, event, helper) {
        /*THIS OPENS THE MODAL IN A BLANK LIGHTNING EXPERIENCE PAGE, RATHER THAN IN THE CONTEXT OF THE CURRENT PAGE*/ 
        
        var nav = component.find("navService"); 
        var pageReference = { 
                                             "type": "standard__recordPage", 
                                             "attributes": {
                                                                  "recordId": component.get("v.recordId"), 
                                                                  "actionName": "edit"
                                                                }, 
                                             state: { 
                                                        nooverride: '1'
                                                        } 
                                          } 
        var URL = nav.navigate(pageReference); 
     }
})
This leaves the user with a modal over a blank page (the original page context is lost)
Hitting Edit opens a new page with a modal (which is not what the documentation states should happen)

If the user cancels, they are left with a blank page
Hitting Cancel leaves the user on a blank page

If the user hits save, they page is broken
Hitting Save breaks the page

3) Complete re-development of entire flow This has issues because lightning:recordform does not replicate the detail page layout, so we would need to manually build the edit page and keep it in-line with any page layout changes which we make in the administration interface. This is an unrealistic expectation.

Are we missing the best practice way of creating overrides which can conditionally return users to the "Standard" behaviour? This was possible in Classic but seems to be unavailable in Lightning (despite the documentation implying this should be possible.
I've been getting a few errors lately where user Id provided by the email is not one of our users. If I put the user ID into the URL, I get an "Insufficient Privileges" error. As I'm the admin, I'm assuming that this user actually relates to some sort of automated process. Is there any way of knowing who/what that Id is or identifying the process?

The issue itself that was causing this error can be fixed, so I'm not too worried about that. However, it would be good to know how to identify this mysterious user/process.

Thanks,
Dear all,

We're looking at the various options of using Salesforce mobile (Salesforce1 application, SF1 Browser, Salesforce Classic in the browser) and are finding limitations with each:

Salesforce 1
  • Overriding the "View" action on an SObject appears to have no effect at all in SF1 and the standard page is displayed
  • The lack of ability to override the Edit action and then return to the normal edit page if the override logic requires it
What have people done to fix their existing overrides when they move to SF1?
 
Salesforce Classic in Mobile
  • If you direct to the full Salesforce classic site in mobile (i.e. switching off the "Enable the Salesforce1 mobile browser app" setting), the UIThemeDisplayed variable still seems to think that the user is in SF1
Lightning Experience
  • With Lightning Experience switched on and "Enable the Salesforce1 mobile browser app" switched off, the user cannot log-in on mobile
  • With Lightning Experience switched on and "Enable the Salesforce1 mobile browser app" switched on, the user is directed to SF1, despite Lightning Experience being responsive to different screen sizes, etc.
Does anybody have any advice, answers or workarounds to these questions? It makes mobile development very difficult when the navigation behaviours/capabilities in the desktop and mobile version differ so wildly.

With thanks,
Andy
Hey all,

Is there a way to reliably return a list of all Users with a particular level of access to a particular record?
  • UserRecordAccess looked useful, but the use case seems to be about returning a number of records that pertain to a single user's access
  • CustomObject__Share could work, but then this can contain groups (which can be nested) so that can result in multiple queries

Is there a recommended approach?

With thanks, Andy.

I have a collection in a visualworkflow that is failing on the first decision element within the flow. I'm getting the following error:

FLOW_ELEMENT_ERROR|The flow failed to access the value for Item.Product_Family_Getter__c because it hasn't been set or assigned.

However, I am definitely setting the field and can see that the flow has it at an earlier point in the debug log:

Building the collection of Opportunity Line Items:
17:27:27.411 (411151510)|FLOW_VALUE_ASSIGNMENT|9831cff0c4b4f94bdd20336c790e146f2a7e2ab-19d3|getDealItems|true
17:27:27.411 (411228209)|FLOW_VALUE_ASSIGNMENT|9831cff0c4b4f94bdd20336c790e146f2a7e2ab-19d3|OpportunityLineItems|[{Name=Crest-ONE Comm- White Teeth ONE Connect, CurrencyIsoCode=USD, Id=00kg0000004G4MeAAK, License__c=Subscription, Product_Family_Getter__c=ONE Connect}]
17:27:27.411 (411251830)|FLOW_BULK_ELEMENT_DETAIL|FlowRecordLookup|getDealItems|1
Iterating through the collection
It can be seen that the Item definitely has the field "Product_Family_Getter__c" assigned
17:27:27.411 (411944263)|FLOW_ELEMENT_BEGIN|9831cff0c4b4f94bdd20336c790e146f2a7e2ab-19d3|FlowLoop|Loop_through_Line_Items
17:27:27.412 (412846666)|FLOW_VALUE_ASSIGNMENT|9831cff0c4b4f94bdd20336c790e146f2a7e2ab-19d3|Item|{Name=Crest-ONE Comm- White Teeth ONE Connect, CurrencyIsoCode=USD, Id=00kg0000004G4MeAAK, License__c=Subscription, Product_Family_Getter__c=ONE Connect}
17:27:27.412 (412858987)|FLOW_VALUE_ASSIGNMENT|9831cff0c4b4f94bdd20336c790e146f2a7e2ab-19d3|Loop_through_Line_Items.currentIteration|0

However, I still get this error:
17:27:27.413 (413041600)|FLOW_ELEMENT_BEGIN|9831cff0c4b4f94bdd20336c790e146f2a7e2ab-19d3|FlowDecision|Is_this_a_NOW_Item
17:27:27.414 (414510540)|FLOW_ELEMENT_END|9831cff0c4b4f94bdd20336c790e146f2a7e2ab-19d3|FlowDecision|Is_this_a_NOW_Item
17:27:27.421 (421733197)|FLOW_ELEMENT_ERROR|The flow failed to access the value for Item.Product_Family_Getter__c because it hasn't been set or assigned.||

What else should I be doing? I attach a quick picture of the section of the flow that's failing:
User-added image



I know that sandboxes are now generated with "System Email Only" setting for Email Deliverability. However, this immediately breaks a whole bunch of unit tests.

Has anybody found a workaround for this, other than just changing "Email Deliverability" straight back to "All"? Seems like a bit of an oversight by Salesforce here not to excempt test code from those settings.
Hey all,

I'm making some changes to my case feed page, so that the Custom Actions can appear in the Publisher. My custom actions are Visualforce pages that used to accept some values and update the record feed and refresh the page. I followed the documentation and used the interaction Javascript library function:
<apex:actionFunction name="emailSent" oncomplete="sforce.interaction.entityFeed.refreshObject('{!feedCase.id}','true','true','true')"/>
This javascript function refreshes the fields, related lists and feeds all in one go. However, it doesn't appear to work when the Custom Action is being invoked from the Publisher. Simply, nothing happens.

I have found this Javascript function from the Canvas Javascript library which seems to work, but doesn't do what I want it to:
<apex:actionFunction name="emailSent" oncomplete="Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed:true}});"/>
This function refreshes the feed, but not the fields or related lists. As a result, the highlights panel at the top of the page doesn't update, either, which my users look to as an indicator that the record has been updated. They shouldn't have to force a refresh of the page to check.

I can't find anything in the documentation that lists the elements I can put into the payload, so I'm not sure what the situation is:
  • The Initial Code sample should have continued to work in the Custom Action Publisher, keep debugging to find out why it didn't.
  • The Initial Code sample doesn't work in the Custom Action Publisher. However, the new code sample can be used to refresh more than the feed.
  • The initial Code sample doesn't work in the Custom Action Publish and the new code sample can only refresh the feed. Find another way to refresh the fields and related lists
Does anybody know?

Dear all,

I have an inline visualforce page on a record with a command button. The command button takes some actions on the controller and then refreshes the record. This page was originally created by another developer and we've since moved to using the Service Console (but not for all users).

The command button took some action on the controller side to update the record and then conditionally rendered an output panel at the top of the page which prompted a refresh of the whole record. If the user is in the service console, this doesn't work correctly and the user is exited from the service console.

I'd like the command button to refresh the record when the user is in the service console, but I'm falling at the first hurdle. The IsInConsole() function from the console integration toolkit seems to think that the record isn't being displayed within the console when the commandButton is clicked:
<apex:page standardController="XXXX" extensions="XXXX">
    <apex:includeScript value="/support/console/30.0/integration.js"/>
	<apex:outputPanel rendered="{!refreshPage}">
      <script type="text/javascript">
        
         if (sforce.console.isInConsole()) {
            alert("in console");
            **SOME JAVASCRIPT TO REFRESH THE TAB**
        } else {
            alert("not in console");
            window.top.location = '/{!Tenancy__c.id}';
        }
      </script>
    </apex:outputPanel>
    <apex:form id="featuresForm">
       <apex:pageBlock >
        <script>
        	if (sforce.console.isInConsole()) {
        		alert("in console");
        	} else {
        		alert("not in console");
        	}
        </script>
        <apex:pageMessages />
        <apex:pageBlockButtons >
            <!--<apex:commandButton value="Save" action="{!save}" rendered="{!Tenancy__c.LockFeatures__c}"/>-->
        </apex:pageBlockButtons>
        ***MORE VF PAGE HERE***

I've put in place some "debugging" javascript which confirms that ehen the page first loads, the alert pops up with the "In Console" message. So I know the toolkit is working and properly invoked when the record is first loaded up. However, when the "CommandButton" is clicked and the inline VF page refreshes, the alert that pops up, then says "not in console". 

Has anybody seen this before and know why the toolkit may not recognise the console?

Alternatively - Feel free to suggest ways to re-engineer the page so that the refresh will work in both the console and non-console view. We do need the refresh, so that new information is displayed to the user, otherwise I could just get away with an inline refresh of the VF page.

With thanks,
Is anybody aware of the rules behind field sets, with regards to which fields can be set as required and which cannot? I've created some field sets that get referenced by a dropdown in a visualforce page. That way, users can quickly switch between different groupings of fields.

However, the admin interface won't let me set some of the fields to  "required" within the field set. These aren't all the same type of field (some are drop-downs, others are not) and in some cases, the same field in different fields sets can be set to "Required" in one and not the other.

Does anybody have any idea what could cause this?
The new "lightning-record-form" Lightning Web Component is great, but it doesn't fully replicate layouts. For instance, layout sections aren't replicated. Is there any way to do this? Or plans for the sections to be supported in future?
We're working on a migration from Classic to LEX. However, it will be a long transition, so we need the ability to work in both for as long as possible. The documentation states/strongly implies that there should be an ability to leave an action override in place in Salesforce Classic, whilst removing it in Lightning/Mobile:

Remove Overrides for Standard Buttons and Tab Home Pages (https://help.salesforce.com/articleView?id=links_customize_override_remove.htm&type=5)

However, step 3 describes options which not available within our org:

"Select No override (default behavior) for the experience whose override you want to remove (Salesforce Classic, Lightning Experience, or mobile)."

User-added image
We've had a case open with Salesforce for a few weeks now and I can't seem to make any headway (they say the documentation team say that their documentation is correct, but also can't explain why I don't see the options that the documentation says should be there)
Being able to switch off the override in LEX would be ideal.

As we're in Lightning Console, using Lightning Components to override the override behaviour specifically for LEX still results in unwanted behaviours (tabs being opened unnecessarily, no access to inline editing, etc.) The only option remaining to us may be to have to re-build an object model specifically for LEX, which I'm sure isn't the desired approach when migrating to LEX

Is anybody able to confirm which is the expected behaviour and best practice for dealing with it?
Hey all,

We'd like to explore the possibility of a use case whereby the user can navigate to a record and the detail section of the page is in inline-edit mode automatically. We are using lightning:navigation in a lightning Action, but only seem to be able to edit in a modal, or navigate to the full-page view of the record.

I think being able to navigate to the full-page edit would be a better user experience, as the modal can feel cramped for users (or confusing, if you need to edit another record and then finish the user flow on that new record).

Has anybody else managed to meet this use case?

Andy

When the new Critical Update is activated in our Sandbox organization, we get the following error on every non-managed visualforce page:

<DomainName>--c.visualforce.com's server IP address could not be found.

We left it overnight in case it was an issue with the DNS not being updated, but that doesn't seem to be the case. Deactivating the update restores all functionality. Does something else need to be updated in order to get our non-managed pages working?

Thank you.

I’ve been experimenting with the new lightning:inputfield and it seems that the lookup fields don’t work in the mobile app or in Lightning Components which have been embedded in VF pages. Do people know if that is the case?
 
If so, does anybody know if there are plans to make them work in those environments? There not a danger that Salesforce is making migration pathways to Lightning Experience that much harder for larger organisations with complex/slow migration plans? It seems that the option is either to:
  • Develop functionality as both VF pages and Lightning Components so that the use case can work in either environment during the migration
  • Develop VF pages to embed in lightning experience (which has all sorts of issues with passing data out of the VF controllers to the pages they’re embedded in, etc.
It would be good to understand whether this is a thing we can wait for, or will need to consider as part of an eventual migration strategy.
There is a new critical update called Remove Instance Names From URLs for Visualforce, Community Builder, Site.com Studio, and Content Files.

DANGER! DANGER! DO NOT ACTIVATE!

This changes links for visualforce pages.  <domain name>.visualforce.com replaces <domain name>.<instancename>.visual.force.com.

For whatever reason, this does not work with Visualforce tabs or with buttons that link to visualforce pages.

With the critical update deactivated, the link for visualforce tab is https://<domain name>.<instancename>.visual.force.com/apex/TimeEntryCalendar?sfdc.tabName=01r500000003bNn.

When the critical update is activated, the link for the visualforce tab is https://<domain name>.visualforce.com/apex/TimeEntryCalendar?sfdc.tabName=01r500000003bNn.

The problem is that clicking the "activated" link yields this:
 
This site can’t be reached
<domain name>.visualforce.com’s server IP address could not be found.

In my case, it was a really big problem because the visualforce tab was the default home page. So activating the Critical Update essentially locked all of my users out of salesforce.com. 

This also fails with a simple button link to a visual force page.

If you assign a url to a button or type the link in - /apex/TimeEntryCalendar for instance, it works fine when the update is deactivated.

But activate the update, and it fails on just the simple link.

Problem exists in both Classic and Lightning.

MAJOR SNAFU!
I have an inline Visualforce page in the Contact record which I'm viewing in Chrome. Sometimes the page loads and it recognises it is in Lightning and other times it doesn't. I have put the "$User.UITheme" and "$User.UIThemeDisplayed" variables into the page to see where it thinks it it:
VF page with UITheme merge fields

In both cases, the VF page thinks that it is in Salesforce Classic. Is there any chance this is a bug?
select id,OwnerId,Territory_ID__c, Patient__c.Territory_ID__r.Current_TM1_Assignee__c from Patient__c where OwnerId !=Null AND Patient__c.Territory_ID__r.Current_TM1_Assignee__c !=Null AND Patient__c.Territory_ID__r.Current_TM1_Assignee__c =: OwnerId


it is saying "unknow error parsing query"
All,

I'm trying to pass an instance of a wrapper class into a Component and I'm getting the following error:
Wrong type for attribute <c:ea1_outcomeaction action="com.sun.faces.application.MethodBindingMethodExpressionAdapter@e94c054f">. Expected EA1_OutcomeAction, found MethodBindingMethodExpressionAdapter
The type "EA1_OutcomeAction" is a wrapper class with some attributes and a few methods. However, I've managed to comment almost all of the class out (and all of the contents of the component, with the exception of the attribute) and I'm still getting this error. It seems like a pretty deep Java error. Has anybody else seen this before?

Andy
 
I'm attempting to use force:recordView and force:recordEdit. They've worked in the past, but in this case they are producing a really long error:

Code:
<aura:application extends="force:slds">
    <force:recordView aura:id="details" recordId="0034E00000Az9OV"/>
</aura:application>

Error:
Something has gone wrong. afterRender threw an error in 'layout://rl-Contact-VIEW-FULL-012700000009b4BAAQ---force_highlights-_1-0-554b47494d493539522f4366576866475665533843413d3d.c' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://force:pageBlock' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://force:pageBlockSectionView' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://force:pageBlockSectionRow' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://force:pageBlockItemView' [afterRender threw an error in 'markup://aura:if' [afterRender threw an error in 'markup://aura:expression' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://aura:if' [afterRender threw an error in 'markup://aura:html' [afterRender threw an error in 'markup://ui:tooltip' [Assertion Failed!: No cmp wrapper has been set : null]]]]]]]]]]]]]]]]]]]]
Failing descriptor: {layout://rl-Contact-VIEW-FULL-012700000009b4BAAQ---force_highlights-_1-0-554b47494d493539522f4366576866475665533843413d3d.c}.
Please try again.

It looks like the error is in the afterRender, but I'd have no idea how to fix it. I've tried it with different records on different SObjects and with different browsers (Chrome and EDge) and am getting the same error. I'm on Winter '17 version.

Andy
My Lightning component stopped work after Summer '16 update and LockerService activation
The reason is sObject attribute and its fields not accessible as before.

Here is my attribute and inputReachText component with binded field of Idea:
<aura:attribute name="newIdea" type="Idea" default="{'sObjectType':'Idea', 'Body':''}" />

<ui:inputRichText aura:id="ideaBodyText" value="{!v.newIdea.Body}" label="Description" />
And here is controller code after change the body field and click save:
console.log(cmp.get('v.newIdea')); //= {sObjectType:'Idea', Body:''} - Body is empty
console.log(cmp.get('v.newIdea.Body')); //= TEST BODY
And when trying to send the object to Apex controller method it says 'Unable to read SObject'.
Did anybody face with something similar?
 
Hey all,

Just wanted to submit this here, to see if others have experience it to. If I'm running an Apex test and the code hits site.validatePassword, I get the following error:
System.UnexpectedException: Salesforce System Error: 2089153553-377506 (-1123129540) (-1123129540)
I've got a work-around in place, but wanted to see if anybody else is dealing with it. It would be good to get it fixed, as the workaround is costing me code coverage

Andy
 
Approval.ProcessResult is supposed to have fields which identify which record is being processed (getEntityId()). However, this seems to be null for the records for which the approval process fails. Is this the expected behaviour?

Sample Code:
           Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
           req.setComments('Approval Comments');
           req.setObjectId(<Record ID>);
           LApproval.ProcessResult result = Approval.process(req, false);
           System.debug(result);

So how can we identify those records for which the approval process fails?
Hey everyone,

I need to write a test class for a trigger that heavily involves the CreatedById and CreatedDate of a task. I can't input values for these fields in a test class, since they're not writeable.

How can I set the CreatedById and CreatedDate for the insertion of a task record in a test class?

Thanks!
-Greg
Hey all,

In our org, we have a few managed packages with inline VF pages on record pages. We've also created one inline VF page ourselves. I'm finding that, occasionally, when opening a new record, the inline visualforce page will open in a new tab, instead.

I've confirmed with the package providers that this shouldn't be happening (there's nothing in the pages that would be causing a tab to open). My users haven't complained to me that they've been seeing this, so it might be my local machine (I kind of hope it is), but has anybody else experienced this and do they know what caused it?

Thanks!
Andy




I was wondering if anybody has found this issue?

 

I'm finding that, unless each individual Opportunity Product is edited and re-saved, they show up in reports on two seperate lines, one row for the Schedule Amount (with Schedule Quantity zeroed) and vice versa.

 

This is causing a headache for the finance team, who're using reports from Salesforce.

 

Andy

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.