• Alexander Berehovskiy
  • 0 Points
  • Member since 2015

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2
I am calling standard email page from a custom object (related to the Case)  and trying to get the return to go back to the Case. This works OK in standard ui and in the console if you complete the dialog, but if you cancel in the Email  it does not return to the case in the console, but does in standard ui..   The console seems to just ignore the retURL on "cancel" of the email page and goes back to the prior tab..   

   public PageReference saveAllAndEmail() { 
        //returns the standard Email ui, the retURL points back to the case when that is done..  
        PageReference pageRef = new PageReference('/_ui/core/email/author/EmailAuthor?retURL=%2F' + pageCase.Id + '&rtype=003&p3_lkid=' + pageCase.Id + '&p2_lkid='  + MyContactId );
        return pageRef;  } 


 <apex:commandButton action="{!saveAllAndEmail}" value="Save And Email" reRender="foo"/>

Hello all,

I'm stuck with the Lightning challenge "Using Apex in Components" :

here is the component :
<aura:component controller="DisplayCaseController">
	<aura:attribute name="record" type="Case[]"/>

    <aura:iteration items="{!v.record}" var="c">
	    {!c.Subject}, {!c.Description}, {!c.Subject}, {!c.Status }
the component controller :
    getRecord: function(cmp){
        var action = cmp.get("c.getCaseFromId");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                cmp.set("v.record", response.getReturnValue());
and the apex controller (provided for the challenge)
public class DisplayCaseController {
    public static Case getCaseFromId(Id caseID) {
        if(caseID == null) {
            return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
            List<Case> cases = [ SELECT Id, Subject, Description, Status from CASE where ID = :caseID ];
            if(cases.size() == 0) {
                return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
            } else {
                return cases[0];
and still when hitting the Check challenge button, the following error is displayed :
"Challenge not yet complete... here's what's wrong:
The component is not binding to the Case Subject value "

Could you please advise ?
Thanks a lot!