We’re rewarding the question askers & reputations are being recalculated! Read more.
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 ...


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

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 ...


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 ...


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/...


Only top voted, non community-wiki answers of a minimum length are eligible