+ Start a Discussion
Leonard Silon 16Leonard Silon 16 

How can I Convert a java script code to something else to work in Lightning?

We have a static resource built in java script. It is called by a visualforce page that is also java script. Picture of visualforce code below. The code works like this - - We open up the console in service cloud. We open a main tab - say account. When we first open a subtavb, it auto opens another subtab anmed Unified Desktop. In lightning it does not work

User-added image
Raj VakatiRaj Vakati
You need to use lightning quick actions ... 

Refer this link 

https://developer.salesforce.com/blogs/2018/06/convert-javascript-buttons-to-lightning-friendly-alternatives-with-the-lightning-experience-configuration-converter.html
Leonard Silon 16Leonard Silon 16
I wish that would work. However, this code runs when the account is loaded into the console automatically. So there is no quick action to happen before load is there? Thanks, Leonard Silon Senior Salesforce Administrator Canon Financial Services, Inc. 158 Gaither Drive, Suite 200, Mount Laurel, NJ 08054 www.cfs.canon.com lsilon@cfs.canon.com T 856-206-1848 C Please consider the environment before printing this email
Raj VakatiRaj Vakati
hmmm .. make sense .. 

i have an option for you .. would you like to try 
  1. create a lightning component with the no content 
  2. and call the javascipt logic on doinit of the component 
  3. include this component into the layout 

 
Leonard Silon 16Leonard Silon 16
I am not a developer. I was really wondering if this could be done and has anyone done it. Sounds like you are saying to try things to see if they work instead of saying, you have tried it and this does work Thanks, Leonard Silon Senior Salesforce Administrator Canon Financial Services, Inc. 158 Gaither Drive, Suite 200, Mount Laurel, NJ 08054 www.cfs.canon.com lsilon@cfs.canon.com T 856-206-1848 C Please consider the environment before printing this email