• Bhavesh Jain 41
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 13
    Replies
hi All,

I am trying to create an Amazon Connect instance as mentioned on the link https://trailhead.salesforce.com/content/learn/projects/build-an-amazon-connect-integration/create-an-amazon-connect-instance and while doing the same in AWS I am running into issue related to AISPL

You're signed in with an AWS account that was provided by AISPL. These accounts cannot create Amazon Connect instances. Sign in using an account provided by AWS, and then try to create an instance. Please contact support if you need further assistance.

User-added image
Hi All,

I have used snap-ins for community where in my developer org I have user the Live agent and when a chat gets initiated from community the agent while accepting the chat can see the user details before accepting, however in another sandbox I have used snap-ins with Omni channel and when a chat gets initiated from community, user details are not visible to the agent before accepting the chat?

Am I missing anything?
I have a few questions regarding Snap-ins chat
1) Based on what criteria, the fields appear in the snap-ins chat pre chat form configuration in the scenarios of Sales, Service and Basic scenarios. example if I have 20 fields in contact object not all the standard and custom fields appear in the pre chat form only a few appear.
2) Is there a way that we can get add additional fields in the pre chat form when a user fills in before initiating a chat
3) When I copy the snapins code snippet and paste it in a VF page it works fine however when I add that page to the Salesforce community at the footer I can see the chat window but no response when I click on that.

P.S: I have added the domains to cors list
hey all,
I am stuck in part one where I need to override the pre chat form in snap-ins with the fields defined in contact object
I have created a lightning component for the pre chat form and over-ridden that in a snap-ins setting and the prechat form loads just fine however when I click on start chat it does not fire the chat:

Below is the code:
==============
Component: 

<aura:component
    implements="lightningsnapin:prechatUI,flexipage:availableForAllPageTypes,force:appHostable,force:lightningQuickActionWithoutHeader"
    controller="Bot_PreChatCmpCnt">
      
    <aura:attribute name="userId" access="PRIVATE" type="string" default="-"/>
    <aura:attribute name="FirstName" access="PRIVATE" type="string" />
    <aura:attribute name="LastName" access="PRIVATE" type="string" />
    <aura:attribute name="Email" access="PRIVATE" type="string" />
    <aura:attribute name="Phone" access="PRIVATE" type="string" />
    <aura:attribute name="Salutation" access="PRIVATE" type="string" /> 
    <aura:attribute name="Organization_Name__c" access="PRIVATE" type="string" />.
   <!-- <aura:attribute name="OrganizationType" access="PRIVATE" type="string" /> -->
  
    <!-- Contains methods for getting pre-chat fields, starting a chat, and validating fields -->
    <lightningsnapin:prechatAPI aura:id="prechatAPI"/>
      
  
    <!-- After this component has rendered, call the controller's onRender function -->
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:renderIf isTrue="{!v.userId}">
        
            <lightning:input type="text" value="{!v.Salutation}" label="Salutation *"/> 
            <lightning:input type="text" value="{!v.FirstName}" label="Name *"/>
            <lightning:input type="text" value="{!v.LastName}" label="Lastname *"/>
            <lightning:input type="text" value="{!v.Email}" label="Email *"/>
            <lightning:input type="text" value="{!v.Phone}" label="Phone *"/>
            <lightning:input type="text" value="{!v.Organization_Name__c}" label="Organisation Name *"/>
        <!--    <lightning:input type="text" value="{!v.OrganizationType}" label="Organization Type *"/> -->
        <aura:set attribute="else">
              <lightning:input type="text" value="" label="Salutation *"/> 
            <lightning:input type="text" value="" label="Name *"/>
            <lightning:input type="text" value="" label="Lastname *"/>
            <lightning:input type="text" value="" label="Email *"/>
            <lightning:input type="text" value="" label="Phone *"/>
            <lightning:input type="text" value="" label="Organisation Name *"/>
        <!--    <lightning:input type="text" value="" label="Organization Type *"/> -->
        </aura:set>
       
    </aura:renderIf>
     <lightning:button label="Start chat!" onclick="{!c.onStartButtonClick}"/>
        
    
