• FinnArildFluido
  • NEWBIE
  • 30 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 7
    Replies
I have a tricky little problem. I nest a couple of components, and in the top level component I am getting an SObject with a controller which works fine:
<aura:component >
	<aura:attribute name="sob" type="MySobject__c"/>
	<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
	<h3>Checking ID: {!v.sob.Id}</h3>
	<c:mySubComponent sob="{!v.sob}"/>
</aura:component>

My sub component looks like this, and also shows the Id fine (and the Name for that matter - however I have noticed here that the capitalization of those variables actually matter - but that is another kettle of fish):

<aura:component >
	<aura:attribute name="sob" type="MySobject__c"/>
	 <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
	<h3> check out the ID shows: {!v.sob.Id}</
</aura:component>

But however, in the handler - if I try to access the same variable I can access (both before and after the handler declaration) in the controller, I get null - both if I access the sobject directly, or a value on it (which is what I want to accomplish)
 
({
	doInit : function(component, event, helper) {
		console.log('### this (and all variants of it) returns null: ' + component.get('v.sob.Id');
	}
})

If I pass a String, it shows fine - but passing a sObject only seems to display values in the component and not it's controller. Anyone?
I have been prototyping a bit in Lighting the past days, whilst also learning - but one thing I find very hard to do is something as simple as display the fields of a record like in a page layout. There is of course the force:recordview, but that shows the whole actual page layout, and in many cases you want to display a bit specific layout of a - for example - related record on a record page. I have not found anything about this in lightning and not in LDS either.

In Visualforce you would build a pageblock, pageblocksection, and pageblocksectionitem ... and suddenly you would have an uncle named Bob. But I have found no easy way to do this in Lightning (plenty of hard ones involving a LOT of tags/css, though) ...

Am I the only one with this problem? :) ...

I need to nest 3 levels of dynamic components. However I am running into a strange problem with the setting of attributes. It seems that the attributes are not set before after my dynamic component is called - this is regardless of where my dynamic component is called in the page. It only seems to be the case with a custom component calling another custom component.

 

Yeah - it's a bit complicated - behold the following code which should explain it more clearly:

 

<apex:page controller="pageController">
    <apex:dynamicComponent componentValue="comp1"/>
</apex:page>

public class pageController {
    public ApexPages.Component comp1 {
	get {
	    comp1 = new Component.c.nest1cont(oneval='MYSTRING');
	    return comp1
	}
	private set;
    }

<apex:component controller="nest1cont">
    <apex:attribute name="oneval" type="String" assignto="{!onevalue}"/>
    Even though this is called before dynamic component, this is not null: {!onevalue}
    <apex:dynamicComponent componentValue="comp2"/>
</apex:component>

public class nest1cont {
    public String onevalue {get;set;}

    public ApexPages.Component comp2 {
	get {
	    comp2 = new Component.c.nest2cont(twoval=onevalue);
	    System.debug('### problem is that this is not set before dynamicComponent is called: ' + onevalue);
	}
	private set;
    }
}

<apex:component controller="nest2cont">
    <apex:attribute name="twoval" type="String" assignto="{!twovalue}"/>
    This is null: {!twovalue}
</apex:component>

public class nest2cont {
    public String twovalue {get;set;}
}

