We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

0

You can call out to the metadata REST API to get the list of layouts for an object, that'll return them alongside their record type IDs and will indicate which is the default for the current user. I've not found a way to do the same using the User Interface API (though stand to be corrected), so think this is what you'll have to do. There seems to be many ...


1

I believe the WHERE clause is not being fulfilled in the controller query: List<Unit__c> unitList = [select Id, Name, Owner_Account__c From Unit__c where (Owner_Account__c = :user.AccountId)]; How is Owner_Account__c set on the unit? When you insert them using: Unit__c u = TestData.getUnit(); Insert u; If it depends on the community user ...


0

In addition to the sfdcfox answer, this simple example shows how static variables are not part of the viewstate, even if you are doing Ajax refreshes But first, a word from the doc on static variables: They aren’t transmitted as part of the view state for a Visualforce page. Here's a controller with a static counter and an instance variable (viewstate) ...


2

The main difference between the two (static versus transient) is that static variables exist only once per transaction, but transient variables can exist many times. In other words, static variables have a global scope, while transient variables have a local scope. In many examples you've likely seen, you've probably only seen these variables used at the top ...


1

The problem you're having here is you cannot send different attachments to individual recipients of the same (common) bulk email. Either they all receive the same email with the same attachment or they do not. To do what you want to do, you'd need to have a marketing tool from Marketing Cloud like Journey Builder. You're attempting to send the equivalent of ...


2

Use the Transient keyword to declare instance variables that can't be saved and shouldn't be transmitted as part of the view state for a visualforce page. These variables will not persist across multiple transactions or when a visualforce page is refreshed. The latter is one very important thing to remember about them since they aren't contained in the view ...


2

A more typical Visualforce pattern is to iterate not over Opportunities, but over some wrapper object, an Apex class that encapsulates an Opportunity alongside those data points you wish to add to the native sObject fields. For example, public class MyWrapper { Opportunity o { get; set; } Integer checksum { get; set; } } Your Visualforce code then ...


1

Yes. Salesforce does provide a mechanism in Apex to check the FLS for field for the current running user: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_perms_enforcing.htm There is also the FieldPermission SObject as well you can query against: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/...


0

You can use this code & pass action status id into your commanLink status : <apex:actionStatus id="myAjaxStatus" > <apex:facet name="start" > <div style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.25; z-index: 1000; background-color: black;"> &nbsp; </div> ...


Top 50 recent answers are included