• Divesh Jaitley
  • NEWBIE
  • 0 Points
  • Member since 2017
  • Genius Combine Ltd.


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 0
    Questions
  • 4
    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

During Module training,
  1. I cannot create the "Property" field because it is already created.  Can and how can I erase so that I can follow the instructions.
  2. There is a step that tells me to "Check the box for Launch New Custom Tab Wizard after saving this custom object.".   However, the checkbox does not exist and I cannot find that string.
  • July 07, 2017
  • Like
  • 1
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

I am currently trying to complete the Workflow Rule Migration module, but I seem to be missing from custom fields on the Account object (Top Account) and Case object (Target Resolution Date). I tried to do a search in Trailhead to find another module or unit that creates these custom fields but couldn't find anything. Any thoughts?
During Module training,
  1. I cannot create the "Property" field because it is already created.  Can and how can I erase so that I can follow the instructions.
  2. There is a step that tells me to "Check the box for Launch New Custom Tab Wizard after saving this custom object.".   However, the checkbox does not exist and I cannot find that string.
  • July 07, 2017
  • Like
  • 1