• Hari Kumar Enaganti
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 2
    Replies
Hi I have some customization in Einstein chat bot as per my requirement.
I have created embedded service deployments for my my chat ,and pasted the **Get Code** snippet in my html. But the chat window shows Live Agent chat window rather than with Embedded service deployment.

I am posting my code here can some one assist me here in this.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
    </head>
     
    <body >
        
    <h1>Cookbook Bot</h1>

    <!-- PUT BUTTON CODE SNIPPET HERE -->
    <a id="liveagent_button_online_5737F000000geoj" href="javascript://Chat" onclick="liveagent.startChat('5737F000000geoj')">Online Chat Content</a>
    <div id="liveagent_button_offline_5737F000000geoj" style="display: none;"><!-- Offline Chat Content --></div>
    <script type="text/javascript">
    if (!window._laq) { window._laq = []; }
    window._laq.push(function(){liveagent.showWhenOnline('5737F000000geoj', document.getElementById('liveagent_button_online_5737F000000geoj'));
    console.log('18---------r-----');
    liveagent.showWhenOffline('5737F000000geoj', document.getElementById('liveagent_button_offline_5737F000000geoj'));
    });
    </script>

    <!-- PUT DEPLOYMENT CODE HERE -->
    <script type='text/javascript' src='https://c.la1-c1-hnd.salesforceliveagent.com/content/g/js/55.0/deployment.js'></script>
    <script type='text/javascript'>
    console.log('26--------k------');
    liveagent.init('https://d.la1-c1-hnd.salesforceliveagent.com/chat', '5727F000000gmmz', '00D7F000002dQK0');
    </script>

    <style type='text/css'>
        .embeddedServiceHelpButton .helpButton .uiButton {
            background-color: #005290;
            font-family: "Arial", sans-serif;
        }
        .embeddedServiceHelpButton .helpButton .uiButton:focus {
            outline: 1px solid #005290;
        }
    </style>

    <script type='text/javascript' src='https://service.force.com/embeddedservice/5.0/esw.min.js'></script>
    <script type='text/javascript'>
    console.log('42--------------');
        var initESW = function(gslbBaseURL) {
        console.log('44--------------'+gslbBaseURL);
            embedded_svc.settings.displayHelpButton = true; //Or false
            embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US'

            //embedded_svc.settings.defaultMinimizedText = '...'; //(Defaults to Chat with an Expert)
            //embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline)

            //embedded_svc.settings.loadingText = ''; //(Defaults to Loading)
            //embedded_svc.settings.storageDomain = 'yourdomain.com'; //(Sets the domain for your deployment so that visitors can navigate subdomains during a chat session)

            // Settings for Chat
            embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
                // Dynamically changes the button ID based on what the visitor enters in the pre-chat form.
                // Returns a valid button ID.
            };
            //embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields
            //embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId
            //embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us)

            embedded_svc.settings.enabledFeatures = ['LiveAgent'];
            embedded_svc.settings.entryFeature = 'LiveAgent';
    console.log('---');
            embedded_svc.init(
            
                'https://dev-ed.my.salesforce.com',
                'https://developer-edition.ap5.force.com',
                gslbBaseURL,
                '00D7F000002dQK0',
                'CSupport',
                {
                    baseLiveAgentContentURL: 'https://c.la1-c1-hnd.salesforceliveagent.com/content',
                    deploymentId: '5727F000000gmmz',
                    buttonId: '5737F000000geoj',
                    baseLiveAgentURL: 'https://d.la1-c1-hnd.salesforceliveagent.com/chat',
                    eswLiveAgentDevName: 'CSupport',
                    isOfflineSupportEnabled: false
                }
            );
            console.log('--|-');
        };

        if (!window.embedded_svc) {
        console.log('83-----------a---');
            var s = document.createElement('script');
            s.setAttribute('src', 'https://dev-ed.my.salesforce.com/embeddedservice/5.0/esw.min.js');
            s.onload = function() {
                initESW(null);
            };
            document.body.appendChild(s);
        } else {
        console.log('91-----d---------');
            initESW('https://service.force.com');
        }
    </script>


    </body>
    </html>
Is there any way to customize "The bot is responding..." and "Connecting to Agent" and "Please hold while we connect you to an agent".