</aura:component>

Client side js:
==========
({
doInit: function(component, event, helper) {
    debugger
        var prechatFields = component.find("prechatAPI").getPrechatFields();
        var action = component.get("c.getCurrentUser");
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var result = JSON.parse(response.getReturnValue());
                console.log(result, embedded_svc);
                component.set('v.userId', result.userId);
                if(result.userId){
                    component.set('v.Salutation', result.Salutation);
                    component.set('v.FirstName', result.FirstName);
                    component.set('v.LastName', result.LastName);
                    component.set('v.Email', result.Email);
                    component.set('v.Phone', result.Phone);
                    component.set('v.Organization_Name__c', result.Organization_Name__c);
                    //component.set('v.OrganizationType', result.OrganizationType);
                    helper.startChat(component, event, helper);
                }
            }else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " +
                                 errors[0].message);
                    }
                } else {
                    console.log("Unknown error");
                }
            }
        });
        $A.enqueueAction(action);
    },
    onStartButtonClick: function(component, event, helper) {
        //handling errors

       // if(!component.get('v.FirstName')
       //   || !component.get('v.LastName')
        //   || !component.get('v.Email')
        //|| !component.get('v.Salutation')
        // || !component.get('v.Phone')
        //  || !component.get('v.Organization_Name__c')) return alert('Missing fields.');
        helper.startChat(component, event, helper);
    }
});

Server side controller:
=================
public class Bot_PreChatCmpCnt {
    @auraenabled
    public static String getCurrentUser(){
        Map<String,Object> output = new Map<String,Object>();
        User u = [Select Username, FirstName, LastName, Email, contactId From User Where Id = :UserInfo.getUserId()];
        system.debug('******user*******'+u);
        if(u.contactId != NULL)
        {
        contact c = [Select Id, Salutation, FirstName, LastName, Email, Phone, Contact_Type__c, Organization_Name__c From Contact Where Id =:u.ContactId];
        system.debug('******Contact*******'+c);
        if(c.Id != null){
            output.put('userId', u.UserName);
            system.debug('******user*******'+u.UserName);
            output.put('FirstName', c.FirstName);
            output.put('LastName', c.LastName);
            output.put('Email', c.Email);
            output.put('Salutation', c.Salutation);
            output.put('Phone', c.Phone);
            output.put('Organization_Name__c', c.Organization_Name__c);
            //output.put('OrganizationType', c.Contact_Type__c);
           system.debug('******user*******'+c);
        }
            
            else{
            output.put('userId', '');
            }
        }
        return JSON.serialize(output);
    }
        
}

Handler 
=========
({
      
    startChat: function(component, event, helper){
        debugger
        var fields = [
            {
               label: 'Salutation',
               name: 'Salutation',
               value: component.get('v.Salutation')
            } ,
            {
                label: 'FirstName',
                name: 'FirstName',
                value: component.get('v.firstName')
            } ,
            {
                label: 'LastName',
                name: 'LastName',
                value: component.get('v.LastName')
            }  ,
            {
                label: 'Email',
                name: 'Email',
                value: component.get('v.Email')
            },{
                label: 'Username',
                name: 'Username__c',
                value: component.get('v.userId'),
            },
            {
                label: 'Phone',
                name: 'Phone',
                value: component.get('v.Phone')
            } ,
            {
                label: 'Organization Name',
                name: 'Organization_Name__c',
                value: component.get('v.Organization_Name__c')
            } 
            
        ];
       // try{
        if(component.find("prechatAPI").validateFields(fields).valid) {
            component.find("prechatAPI").startChat(fields);
        }
       else {
            console.warn("Prechat fields did not pass validation!");
        }
       // }
        //catch(e){
        //    console.log(e);
       // }
    }
});
Object 1: Account
Object 2: Contact
Object 3: Snapshot
relationshiop betweek Contact and Snapshot is Master details
have a rollup summary field on contact which calculates the Total amount from Snapshot records to contact respectively
I need to have a roll up created on Account to get the net total from all the contact records to account
I have created a flow and below is the issue I am facing
when Snapshot record gets created/updated the rollup on contact gets updated at that moment but the account object the field does not get updated
When I go back to snapshot record and double click on the field and without changing value save the file and refresh the Account page it shows the correct value

