• Veronin Skadviz
  • NEWBIE
  • -3 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 12
    Replies
I'm new to aura components and I cannot figure out when I try to fire a component inside a callback function inside $A.getCallback() according to the documentation I get the error $A.getCallback() [Cannot read property 'setParam' of null]. I'm trying to fire the component inside a strophe.js hanlder function which is a callback function and only takes a single parameter.

LoginPanel.cmp
<aura:component description="Login panel for users to log into their CTI systems."  implements="c:panel">
    <ltng:require scripts="{!$Resource.Strophe}"/>
    <ltng:require scripts="{!$Resource.xml2json}"/>
    <!-- <ltng:require scripts="{!$Resource.jQuery}"/> -->



    <div class="slds-modal__container">
        <div class="logo">
            <img src="/staticresources/demoAdapterLogo.png" align="center"></img>
        </div>
        <div class="slds-form-element slds-p-bottom--medium">
            <label class="slds-form-element__label" for="text-input-01">Username</label>
            <div class="slds-form-element__control">
                <ui:inputText class="slds-input" aura:id="username"/>
            </div>
        </div>
        <div class="slds-form-element slds-p-bottom--medium">
            <label class="slds-form-element__label" for="text-input-01">Password</label>
            <div class="slds-form-element__control">
                <ui:inputSecret class="slds-input" aura:id="password"/>
            </div>
        </div>
        <div class="slds-form-element slds-p-bottom--medium">
            <label class="slds-form-element__label" for="text-input-01">Extension</label>
            <div class="slds-form-element__control">
                <ui:inputNumber class="slds-input" aura:id="extension"/>
            </div>
        </div>
        <button class="slds-button slds-button--brand" aura:id="submitButton" onclick="{!c.handleLogin}">Log In</button>
    </div>
</aura:component>
callInitiatedPanel.cmp
<aura:component description="panel that is shown on dialing, incoming or transferring calls before being connected that displays basic contact info for the call." implements="c:panel">
    <aura:attribute name="state" type="String" />
    <aura:attribute name="label" type="String" />
    <aura:attribute name="recordName" type="String" />
    <aura:attribute name="recordId" type="String" />
    <aura:attribute name="account" type="Object" />
    <aura:attribute name="title" type="String" />
    <aura:attribute name="phone" type="String" />
    <aura:attribute name="presence" type="String" description="Could be Available, Busy or Unavailable"/>
    <aura:handler name="init" value="{!this}" action="{!c.init}" />
    <div class="slds-panel">
        <!--  Top section: Information about the contact, including an avatar -->
        <div class="slds-panel__section">
            <div class="avatar slds-align--absolute-center">
                <div class="slds-avatar slds-avatar--circle slds-avatar--large">
                    <img src="/resource/slds/assets/images/avatar1.jpg" alt="Contact" />
                </div>
            </div>
            <div class="name slds-text-heading--large slds-text-color--weak slds-text-align--center">{!v.recordName}</div>
            <div class="slds-text-heading--x-small slds-text-color--weak slds-text-align--center companyDetails">{!v.account.Name}</div>
            <div class="slds-text-heading--x-small slds-text-color--weak slds-text-align--center companyDetails">{!v.title}</div>
            <div class="incoming slds-text-heading--x-small slds-text-color--weak slds-text-align--center">{!v.state}&nbsp;<ui:outputphone value="{!v.phone}" />...</div>
            <div class="slds-text-heading--x-small slds-text-color--weak slds-text-align--center"> <c:ticker /> </div>
        </div>
        
       <!--  Bottom section: End button on Dialing; Decline and Accept buttons on Incoming or Transferring -->
        <div class="bottom-panel slds-panel__section slds-align-bottom slds-grid">
            <aura:if isTrue="{! v.state == 'Dialing'}">
                <button class="slds-size--1-of-1 slds-button slds-button--destructive" onclick="{!c.end}">End</button>
                <aura:set attribute="else">
                    <button class="slds-size--1-of-2 slds-button slds-button--destructive" onclick="{!c.decline}">Decline</button>
                    <button class="slds-size--1-of-2 slds-button slds-button--brand" onclick="{!c.accept}">Accept</button>
                </aura:set>
            </aura:if>
        </div>
    </div>