My requirement is to change these loading,waiting messages in Salesforce Einstein chat bot.  
I Am using lightening-input type=number . As a LWC feature some alphabets like k, K, m, M, b, B, t these are allowed. I dont want this to be entered.Is ther way to disable this alphabets?
My first community page is changed to other language but not connected app Org pages. So I would like to pass language parameters to see changes in my Connected org as well.
Kindly let me know how to receive params in 2nd org.
I would like to show some images from STaticResources zipped folder in my lightning component. I should show those pictures in my component ,upon selecting any of the image it should save as Prfoile picture for that user.I have used connectapi to insert body/base64 value of the blob if am uploading image from Computer ,but the same need to done for StaticResource. If I got respective selected image body/base64 information from Static resource zipped folder ,my job will be easy.

can anybody suggest any ansers.
Am trying to Insert/Upload a File(Base64) from Rest Client by mentioning
https://mysalesforce-instance.com/services/data/v48.0/sobjects/ContentVersion by giving Body as
 
{
"Title":"New Upload",
"PathOnClient":"NewUpload.JPG",
"ContentLocation":"S",
"OwnerId":"<My Id>",
"VersionData":"file base64 information"
}

Passing headers with the
Authorization access token
Content-type apllication/json;charset=UTF-8

I can able to get response from Workbench, but when I have done this in Postman/ARC am getting ContentVersion object description like below. but not getting successful ID. Kindly let me know is there any thing I need to do.
 
{
    "objectDescribe": {
        "activateable": false,
        "createable": true,
        "custom": false,
        "customSetting": false,
        "deepCloneable": false,
        "deletable": false,
        "deprecatedAndHidden": false,
        "feedEnabled": false,
        "hasSubtypes": false,
        "isInterface": false,
        "isSubtype": false,
        "keyPrefix": "068",
        "label": "Content Version",
        "labelPlural": "Content Versions",
        "layoutable": true,
        "mergeable": false,
        "mruEnabled": false,
        "name": "ContentVersion",
        "queryable": true,
        "replicateable": false,
        "retrieveable": true,
        "searchable": true,
        "triggerable": true,
        "undeletable": false,
        "updateable": true,
        "urls": {
            "compactLayouts": "/services/data/v48.0/sobjects/ContentVersion/describe/compactLayouts",
            "rowTemplate": "/services/data/v48.0/sobjects/ContentVersion/{ID}",
            "defaultValues": "/services/data/v48.0/sobjects/ContentVersion/defaultValues?recordTypeId&fields",
            "describe": "/services/data/v48.0/sobjects/ContentVersion/describe",
            "layouts": "/services/data/v48.0/sobjects/ContentVersion/describe/layouts",
            "sobject": "/services/data/v48.0/sobjects/ContentVersion"
        }
    },
    "recentItems": []
}

 
Hi I have some customization in Einstein chat bot as per my requirement.
I have created embedded service deployments for my my chat ,and pasted the **Get Code** snippet in my html. But the chat window shows Live Agent chat window rather than with Embedded service deployment.