Any help on this?
Below is my code:
public class StringArraytest 
{
    public static List<string> generateStringArray(integer n)
    {
        integer i=5;
        List<string> str= new List<string>();
        for(i=0;i<n;i++)
        {
            str.add('test '+i);
            system.debug(str[i]);
        }
        return str;
    }
}

Error: Challenge not yet complete... here's what's wrong:
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.
hi All,

I am trying to create an Amazon Connect instance as mentioned on the link https://trailhead.salesforce.com/content/learn/projects/build-an-amazon-connect-integration/create-an-amazon-connect-instance and while doing the same in AWS I am running into issue related to AISPL

You're signed in with an AWS account that was provided by AISPL. These accounts cannot create Amazon Connect instances. Sign in using an account provided by AWS, and then try to create an instance. Please contact support if you need further assistance.

User-added image
Hello, 
I created a visualforce page called "TestChat". In this visualforce page,  I added the Snap-Ins code with customization.

The Snap-Ins guide (https://resources.docs.salesforce.com/214/latest/en-us/sfdc/pdf/snapins_web_dev_guide.pdf), indicates  in the section called "embedded_svc.settings.extraPrechatInfo", that when we don't want to create contact records, only find them instead , it is necessary to put "doCreate":false.

I typed the aforementioned tag "doCreate":false" in my Snap-Ins code but it doen's work. Because it always creates a contact record . 
Could you please help me to solve this issue?
Thanks for advance! 

Rocio
 
hey all,
I am stuck in part one where I need to override the pre chat form in snap-ins with the fields defined in contact object
I have created a lightning component for the pre chat form and over-ridden that in a snap-ins setting and the prechat form loads just fine however when I click on start chat it does not fire the chat:

Below is the code:
==============
Component: 

<aura:component
    implements="lightningsnapin:prechatUI,flexipage:availableForAllPageTypes,force:appHostable,force:lightningQuickActionWithoutHeader"
    controller="Bot_PreChatCmpCnt">
      
    <aura:attribute name="userId" access="PRIVATE" type="string" default="-"/>
    <aura:attribute name="FirstName" access="PRIVATE" type="string" />
    <aura:attribute name="LastName" access="PRIVATE" type="string" />
    <aura:attribute name="Email" access="PRIVATE" type="string" />
    <aura:attribute name="Phone" access="PRIVATE" type="string" />
    <aura:attribute name="Salutation" access="PRIVATE" type="string" /> 
    <aura:attribute name="Organization_Name__c" access="PRIVATE" type="string" />.
   <!-- <aura:attribute name="OrganizationType" access="PRIVATE" type="string" /> -->
  
    <!-- Contains methods for getting pre-chat fields, starting a chat, and validating fields -->
    <lightningsnapin:prechatAPI aura:id="prechatAPI"/>
      
  
    <!-- After this component has rendered, call the controller's onRender function -->
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:renderIf isTrue="{!v.userId}">
        
            <lightning:input type="text" value="{!v.Salutation}" label="Salutation *"/> 
            <lightning:input type="text" value="{!v.FirstName}" label="Name *"/>
            <lightning:input type="text" value="{!v.LastName}" label="Lastname *"/>
            <lightning:input type="text" value="{!v.Email}" label="Email *"/>
            <lightning:input type="text" value="{!v.Phone}" label="Phone *"/>
            <lightning:input type="text" value="{!v.Organization_Name__c}" label="Organisation Name *"/>
        <!--    <lightning:input type="text" value="{!v.OrganizationType}" label="Organization Type *"/> -->
        <aura:set attribute="else">
              <lightning:input type="text" value="" label="Salutation *"/> 
            <lightning:input type="text" value="" label="Name *"/>
            <lightning:input type="text" value="" label="Lastname *"/>
            <lightning:input type="text" value="" label="Email *"/>
            <lightning:input type="text" value="" label="Phone *"/>
            <lightning:input type="text" value="" label="Organisation Name *"/>
        <!--    <lightning:input type="text" value="" label="Organization Type *"/> -->
        </aura:set>
       
    </aura:renderIf>
     <lightning:button label="Start chat!" onclick="{!c.onStartButtonClick}"/>
        
    
</aura:component>

Client side js:
==========
({
doInit: function(component, event, helper) {
    debugger
        var prechatFields = component.find("prechatAPI").getPrechatFields();
        var action = component.get("c.getCurrentUser");
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var result = JSON.parse(response.getReturnValue());
                console.log(result, embedded_svc);
                component.set('v.userId', result.userId);
                if(result.userId){
                    component.set('v.Salutation', result.Salutation);
                    component.set('v.FirstName', result.FirstName);
                    component.set('v.LastName', result.LastName);
                    component.set('v.Email', result.Email);
                    component.set('v.Phone', result.Phone);
                    component.set('v.Organization_Name__c', result.Organization_Name__c);
                    //component.set('v.OrganizationType', result.OrganizationType);
                    helper.startChat(component, event, helper);
                }
            }else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " +
                                 errors[0].message);
                    }
                } else {
                    console.log("Unknown error");
                }
            }
        });
        $A.enqueueAction(action);
    },
    onStartButtonClick: function(component, event, helper) {
        //handling errors

       // if(!component.get('v.FirstName')
       //   || !component.get('v.LastName')
        //   || !component.get('v.Email')
        //|| !component.get('v.Salutation')
        // || !component.get('v.Phone')
        //  || !component.get('v.Organization_Name__c')) return alert('Missing fields.');
        helper.startChat(component, event, helper);
    }
});