</aura:component>

panel.intf
<aura:interface description="Demo Adapter Panel Interface, where every implementation is able to fire the events below.," >
    <aura:registerEvent name="renderPanel" type="c:renderPanel"/>
    <aura:registerEvent name="editPanel" type="c:editPanel"/>
    <aura:registerEvent name="getSettings" type="c:getSettings"/>
</aura:interface>


renderPanel.evt
 
<aura:event type="COMPONENT" description="Event fired to trigger panel rendering/transitioning.">
    <aura:attribute name="type" type="String" required="true" description="The type of panel component to create, e.g. c:ctiLoginPanel."/>
    <aura:attribute name="toast" type="Object" description="A toast to display on rendering. JS object consists of type (normal, success, warning, error) and a message"/>
    <aura:attribute name="attributes" type="Object" description="A map of attributes to send to the component."/>
</aura:event>

LoginPanelController.js
handleLogin: function(cmp, event, helper) {
    connection.connect('xyz.com', password, onConnect);

    var onConnect = setTimeout(() => {
    
    
        // works here 
        // cmp.getEvent('renderPanel').setParams({
        //     type : 'c:callInitiatedPanel',
        //     attributes : {
        //         'state' : 'Incoming',
        //         'recordName' : 'hammad',
        //         'phone' : 'phone',
        //         'title' : 'title',
        //         'account' : 'account',
        //         'recordId' : 'rid',
        //         'presence' : 'presence'
        //     }
        // }).fire()
    
    
    
        connection.send($pres({ to: PUBSUB_JID }).tree());
        connection.addHandler(function (msg) {
            var x2js = new X2JS();
    
            try {
    
                var text = msg['firstElementChild']['firstElementChild']['textContent'];
                var obj = x2js.xml_str2json(text);
                console.log("On Message : ", obj);
    
                window.setTimeout(
                    $A.getCallback(function () {
                        cmp.getEvent('renderPanel').setParams({
                            type: 'c:callInitiatedPanel',
                            attributes: {
                                'state': 'Incoming',
                                'recordName': 'abc',
                                'phone': 'phone',
                                'title': 'title',
                                'account': 'account',
                                'recordId': 'rid',
                                'presence': 'presence'
                            }
                        }).fire()
                    }), 1000
                );
    
    
            } catch (e) {
                console.log("Error: ", e)
            }
    
            return true;
    
        }, null, 'message', null, null, null);
    
    
    }, 1000)
    
}

 
I am trying to report on Engagemnet history on pardot forms in salesforce.Need help how this can be done or any output of how thi sreports looks like? we need to track webleads coming in and its status but we dont have any lead object in salesforce to handel this all is handeled through pardot
Hi everyone!

I have an issue and I cannot figure it out what's the problem.
I have created a flow for changing shipping method and updating delivery address. When I run the flow with my system administrator profile everything goes as expected. When I try to run with a supervisior profile I have an issue when it tries to update some fields on OrderDeliveryGroupSummary Object and I have this error: : INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: DeliverToCountry, DeliverToCity, DeliverToName, DeliverToState, DeliverToPostalCode, DeliverToStreet. Please check the security settings of this field and verify that it is read/write for your profile or permission set

The problem is that I checked the object permission for this profile and it has the same permission as a system administrator. I gave access for everything this flow needs. These fields are not visible in the object because they are address type I believe, they are visibile only in Workbench, so I can not give access directly to these fields, but it's the same for System administrator and it works. How to solve this issue? Please help