 So you see I have a problem getting that variable all the way to the last nested component since it seems to call the dynamic component "nest2cont" before it sets the attribute "onevalue".

Is this a bug, or just a quirk of execution order? Does anyone have a workaround for it?

Hi - I have tried different setups, using simpleSAMLphp as SP and salesforce as IP, but i get redirected to something that gives me "Insufficient Privileges". I feel that I am very close if I can just figure out why I get redirected. Here's my log from simpleSAMPphp:

 

May 07 10:54:03 simplesamlphp DEBUG [f21d75a997] Session: 'default-sp' not valid because we are not authenticated.
May 07 10:54:03 simplesamlphp DEBUG [f21d75a997] Saved state: '_90ed317d1ccd2b692f0629878be311928cf57be629'
May 07 10:54:03 simplesamlphp DEBUG [f21d75a997] Sending SAML 2 AuthnRequest to 'https://finn45demo-dev-ed.my.salesforce.com'
May 07 10:54:03 simplesamlphp DEBUG [f21d75a997] Sending message:
May 07 10:54:03 simplesamlphp DEBUG [f21d75a997] <samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_90ed317d1ccd2b692f0629878be311928cf57be629" Version="2.0" IssueInstant="2013-05-07T08:54:03Z" Destination="https://finn45demo-dev-ed.my.salesforce.com/idp/endpoint/HttpPost" AssertionConsumerServiceURL="http://saml.finnarild.com/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST">
May 07 10:54:03 simplesamlphp DEBUG [f21d75a997]   <saml:Issuer>https://finn45demo-dev-ed.my.salesforce.com</saml:Issuer>
May 07 10:54:03 simplesamlphp DEBUG [f21d75a997]   <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" AllowCreate="true"/>
May 07 10:54:03 simplesamlphp DEBUG [f21d75a997] </samlp:AuthnRequest>
May 07 10:54:03 simplesamlphp DEBUG [f21d75a997] Redirect to 743 byte URL: https://finn45demo-dev-ed.my.salesforce.com/idp/endpoint/HttpPost?SAMLRequest=lZJbaxsxEIX%2FyqL3Xe2u49gWtsGNKTHksthuH%2FpSZGm2FuhWjZTLv4%2B8m0L60ECfBEfznZk5zBK50Z5tUjzbPfxOgLF4MdoiGz5WJAXLHEeFzHIDyKJgh839HWurmvngohNOkw%2FI5wRHhBCVs6TYbVfk56IGOWlmshFCtqfrRdvX1%2B1iPpufYNI0i3Yu%2BunsBFkjxXcImMkVyUYZR0ywsxi5jVmqm0lZT8t6dqznbHrF6skPUmzzNsryOFDnGD0ySntl7dVUgnGlhKcSZGVeK%2BQasHdBQCWcoUp6ClZ6p2yktxnsHEZSbP5Mf%2BMsJgPhAOFJCfi2vxv9s%2F0lg%2BrSgwel5eCGyvhsnz%2BocTJpqPzZD4UUx7ctucBBldDzpGOJnhTde7xflJXK%2Fvo82dNYhOz2eOzK7vFwJOvlxZsNSYX1f%2By%2FpB%2FB5XgiD7nlbts5rcRr8dUFw%2BO%2FJ2qqZlCULPuhlCWLHoTqFcgcpNbu%2BSYAj7AiMSQgdD02%2FfsU128%3D&RelayState=http%3A%2F%2Fsaml.finnarild.com%2Fsimplesaml%2Fmodule.php%2Fcore%2Fauthenticate.php%3Fas%3Ddefault-sp

 

Can anyone with an eye see what's wrong - or point me to a configuration that has already this set up? Thanks, Finn Arild.

 

I am sometimes amazed how a seemingly simple thing is some times made unneccessary difficult. Say you want to start a Live Agent session and have an input field to type an email address in right away without bothering the user with a pre-chat form. Should be as simple as the following code, right?: 

 

<html>
    <head>
	<!-- THIS NEEDS TO BE INCLUDED FOR EVERYTHING TO WORK -->
	<script type='text/javascript' src='https://c.la1c1.salesforceliveagent.com/content/g/deployment.js'></script>
	<script type='text/javascript'>
	liveagent.init('https://d.la1c1.salesforceliveagent.com/chat', '572D0000000011K', '00DD0000000oGsq');
	</script>
	<!-- END INCLUDE -->
    </head>
    <body>
	<!-- THIS IS JUST THE HEADER OF THE PAGE -->
	<h1>Chat med en kundebehandler!</h1>
	
	<!-- HERES THE BUTTON CODE FROM SF. ADD CONTENT WHERE THE COMMENT IS -->
	<div id="liveagent_button_online_573D0000000016a" style="display: none;" >
	    <input type="text" name="email" id="chatter_email" onBlur="emailUpdate()"/><br/>
	    <a href="javascript&colon;//Chat" onclick="liveagent.startChat('573D0000000016a')">Fyll inn din e-post og trykk her for å chatte</a>
	</div>
	<div id="liveagent_button_offline_573D0000000016a" style="display: none;">Kundebehandler offline</div>
	<script type="text/javascript">
	    if (!window._laq) { window._laq = []; }
	    window._laq.push(function()
		{liveagent.showWhenOnline('573D0000000016a', document.getElementById('liveagent_button_online_573D0000000016a'));
		liveagent.showWhenOffline('573D0000000016a', document.getElementById('liveagent_button_offline_573D0000000016a'));
	    });
	    function emailUpdate() {
		liveagent.addCustomDetail('Contact E-Mail', document.getElementById('chatter_email').value).map('Contact', 'Email', true, true, false);
		
	    }
	</script>
	<!-- END OF BUTTON CODE -->
    </body>
</html>