Server side controller:
=================
public class Bot_PreChatCmpCnt {
    @auraenabled
    public static String getCurrentUser(){
        Map<String,Object> output = new Map<String,Object>();
        User u = [Select Username, FirstName, LastName, Email, contactId From User Where Id = :UserInfo.getUserId()];
        system.debug('******user*******'+u);
        if(u.contactId != NULL)
        {
        contact c = [Select Id, Salutation, FirstName, LastName, Email, Phone, Contact_Type__c, Organization_Name__c From Contact Where Id =:u.ContactId];
        system.debug('******Contact*******'+c);
        if(c.Id != null){
            output.put('userId', u.UserName);
            system.debug('******user*******'+u.UserName);
            output.put('FirstName', c.FirstName);
            output.put('LastName', c.LastName);
            output.put('Email', c.Email);
            output.put('Salutation', c.Salutation);
            output.put('Phone', c.Phone);
            output.put('Organization_Name__c', c.Organization_Name__c);
            //output.put('OrganizationType', c.Contact_Type__c);
           system.debug('******user*******'+c);
        }
            
            else{
            output.put('userId', '');
            }
        }
        return JSON.serialize(output);
    }
        
}

Handler 
=========
({
      
    startChat: function(component, event, helper){
        debugger
        var fields = [
            {
               label: 'Salutation',
               name: 'Salutation',
               value: component.get('v.Salutation')
            } ,
            {
                label: 'FirstName',
                name: 'FirstName',
                value: component.get('v.firstName')
            } ,
            {
                label: 'LastName',
                name: 'LastName',
                value: component.get('v.LastName')
            }  ,
            {
                label: 'Email',
                name: 'Email',
                value: component.get('v.Email')
            },{
                label: 'Username',
                name: 'Username__c',
                value: component.get('v.userId'),
            },
            {
                label: 'Phone',
                name: 'Phone',
                value: component.get('v.Phone')
            } ,
            {
                label: 'Organization Name',
                name: 'Organization_Name__c',
                value: component.get('v.Organization_Name__c')
            } 
            
        ];
       // try{
        if(component.find("prechatAPI").validateFields(fields).valid) {
            component.find("prechatAPI").startChat(fields);
        }
       else {
            console.warn("Prechat fields did not pass validation!");
        }
       // }
        //catch(e){
        //    console.log(e);
       // }
    }
});
Salesforce says the following:

