• Diego Muriel
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies

Hi,

before the spring'20 version, chat had been implemented, along with the channel menu. Everything worked perfectly. The code looked like this:
 

<script type='text/javascript' src='https://service.force.com/embeddedservice/menu/fab.min.js'></script>

<script type='text/javascript'>
	var initESW = function(gslbBaseURL) {
		embedded_svc.menu.chat.settings.prepopulatedPrechatFields = {
            FirstName: "{{fName}}",
            LastName: "{{lName}}",
            Email: "{{email}}",
            Telefone: "{{phone}}"
        };
		
		
		embedded_svc.menu.init(
			'https://xxxxxxx.my.salesforce.com',
			'https://d.xxxxxxxxxxxxxx.salesforceliveagent.com/chat',
			gslbBaseURL,
			'xxxxxxxxxxxx',
			'Channel_Menu'
		);
		
	};

	if (!window.embedded_svc || !window.embedded_svc.menu) {
		var s = document.createElement('script');
		s.setAttribute('src', 'https://xxxxxxx.my.salesforce.com/embeddedservice/menu/fab.min.js');
		s.onload = function() {
			initESW(null);
		};
		document.body.appendChild(s);
	} else {
		initESW('https://service.force.com');
	}
</script>
 

After the update stopped working. An undefined object error now occurs. Investigating, I imagine that this happens because now the channel menu options are dynamic and can be changed by the client side.

Any suggestions or examples to fill in the pre-form data?

I need to pass a list of objects to an APEX action, but are not allowed variables in the entry?
User-added image

Hi,

before the spring'20 version, chat had been implemented, along with the channel menu. Everything worked perfectly. The code looked like this:
 

<script type='text/javascript' src='https://service.force.com/embeddedservice/menu/fab.min.js'></script>

<script type='text/javascript'>
	var initESW = function(gslbBaseURL) {
		embedded_svc.menu.chat.settings.prepopulatedPrechatFields = {
            FirstName: "{{fName}}",
            LastName: "{{lName}}",
            Email: "{{email}}",
            Telefone: "{{phone}}"
        };
		
		
		embedded_svc.menu.init(
			'https://xxxxxxx.my.salesforce.com',
			'https://d.xxxxxxxxxxxxxx.salesforceliveagent.com/chat',
			gslbBaseURL,
			'xxxxxxxxxxxx',
			'Channel_Menu'
		);
		
	};

	if (!window.embedded_svc || !window.embedded_svc.menu) {
		var s = document.createElement('script');
		s.setAttribute('src', 'https://xxxxxxx.my.salesforce.com/embeddedservice/menu/fab.min.js');
		s.onload = function() {
			initESW(null);
		};
		document.body.appendChild(s);
	} else {
		initESW('https://service.force.com');
	}
</script>
 

After the update stopped working. An undefined object error now occurs. Investigating, I imagine that this happens because now the channel menu options are dynamic and can be changed by the client side.

Any suggestions or examples to fill in the pre-form data?

Hi,

before the spring'20 version, chat had been implemented, along with the channel menu. Everything worked perfectly. The code looked like this:
 

<script type='text/javascript' src='https://service.force.com/embeddedservice/menu/fab.min.js'></script>

<script type='text/javascript'>
	var initESW = function(gslbBaseURL) {
		embedded_svc.menu.chat.settings.prepopulatedPrechatFields = {
            FirstName: "{{fName}}",
            LastName: "{{lName}}",
            Email: "{{email}}",
            Telefone: "{{phone}}"
        };
		
		
		embedded_svc.menu.init(
			'https://xxxxxxx.my.salesforce.com',
			'https://d.xxxxxxxxxxxxxx.salesforceliveagent.com/chat',
			gslbBaseURL,
			'xxxxxxxxxxxx',
			'Channel_Menu'
		);
		
	};

	if (!window.embedded_svc || !window.embedded_svc.menu) {
		var s = document.createElement('script');
		s.setAttribute('src', 'https://xxxxxxx.my.salesforce.com/embeddedservice/menu/fab.min.js');
		s.onload = function() {
			initESW(null);
		};
		document.body.appendChild(s);
	} else {
		initESW('https://service.force.com');
	}
</script>
 

After the update stopped working. An undefined object error now occurs. Investigating, I imagine that this happens because now the channel menu options are dynamic and can be changed by the client side.

Any suggestions or examples to fill in the pre-form data?

I need to pass a list of objects to an APEX action, but are not allowed variables in the entry?
User-added image