• Danny Boyle
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
We have a lightning data table built in LWC, which has 2 columns - start date and end date. Start Date is going to be the first date of any month and the End Date would be the last date of the same month. However, we expect that as soon as the first start date has been entered manually, the rest of the start and end dates be calculated automatically in the same fashion. And the calculation should happen for next 12 months. The values in the data table are later being stored in the databaseUser-added image
I want to embed the snap-in code on all pages of our site so the user can browse to any page and have the chat follow them. I do not wish the chat button to appear on certain pages, particularly the home page. We want the user to attempt to find an answer on the site before we give them a chat option.

Ideal functionality is that the "chat now" option only appears when the customer visits the "contact us" page. Once the session is started, the chat window needs to appear on all pages.

Does anyone have any ideas on how I might do this?
I have used two Chat buttons, one with pre-chat form and other without pre-chat form with different Deployments. Its working fine if using them seperately in the page. But if using them together in the page, then it is showing configuration of second script on page but request is sent to the agent of first button and vice versa by changing the order of script. Below is my script:
<style type='text/css'>
.embeddedServiceHelpButton .helpButton .uiButton { background-color: #F3AE6E; font-family: "Salesforce Sans", sans-serif; }
.embeddedServiceHelpButton .helpButton .uiButton:focus { outline: 1px solid #F3AE6E; }
@font-face {
font-family: 'Salesforce Sans';
src: url('https://www.sfdcstatic.com/system/shared/common/assets/fonts/SalesforceSans/SalesforceSans-Regular.woff') format('woff'),
url('https://www.sfdcstatic.com/system/shared/common/assets/fonts/SalesforceSans/SalesforceSans-Regular.ttf') format('truetype');
}
</style>
<script type='text/javascript' src='https://service.force.com/embeddedservice/3.0/esw.min.js'></script>
<script type='text/javascript'>
var initESW = function(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 Live Agent
embedded_svc.settings.avatarImgURL = '';
embedded_svc.settings.prechatBackgroundImgURL = '';
embedded_svc.settings.waitingStateBackgroundImgURL = '';
embedded_svc.settings.smallCompanyLogoImgURL = '';

embedded_svc.settings.enabledFeatures = ['LiveAgent'];
embedded_svc.settings.entryFeature = 'LiveAgent';

embedded_svc.init('https://c2s--andrew.cs97.my.salesforce.com', 'https://andrew-tyco.cs97.force.com/livechat', gslbBaseURL, '00D0U000000Cmt0', 'SnapInsTrial', { baseLiveAgentContentURL: 'https://c.la2-c2cs-iad.salesforceliveagent.com/content', deploymentId: '572E0000000blJJ', buttonId: '5730L000000CqGK', baseLiveAgentURL: 'https://d.la2-c2cs-iad.salesforceliveagent.com/chat', eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I0U0000000001UAA_15e586bc423'}); };if (!window.embedded_svc) { var s = document.createElement('script'); s.setAttribute('src', 'https://c2s--andrew.cs97.my.salesforce.com/embeddedservice/3.0/esw.min.js'); s.onload = function() { initESW(null); }; document.body.appendChild(s); } else { initESW('https://c2s--andrew.cs97.my.salesforce.com'); }</script>
<style type='text/css'>
.embeddedServiceHelpButton .helpButton .uiButton { background-color: #005290; font-family: "Salesforce Sans", sans-serif; }
.embeddedServiceHelpButton .helpButton .uiButton:focus { outline: 1px solid #005290; }
@font-face {
font-family: 'Salesforce Sans';
src: url('https://www.sfdcstatic.com/system/shared/common/assets/fonts/SalesforceSans/SalesforceSans-Regular.woff') format('woff'),
url('https://www.sfdcstatic.com/system/shared/common/assets/fonts/SalesforceSans/SalesforceSans-Regular.ttf') format('truetype');
}
</style>
<script type='text/javascript' src='https://service.force.com/embeddedservice/3.0/esw.min.js'></script>
<script type='text/javascript'>
var initESW = function(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 Live Agent
embedded_svc.settings.avatarImgURL = '';
embedded_svc.settings.prechatBackgroundImgURL = '';
embedded_svc.settings.waitingStateBackgroundImgURL = '';
embedded_svc.settings.smallCompanyLogoImgURL = '';

embedded_svc.settings.enabledFeatures = ['LiveAgent'];
embedded_svc.settings.entryFeature = 'LiveAgent';

embedded_svc.init('https://c2s--andrew.cs97.my.salesforce.com', 'https://andrew-tyco.cs97.force.com/livechat', gslbBaseURL, '00D0U000000Cmt0', 'SnapInsWoPC', { baseLiveAgentContentURL: 'https://c.la2-c2cs-iad.salesforceliveagent.com/content', deploymentId: '5720U0000004CBI', buttonId: '5730L0000000ImX', baseLiveAgentURL: 'https://d.la2-c2cs-iad.salesforceliveagent.com/chat', eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I0U0000000006UAA_15e60c53f5b'}); };if (!window.embedded_svc) { var s = document.createElement('script'); s.setAttribute('src', 'https://c2s--andrew.cs97.my.salesforce.com/embeddedservice/3.0/esw.min.js'); s.onload = function() { initESW(null); }; document.body.appendChild(s); } else { initESW('https://c2s--andrew.cs97.my.salesforce.com'); }</script>
Please help me in resolving the issue.