"Customer Community, Customer Community Plus and Lightning External Apps licenses require unique usernames whithin the Salesforce Org. that a community belongs to."

"Partner Community licenses, Employee Community, Lightning External Apps Plus licenses require unique usernames across all Salesforce Orgs that the user belongs to."

Instead of having to memorize that, I would actually like to understand why (the underlying reason(s) for the uniqueness of the usernames being within the Org OR across all Orgs globally to which the user pertains.

Is there any logical reason that you can think of?
 
  • September 06, 2018
  • Like
  • 0
We have a Community with a stadard dashboard on the home page.  It has an annoying scrollbar on the right that I need to remove.

User-added image
 
Hello everyone,

Currently, we use an app in Salesforce called CTI Connect to log calls (as Tasks) immediately after they occur. We are able to log these calls in addition to other information such as the duration of the call. We are now wondering - is this kind of data collection possible with Amazon Connect as well? At the moment, we have configured Amazon Connect in a dev environment and are able to make calls. If this kind of call logging is possible, what would the general path for implementation be?

Thank you for your advice!
Below is my code:
public class StringArraytest 
{
    public static List<string> generateStringArray(integer n)
    {
        integer i=5;
        List<string> str= new List<string>();
        for(i=0;i<n;i++)
        {
            str.add('test '+i);
            system.debug(str[i]);
        }
        return str;
    }
}

Error: Challenge not yet complete... here's what's wrong:
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.
I'm building a custom pre-chat form that I'm using with a snap-ins chat deployment. I am using it in a Salesforce community and everything works great except I have no way of sending specific cases that I want to attach to the transcript and to display to the agent. I know exactly how to do this using the code snippet route, but since the chat is being used in the community there is no way to access any of the embedded_svc information because of locker service. I tried making a visualforce page and using the snippet, which allowed me to access embedded_svc, however it broke the chat altogether. Any ideas for how to pass an existing case ID to the chat so that it shows the existing case instead of making a new one? I've tried at least ten different ways to do this, but all have failed. Thanks everyone in advance.
How can I route the chat to different group of agents based on a value entered in the pre-chat form on a Napli community? 

I have the snap in working and it does go to an agent but I don't see how I can route it.  I see where you can enter the values that users can paste on a web page to dynamical change the button.  I don't have that option in community.

Hello all,
 

I have been searching through the documentation and I can't find a clear answer. I am trying to use apex to create a report ( it requires calculations that aren't available in the normal report building ), and I want to be able to save it as a public report. Is this possible? 

If so, would it require a Visualforce Page? 

Hi there, can anyone help with the trail head challenge I am stuck with? I have tried all the solutions given in the forum. 

My problem is, even when there is a notification, I am getting this error. I have double checked the name i am giving the notification, the amount and other checks that have been given in the challenge. I have tried creating and deleting this notification several times with different time for notifying. I received an email only twice and the notification sign on the DE showed a notification twice only. I am getting the an error even when there is a notification. Any help from you is highly appreciated. Thanks for your time and patience. User-added image
I keep receiving the following error message when attempting to clear:

"Challenge Not yet complete... here's what's wrong:  Could not find notification on dashboard. Please check the requirements again." 
(Task - Create a notification to alert you when lost opportunities exceed a certain amount)


The alert is created and set to run. When you Save and Run the alert, it disables it for some reason and you can't see it as a widget in  the Notification Tracking section. When you Save only, it stays active and displays the widget on the Wave Analytics home page. It doesn't display on the Oppty Details dashboard though.

Any thoughts? I'd like to complete this trail and progress to the next part of the project.

Hi there,

Is there a way to display a CSAT or at least a custom page with a link to a CSAT at the end of the chat when using the Snap-ins ?

Many thanks

Hi There,

Is is possible to change the locale or the language or the Snap-ins content ?
Currently, it seems to be related to the browser languages settings.

Many Thanks