 But no - you get a javascript exception: "you cannot add a detail after page initialization".

 

In practice this means that you can add whatever you like before you load the page, but if you want the user to input something - you're ... toast (that was not the word I wanted to use, so I leave that up to your imagination). 

 

Stuff like that irritates me like a red hot poker up the butt.

 

Thanks for listening :) ...

I created some pages. Then I created another template and wanted to assign those to the new template I created. It actually seems not to be possible, but I can't believe site.com can suck that bad - so - anyone know how to do a simple thing like that?

This should not be confused with my previous message related to the pre-chat form.

 

In the post chat form of Live Agent, the developer documentation provides an example of how to spit out some values about the chat (like that would be even remotely interesting to the customer) and at the end there's the fantastically unhelpful comment: <!-- Implement your post-chat message, form, or survey here -->

 

Nowhere does it say how I can get hold of the transcript object to store the values. I just want to implement a simple customer satisfaction form in the post-chat.

 

Does anyone have any pointers or examples of how this can be accomplished? 

 

Thanks, Finn Arild.

A customer of ours wants to have a field filled in from the user in the pre-chat form stored to the transcript. I get the field in fine, but it isn't stored to the Live Chat Transcript object I have tried several things but it just don't want to stick. Below is my current pre-chat form. The custom field I want to have saved to is (obviously) subject__c- does someone know a way to do this?

 

<apex:page showHeader="false"> 
<!-- This script takes the endpoint URL parameter passed from the deployment page and makes it the action for the form -->
<script type="text/javascript">
     (function() { 
     function handlePageLoad() {
       var endpointMatcher = new RegExp("[\\?\\&]endpoint=([^&#]*)");
       document.getElementById("prechatForm").setAttribute("action",
       decodeURIComponent(endpointMatcher.exec(document.location.search)[1]));
     } if (window.addEventListener) {
              window.addEventListener("load", handlePageLoad, false);
   } else { window.attachEvent("onload", handlePageLoad, false);
              }})(); 
</script>
<h1>Pre-chat Form</h1> 
<form method="post" id="prechatForm"> 
      Mitt telefonnummer: <br />
<input type="text" name="liveagent.prechat:phone" /><br /> 
      Mitt kundenummer: <br />
<input type="text" name="liveagent.prechat:kundeident" /><br /> 
      Min henvendelse gjelder: <br />
<input type="text" name="liveagent.prechat:subject" id="prechat_field" /><br /> <br />
      
      
      <!-- Creates an auto-query for a matching Contact records Email field based on the 
      value of the liveagent.prechat:Email field -->    
      <input type="hidden" name="liveagent.prechat.query:phone" 
      value="Account,Account.Phone" /> 
      <input type="hidden" name="liveagent.prechat.query:kundeident" 
      value="Account,Account.Email" /> 
      <input type="hidden" name="liveagent.prechat.save:subject" value="LiveChatTranscript, LiveChatTranscript.subject__c" /> 
      <input type="submit" value="Request Chat" id="prechat_submit"/> 
<style type="text/css"> 
p {font-weight: bolder } 
</style> 
</form> 
</apex:page>

 

I am sometimes amazed how a seemingly simple thing is some times made unneccessary difficult. Say you want to start a Live Agent session and have an input field to type an email address in right away without bothering the user with a pre-chat form. Should be as simple as the following code, right?: 

 

