Blogs

  • Using Userinfo.getSessionId in LWC Throws Invalid Session Id

    PROBLEM After Summer ’17, Salesforce disabled it while using in Lightning Domain to enforce the security measures. Here is Salesforce known issue: https://issues.salesforce.com/issue/a028c00000qQ1F3AAK/summer17–generating-a-session-id-from-lightning-domain-provides-invalid-session-id Solution – Named Credential Use Named Credential to get the session id. Steps: Once you’ve logged in there, the refresh token is saved and used by the named credential. From there, you…

    Read more…

  • Enable Automatic Completion of Case Milestones.

    Develop an Apex trigger to automatically designate milestones as “Completed” for cases that meet specific distinctive conditions. Within the trigger, specify the events and relevant case criteria that must be met for a milestone to be marked as “Completed.” A similar trigger can be implemented to automatically complete milestones for work orders. TIP In Lightning Experience,…

    Read more…

  • Utilize the Safe Navigation Operator as a preventative measure against encountering Null Pointer Exceptions.

    Employ the safe navigation operator (?.) to replace the need for explicit, sequential null reference checks. This innovative operator can swiftly bypass operations on null values and, instead of triggering a NullPointerException, it returns null. Location: This modification pertains to both Lightning Experience and Salesforce Classic, and it is applicable in Enterprise, Performance, Unlimited, and…

    Read more…