I am posting my code here can some one assist me here in this.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
    </head>
     
    <body >
        
    <h1>Cookbook Bot</h1>

    <!-- PUT BUTTON CODE SNIPPET HERE -->
    <a id="liveagent_button_online_5737F000000geoj" href="javascript://Chat" onclick="liveagent.startChat('5737F000000geoj')">Online Chat Content</a>
    <div id="liveagent_button_offline_5737F000000geoj" style="display: none;"><!-- Offline Chat Content --></div>
    <script type="text/javascript">
    if (!window._laq) { window._laq = []; }
    window._laq.push(function(){liveagent.showWhenOnline('5737F000000geoj', document.getElementById('liveagent_button_online_5737F000000geoj'));
    console.log('18---------r-----');
    liveagent.showWhenOffline('5737F000000geoj', document.getElementById('liveagent_button_offline_5737F000000geoj'));
    });
    </script>

    <!-- PUT DEPLOYMENT CODE HERE -->
    <script type='text/javascript' src='https://c.la1-c1-hnd.salesforceliveagent.com/content/g/js/55.0/deployment.js'></script>
    <script type='text/javascript'>
    console.log('26--------k------');
    liveagent.init('https://d.la1-c1-hnd.salesforceliveagent.com/chat', '5727F000000gmmz', '00D7F000002dQK0');
    </script>

    <style type='text/css'>
        .embeddedServiceHelpButton .helpButton .uiButton {
            background-color: #005290;
            font-family: "Arial", sans-serif;
        }
        .embeddedServiceHelpButton .helpButton .uiButton:focus {
            outline: 1px solid #005290;
        }
    </style>

    <script type='text/javascript' src='https://service.force.com/embeddedservice/5.0/esw.min.js'></script>
    <script type='text/javascript'>
    console.log('42--------------');
        var initESW = function(gslbBaseURL) {
        console.log('44--------------'+gslbBaseURL);
            embedded_svc.settings.displayHelpButton = true; //Or false
            embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US'

            //embedded_svc.settings.defaultMinimizedText = '...'; //(Defaults to Chat with an Expert)
            //embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline)

            //embedded_svc.settings.loadingText = ''; //(Defaults to Loading)
            //embedded_svc.settings.storageDomain = 'yourdomain.com'; //(Sets the domain for your deployment so that visitors can navigate subdomains during a chat session)

            // Settings for Chat
            embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
                // Dynamically changes the button ID based on what the visitor enters in the pre-chat form.
                // Returns a valid button ID.
            };
            //embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields
            //embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId
            //embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us)

            embedded_svc.settings.enabledFeatures = ['LiveAgent'];
            embedded_svc.settings.entryFeature = 'LiveAgent';
    console.log('---');
            embedded_svc.init(
            
                'https://dev-ed.my.salesforce.com',
                'https://developer-edition.ap5.force.com',
                gslbBaseURL,
                '00D7F000002dQK0',
                'CSupport',
                {
                    baseLiveAgentContentURL: 'https://c.la1-c1-hnd.salesforceliveagent.com/content',
                    deploymentId: '5727F000000gmmz',
                    buttonId: '5737F000000geoj',
                    baseLiveAgentURL: 'https://d.la1-c1-hnd.salesforceliveagent.com/chat',
                    eswLiveAgentDevName: 'CSupport',
                    isOfflineSupportEnabled: false
                }
            );
            console.log('--|-');
        };

        if (!window.embedded_svc) {
        console.log('83-----------a---');
            var s = document.createElement('script');
            s.setAttribute('src', 'https://dev-ed.my.salesforce.com/embeddedservice/5.0/esw.min.js');
            s.onload = function() {
                initESW(null);
            };
            document.body.appendChild(s);
        } else {
        console.log('91-----d---------');
            initESW('https://service.force.com');
        }
    </script>


    </body>
    </html>
My first community page is changed to other language but not connected app Org pages. So I would like to pass language parameters to see changes in my Connected org as well.
Kindly let me know how to receive params in 2nd org.
Am trying to Insert/Upload a File(Base64) from Rest Client by mentioning
https://mysalesforce-instance.com/services/data/v48.0/sobjects/ContentVersion by giving Body as
 
{
"Title":"New Upload",
"PathOnClient":"NewUpload.JPG",
"ContentLocation":"S",
"OwnerId":"<My Id>",
"VersionData":"file base64 information"
}

Passing headers with the
Authorization access token
Content-type apllication/json;charset=UTF-8

I can able to get response from Workbench, but when I have done this in Postman/ARC am getting ContentVersion object description like below. but not getting successful ID. Kindly let me know is there any thing I need to do.
 
{
    "objectDescribe": {
        "activateable": false,
        "createable": true,
        "custom": false,
        "customSetting": false,
        "deepCloneable": false,
        "deletable": false,
        "deprecatedAndHidden": false,
        "feedEnabled": false,
        "hasSubtypes": false,
        "isInterface": false,
        "isSubtype": false,
        "keyPrefix": "068",
        "label": "Content Version",
        "labelPlural": "Content Versions",
        "layoutable": true,
        "mergeable": false,
        "mruEnabled": false,
        "name": "ContentVersion",
        "queryable": true,
        "replicateable": false,
        "retrieveable": true,
        "searchable": true,
        "triggerable": true,
        "undeletable": false,
        "updateable": true,
        "urls": {
            "compactLayouts": "/services/data/v48.0/sobjects/ContentVersion/describe/compactLayouts",
            "rowTemplate": "/services/data/v48.0/sobjects/ContentVersion/{ID}",
            "defaultValues": "/services/data/v48.0/sobjects/ContentVersion/defaultValues?recordTypeId&fields",
            "describe": "/services/data/v48.0/sobjects/ContentVersion/describe",
            "layouts": "/services/data/v48.0/sobjects/ContentVersion/describe/layouts",
            "sobject": "/services/data/v48.0/sobjects/ContentVersion"
        }
    },
    "recentItems": []
}

 
When I'm trying to use 
> sfdx force:auth:web:login -d -a DevHub
Getting Error - 
ERROR running force:auth:web:login:  Cannot start the OAuth redirect server on port PortInUseAction. 

Try this: 
Kill the process running on port 1717 or use a custom connected app and update OauthLocalPort in the sfdx-project.json file.