• Carlos Cicero
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
I am doing a POC with lightning:omniToolkitAPI 

I created and aura component to set in the background of the lightning service console. When the user changed the status I am calling the method getAgentWorks of the API but it is not calling at all and the API object is getting empty {} when printed the log  console.log( JSON.stringify(omniAPI));

component
<aura:component implements="lightning:backgroundUtilityItem" access="global"  >
    <lightning:omniToolkitAPI aura:id="omniToolkit" />
     <lightning:utilityBarAPI aura:id="utilitybar" />
    <aura:handler event="lightning:omniChannelStatusChanged" action="{! c.onStatusChanged }"/>
</aura:component>

controller
({
    onStatusChanged: function(cmp, evt, hlp) {
        console.log("Status changed.");
       hlp.getAgentWork(cmp, evt,hlp);
    }        
})
Helper
({
    getAgentWork: function(cmp, evt,hlp) {
        var omniAPI = cmp.find("omniToolkit");  
         console.log( JSON.stringify(omniAPI));
        omniAPI.getAgentWorks({
            callback: function(result) {
                 console.log("inside callback getAgentWork ");
                if (result.success) {
                    
                    console.log('Get work items successful');
                    
                } else {
                    console.log('Get work items failed');
                }
            }
        });
        console.log("getAgentWork call");
    }
})

 
Hi Everyone,

I am getting the error Invalid ID aHS5C000000KykJWAS, but it seems to be only when received as paramenter from Auracomponent.
I check the data type in javascript and it is a String.

 public static void sendEmail( String whatId ) {
      Id what_Id = Id.valueOf(whatId); //This does't work for my custom                                                           object only
      Id what_Id = Id.valueOf('aHS5C000000KykJWAS'); //This work for                                                                                          my custom object


I have tried in serveral ways, but it make no sense. Let me know if you know what is going on.

Thanks,
Carlos

 
import { LightningElement } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { loadStyle, loadScript } from 'lightning/platformResourceLoader';
import barcode from '@salesforce/resourceUrl/BarcodeJS'
import jdspdf from '@salesforce/resourceUrl/FusionJSpdf'
import FusionHTML2canvas from '@salesforce/resourceUrl/FusionHTML2canvas'
import Fusioncanvg from '@salesforce/resourceUrl/Fusioncanvg'
import Fusionrgbcolor from '@salesforce/resourceUrl/Fusionrgbcolor'

export default class PdfTest extends LightningElement {

    connectedCallback() {
        
       
        Promise.all([

           loadScript(this, Fusionrgbcolor  ),
           loadScript(this, barcode ) ,      
           loadScript(this, jdspdf  ) ,           
           loadScript(this, FusionHTML2canvas  ),
           loadScript(this, Fusioncanvg  )
           
            
       ]).then(() => {
            
           
           window.console.log('Files loaded.');
           var svgComponent = this.template.querySelector('svg');
           JsBarcode(svgComponent, '123123');
           
   
       }).catch( error => {
   
        if(error){

            window.console.log('Errors ' + error.message);

        }
        window.console.log('Errors ' );
           
           this.dispatchEvent(
               new ShowToastEvent({
                   title: 'Error updating record',
                   message: error,
                   variant: 'error'
               })
           );
       });
   
       }
}

Hi everyone.

 I am trying to load these external libraries that I have in separates static resource, It is only failing to load Fusioncanvg, I know that it depends on Fusionrgbcolor. I know that Fusionrgbcolor loads fine. 
How can load both?

Regards,
Carlos
Hi everyone,

 I need help with this, I have a screen flow in a customer community that need to show one pdf to be able to download.
I show it like this:

 <lightning:fileCard fileId="{!v.contentDocumentId}" description="Form"/>

but when preview it, it shows no Preview available and not able to download.

Any help on that or other way to do the same?



Regards,
CarlosNoPreviewAvailable
Hi everyone,

 I need help with this, I have a screen flow in a customer community that need to show one pdf to be able to download.
I show it like this:

 <lightning:fileCard fileId="{!v.contentDocumentId}" description="Form"/>

but when preview it, it shows no Preview available and not able to download.

Any help on that or other way to do the same?



Regards,
CarlosNoPreviewAvailable
I'm currently stuck on the "Learn Standard Open Redirect Preventions" challenge of the "App Logic Vulnerability Prevention" module.

The challenge is to submit a valid open redirect attack starting from the Standard Redirect Protections Challenge tab.

However, the links on this page are all to standard record pages, where the hack (e.g changing retURL to returl) won't work (it only works on VF pages).

Even if I attempt this and check the challenge, the error I get states: "It doesn't appear that you've successfully redirected to an external website using the Visualforce page. Please try again." - so it implies that it expects me executing this from a custom VF page.

Can anyone give me some advice on where I'm missing something on the challenge?