<html>
    <head>
	<!-- THIS NEEDS TO BE INCLUDED FOR EVERYTHING TO WORK -->
	<script type='text/javascript' src='https://c.la1c1.salesforceliveagent.com/content/g/deployment.js'></script>
	<script type='text/javascript'>
	liveagent.init('https://d.la1c1.salesforceliveagent.com/chat', '572D0000000011K', '00DD0000000oGsq');
	</script>
	<!-- END INCLUDE -->
    </head>
    <body>
	<!-- THIS IS JUST THE HEADER OF THE PAGE -->
	<h1>Chat med en kundebehandler!</h1>
	
	<!-- HERES THE BUTTON CODE FROM SF. ADD CONTENT WHERE THE COMMENT IS -->
	<div id="liveagent_button_online_573D0000000016a" style="display: none;" >
	    <input type="text" name="email" id="chatter_email" onBlur="emailUpdate()"/><br/>
	    <a href="javascript&colon;//Chat" onclick="liveagent.startChat('573D0000000016a')">Fyll inn din e-post og trykk her for å chatte</a>
	</div>
	<div id="liveagent_button_offline_573D0000000016a" style="display: none;">Kundebehandler offline</div>
	<script type="text/javascript">
	    if (!window._laq) { window._laq = []; }
	    window._laq.push(function()
		{liveagent.showWhenOnline('573D0000000016a', document.getElementById('liveagent_button_online_573D0000000016a'));
		liveagent.showWhenOffline('573D0000000016a', document.getElementById('liveagent_button_offline_573D0000000016a'));
	    });
	    function emailUpdate() {
		liveagent.addCustomDetail('Contact E-Mail', document.getElementById('chatter_email').value).map('Contact', 'Email', true, true, false);
		
	    }
	</script>
	<!-- END OF BUTTON CODE -->
    </body>
</html>

 But no - you get a javascript exception: "you cannot add a detail after page initialization".

 

In practice this means that you can add whatever you like before you load the page, but if you want the user to input something - you're ... toast (that was not the word I wanted to use, so I leave that up to your imagination). 

 

Stuff like that irritates me like a red hot poker up the butt.

 

Thanks for listening :) ...

I have a tricky little problem. I nest a couple of components, and in the top level component I am getting an SObject with a controller which works fine:
<aura:component >
	<aura:attribute name="sob" type="MySobject__c"/>
	<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
	<h3>Checking ID: {!v.sob.Id}</h3>
	<c:mySubComponent sob="{!v.sob}"/>
</aura:component>

My sub component looks like this, and also shows the Id fine (and the Name for that matter - however I have noticed here that the capitalization of those variables actually matter - but that is another kettle of fish):

<aura:component >
	<aura:attribute name="sob" type="MySobject__c"/>
	 <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
	<h3> check out the ID shows: {!v.sob.Id}</
</aura:component>

But however, in the handler - if I try to access the same variable I can access (both before and after the handler declaration) in the controller, I get null - both if I access the sobject directly, or a value on it (which is what I want to accomplish)
 
({
	doInit : function(component, event, helper) {
		console.log('### this (and all variants of it) returns null: ' + component.get('v.sob.Id');
	}
})

If I pass a String, it shows fine - but passing a sObject only seems to display values in the component and not it's controller. Anyone?
Receiving this error when editing a visualforce page in sandbox through developer console or third party IDE.  This page has been working in production for some time. Both page and controller are set to version 32 in sandbox and production. 
The page can be edited directly through Develop->Pages.

Here's a very simplified version of the page which produces the error
 
<apex:page standardController="User" extensions="SalesRepGoalController2"> 

<b>Hello World!</b>
</apex:page>
and controller
 
public with sharing class SalesRepGoalController2{
private String userID = '' ; 	
public SalesRepGoalController2(ApexPages.StandardController c)
	{
		userID = c.getId(); 
	}
}

Java 1.7 was installed, but has been uninstalled.

Windows 8 Enterprise,  64bit
IE 10
JRE none

 
  • July 20, 2015
  • Like
  • 1

In our deployment we are using an authenticated site for users to login to for support. This is all setup and running on the force.com platform using SSO and a force.com site. When a user logs in they gain the ability to chat with support. As a logged in user we are already aware of the users account and contact because they are automatically generated in the production ORG and with SSO they grant the right for us to pull this information from their ORG to create a contact and account in our ORG. When a user inititates a live agent chat there are fields called "Related Entities" that I would like to prepopulate to save the agent time from having to look up the records. I would think this would be feasiable given we already have this information from the authenticated user. Does anyone know how I can I prepopulate these fields?

This should not be confused with my previous message related to the pre-chat form.

 

In the post chat form of Live Agent, the developer documentation provides an example of how to spit out some values about the chat (like that would be even remotely interesting to the customer) and at the end there's the fantastically unhelpful comment: <!-- Implement your post-chat message, form, or survey here -->

 

Nowhere does it say how I can get hold of the transcript object to store the values. I just want to implement a simple customer satisfaction form in the post-chat.

 

Does anyone have any pointers or examples of how this can be accomplished? 

 

Thanks, Finn Arild.