Thank you!
Hi,
On Account record I have a text field that contains value as 'Click here' where 'here' is a hyperlink to www.google.com. On querying the field using SOQL, I am getting the value as 'Click <a href="www.google.com"> here</a>'
But I want to get the value as 'Click here' instead of href. Is it possible? Please suggest if it can be achieved by any other method.
Hi, All
I am new to salesforce, can anyone help me to get 100% coverage please 


public class MyContactListController 
{
    @AuraEnabled
    public static List<Contact> getContacts(Id recordId) 
    {
        List<Contact> conList = new List<Contact>();
        try{
            System.debug('--'+recordId);
            conList = [Select Id, FirstName, LastName, Email, Phone From Contact Where AccountId = :recordId];
            System.debug('conlist result----> '+conList);
        }
        catch(Exception e){
            System.debug('inside catch Block  -> '+e.getMessage());
        }
        return conList;
    }
}



-----------------------------------------
TestClass
-----------------------------------------
@isTest
public class MyContactListControllerTest {
   
    static testMethod void getContactsTest(){
        Account ac = new Account(Name='Name1');
        Insert ac;
        List<Account> acList = [select id, name from Account where id!=NULL];
        System.assertEquals(true,acList.size()>0);
        MyContactListController.getContacts(acList[0].id);
        List<Case> case_Obj  =  [SELECT Id,CaseNumber,AccountId From Case WHERE AccountId=:acList[0].Id LIMIT 10];
       
        MyContactListController.getContacts(acList[0].Id); 
      
    }
}
I have signed up for a developer salesforce account and created a Connected App for testing to get the OAuth working and test the API. All seems to be good. My question is now, how do I allow other salesforce instance to use this application? Do I need to package and list it somewhere or how does it work?
Hi all,

I want to write a custom SFDX plugin so I'm following the instructions on https://www.salesforce.com/video/3594291/ and on https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_generate.htm .

However, I get the following error when following the steps in the video and executing bin/run hello:org:
›   Error: command hello:org not found

Somehow, on another plugin I generated in a similar way, this was working, but when I renamed the src/commands/hello folder and the src/commands/hello/org.ts files, the changes were not getting picked up.

I'm very new to Node development so maybe there's something that's completely obvious to seasoned Node developers that I'm missing here.

Do I need to manually compile the Typescript files to JS before I can run? If so, how do I do that?

If I run tsc on the project, I get:
node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts:11:28 - error TS2304: Cannot find name 'queueMicrotask'.

11     queueMicrotask: typeof queueMicrotask;
                              ~~~~~~~~~~~~~~

node_modules/@types/jsforce/query.d.ts:71:13 - error TS2368: Type parameter name cannot be 'never'.

71     finally<never>(): Promise<T>;
               ~~~~~

Found 2 errors.
Could that be the problem? How do I fix it?

Any help would be appreciated!

Cheers,
Frans
Hi All,

LWC intellisense(autocomplete) is not working in HTML file for lwc in vs code. I have all the salesforce extensions installed. Also, I have tried reinstalling both vs cdoe, CLI and extensions too. Still the same issue.
Have been using this for so long but all of sudden, I was stuck with this yesterday. Can somebody assist here.

Thanks
Hello,

I'm in the 3rd unit of the Quick Start: Lightning Web Components module where you have to create a Hello World LWC. I have done all steps and the code works (I see the Hello World component on the Homepage in the Playground), but the Verify Step at the end keeps failing with the message:
Step not yet complete in My Trailhead Playground
Make sure you add the 'helloWorld' Lightning web component to the default Home page.

I have deleted the playground and created a new one. I deleted all code and started from the beginning again, but still no success. This is driving me crazy. What is going on?

Can someone help?

Frank
 
Hi All,

We are looking to implement Chatbots for our website not built on Salesforce platform. Can Salesforce BOT API  or Einstein Bot be deployed on non Salesforce platform website?

Thanks
Can any one share best option to rpair Outlook OST Error.