• IT Support Eness
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies
Hi Folks,

I am building a LWC to load external JS script file in LWC. However whenever loadScript function is executing it is failing to load and there is not error received.

LWC
import { LightningElement, track  } from 'lwc';
import { loadScript } from 'lightning/platformResourceLoader';
import BrandfolderJS from '@salesforce/resourceUrl/BrandfolderJS';

export default class brandFolderLink extends LightningElement {
	
    @track blnBrandfolderJSInitialized = false;
    
    renderedCallback() {

        if (this.blnBrandfolderJSInitialized) {
            return;
        }
        this.blnBrandfolderJSInitialized = true;

        loadScript(this, BrandfolderJS)
        .then(() => {
            alert('success.......');
        })
        .catch(error => {
            alert('failed.....'+error);
        });
    }
	
}

JS file from Static Resource - Brandfolder JS (https://cdn.brandfolder.com/bf.min.js)
I have created JS file as static resource (BrandfolderJS) and using it in LWC.

LWC is added to App Builder Page/Home Page and trying to load, however it is going to catch block in loadScript method without any error. Error variable is undefined.

Can you please help?

Thank you,
Jigar Lakhani

Self signed certificate is about to expire and my org is enabled with sso, on the other end microsoft azure is integrated with salesforce. How to renew self signed certificate. After renewal do i have to update this certificate in microsoft active directory?
I am trying to add a custom LWC to a phone record page however getting the below error message. Could anyone help me out how to make the component mobile viewable.

User-added image
I've come across a weird issue in Salesforce where merge fields on a VF email template are not being resolved correctly when it is sent by "System". I've tried both a Workflow Email Alert on create and regular assignment alert (Support Settings > Case Assigned Template). Both fail to correctly resolve all fields when it is ran by System (i.e. when System handles an email-to-case event).

The exact same template manage to resolve all fields properly when I create a case (i.e. CreatedBy != System), and update the existing case's assignment (the one created by System). In both cases, the email merged correctly whether it was sent via Workflow, and manual case re-assignment, and template preview and all fields were merged correctly. 

It seems that when the Standard Controller used for email templates when executing under the System user, it is only able to pull certain fields. 

Testing template for reference:
<messaging:emailTemplate subject="{!'A Ticket has been assigned to you: '+relatedTo.Subject+ '('+relatedTo.CaseNumber+')')}" recipientType="User" relatedToType="Case">
<messaging:htmlEmailBody >
        <p>Hello {!relatedTo.Owner.Name},</p>
        <p>A support ticket has been assigned to you: </p>
        <p>
        Company: {!relatedTo.Account.Name} <br />
        Contact Name: {!relatedTo.Contact.Name} <br />
        Contact Email: {!relatedTo.Contact.Email} <br />
        <br />
        Case #: {!relatedTo.CaseNumber} <br />
        Case ref: {!relatedTo.Case_Reference__c} <br />
        Priority: {!relatedTo.Priority} <br />
        Subject: {!relatedTo.Subject} <br />
        Description: {!relatedTo.Description} 
        </p>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

Case Number, Owner, Case Id are the only merge fields that are resolved when running as System. 

Although redundant, I've also verified that System does indeed have access to these fields via an Apex Test using runAs:
 
User systemUser = [select id from user where name = 'System' limit 1];
		System.runAs(systemUser)
		{
			for(String field : Schema.SObjectType.Case.fields.getMap().keySet())
			{
				Map<String, SObjectField> fieldMap = Schema.SObjectType.Case.fields.getMap();
				System.debug(LoggingLevel.DEBUG, field + ' is Accessible by System: ' + fieldMap.get(field).getDescribe().isAccessible());
			}
		}

The debug logs show the correct values being accessible by System. 

Does any one know why the fields aren't resolved when System is the one sending the emails?
  • August 29, 2019
  • Like
  • 0
I found this link https://developer.salesforce.com/blogs/engineering/2014/04/building-content-rich-visualforce-pages-with-salesforce-crm-content.html to download multiple files as .zip from ContentVersion.

Can we use /sfc/servlet.shepherd/version/download/ to download multiple files?
Since this is not documented in any of the salesforce docs.

Question on email

Is there a way to prepopulate following on email when send email button is clicked (on emails related list) from Case screen.

 

1) Input Ref ID
2) Copy Case Team

 

Thanks

I need the complete URL of my VF page in controller class (apex class). I have tried the the following solution but to of no use:

 

string x = ApexPages.currentPage();
srting y = ApexPages.currentPage().getURL();

 

Neither of the above methods are giving me the exact URL (e.g., https://c.cs2.visual.force.com/apex/MasterDetail?contractID=2009050010&bu=Media) of the current page that I need to send in an autogenerated email.

 

Regards,
Rao