• Iswarya Sekar
  • NEWBIE
  • 30 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 12
    Replies
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: PPIHOVJD

I created new trailhead playgrounds, but i couldn,t complete the chanllenge. anyone help me..
<apex:page standardController="CPL_Protocols__c" renderAs="pdf" applyBodyTag="false" docType="html-5.0" standardStylesheets="false" applyHtmlTag="false" extensions="PrintPageController" showHeader="false">
    
    <apex:form >
        <apex:pageBlock title="CPL Request Information Detail">  
            <br></br>
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left" >
            <apex:pageBlockSection title="Status" columns="1">
                
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.OwnerId}"/></table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Protocol_Number__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Approval_Step_Status__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Status_Date_Time_Stamp__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Protocol_Status__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labels_Due_Date__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Number_of_Labels_to_Printed__c}"/> </table> 
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Contact__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.user_email__c}"/>  </table>
            </apex:pageBlockSection>
        </table>
    </apex:pageBlock>
    
    <apex:pageblock >
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left" >
            <apex:pageBlockSection title="Study Information" columns="2" >
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Name}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Number_of_Study_Sites__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Type__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Treatment_Period__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Country__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Phase__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Protocol_Description__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.No_of_Treatment_Grp__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Enrollment_Period__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Duration__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Dosing_Regimen__c}"/>  
            </apex:pageBlockSection>
        </table>
    </apex:pageblock>
    
    
    <apex:pageblock >
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left" >
            <apex:pageBlockSection title="Product Information" columns="2">
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Primary_Packaging__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Secondary_Packaging__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Label_Information__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labeling_Lot_Number__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Storage_Requirements__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Max_Exposure_Time__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Label_Expiration_Date__c}"/>   
            </apex:pageBlockSection>
        </table>
    </apex:pageblock>
    
    <apex:pageblock >
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left">
            <apex:pageBlockSection title="Packaging/Labeling Operation" columns="2" >
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Packaging_Site__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labeling_Site__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Quantity_Required__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Sampling_Requirements__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.CreatedById}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labeling_Package_Instructions__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Calculated_Qty_to_be_Prepared__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Randomization__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Randomization_File_Acknowledgement__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.LastModifiedById}"/>   
            </apex:pageBlockSection>
        </table>
    </apex:pageblock>
    
</apex:form>

<apex:relatedList list="Parts__r" /> <br></br>
<apex:relatedList subject="{!CPL_Protocols__c}" list="Histories" /> 
<apex:relatedList subject="{!CPL_Protocols__c}" list="ProcessSteps" /> 

<apex:relatedList subject="{!CPL_Protocols__c}" list="ActivityHistories" /> 
<apex:relatedList subject="{!CPL_Protocols__c}" list="OpenActivities" /> 
<apex:relatedList subject="{!CPL_Protocols__c}" list="AttachedContentDocuments" />

</apex:page>

 
public class UpdateUser {
    Public static void method1(List<case> caseList){
        set<id> parentcaseId = new set<Id>();
        for(case cs:caseList){
            if(cs.Defect__c != null){
                parentcaseId.add(cs.Defect__c);
            }
        }
        
        List<Case> caseslistold = [SELECT Id, OwnerId FROM Case WHERE Id in : parentcaseId];
        for(Id csIdtoUpdate:parentcaseId){
            for(Case cas:caseslistold){
                for(case cs:caseList){
                    cs.Product_Lead__c=cas.ownerId;
                }
            }
        }
    }
}
 
trigger updateUsertrig on Case (before insert, before Update) {
    if((trigger.isInsert && trigger.isBefore) || (trigger.isUpdate && trigger.isBefore))
UpdateUser.method1(trigger.new);
}

 
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="dispalyAccountscontroller">
    
    <aura:handler name="init" value="{!this}" action="{!c.myAction}"/>
    <aura:attribute name="accounts" type="List" /> 
    
    <table class="slds-table slds-table--bordered slds-table--striped slds-table--cell-buffer slds-table--fixed-layout">
        <tr class="slds-text-heading--label">
            
            <th scope="col"><div class="slds-truncate" title="name">Name</div>  </th>
            <th scope="col"><div class="slds-truncate" title="industry">Industry</div></th>
            <th scope="col"><div class="slds-truncate" title="contacts">Contacts</div> </th>
            
        </tr>
        
        <aura:iteration items="{!v.accounts}" var="accs1" >
            
            <tr>  
                <th><div class="slds-truncate" title="{!accs1.Name}"><a href="javascript:void(0);">{!accs1.Name}</a></div>   </th>
                <th> <div class="slds-truncate" title="{!accs1.Industry}">{!accs1.Industry}</div>  </th>
                
                <table>
                    <aura:iteration items="{!accs1.Contacts}" var="con1" >
                        <tr>
                            <th><div class="slds-truncate" title="{!con1.LastName}">{!con1.LastName}</div></th>
                        </tr>
                    </aura:iteration>
                </table>
            </tr> 
            
        </aura:iteration> 
        
    </table>    
</aura:component>

Please help me to achieve this!!
global class scheduledBatchable implements Schedulable {
    
    global void execute(SchedulableContext sc) {
        
        Messaging.SingleEmailMessage msg = new Messaging.SingleEmailMessage();
        Case cs = [SELECT id, CLOSED__c, Status FROM Case WHERE CLOSED__C=TRUE];
        
        EmailTemplate template = [SELECT id,Name, DeveloperName, OwnerId FROM EmailTemplate WHERE DeveloperName = 'P1_Followup_Remainder'];
        msg.setTemplateId(template.Id);
        msg.setSenderDisplayName('is@gmail.com');
        msg.setTargetObjectId(cs.Id);
        msg.setSaveAsActivity(false);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { msg });
        
    } 
    
   }

I'm not getting any email notifications. what's wrong in my code?
<apex:page standardController="Case" extensions="newClass" showHeader="false" >
    <apex:form >
        <apex:pageBlock title="Case Status">
            <apex:pageBlockSection columns="1">
                <apex:inputField value="{!Case.Status}"/>
                <apex:inputField value="{!Case.Reason}"/>
                <apex:inputField value="{!Case.Priority}"/>
            </apex:pageBlockSection>
            <div>
                <apex:commandButton action="{!redirectToMyVF}" value="CloseCase"/>
            </div>
        </apex:pageBlock>
    </apex:form>
</apex:page>

My page1


<apex:page standardController="Case" extensions="Displayrecord" showHeader="false" >
    <apex:form >
        <apex:pageBlock title="Case Status">
            <apex:pageBlockSection columns="1">
                <apex:inputField value="{!Case.Status}"/>
                <apex:inputField value="{!Case.Reason}"/>
                <apex:inputField value="{!Case.Priority}"/>
            </apex:pageBlockSection>
            <apex:pageBlockButtons>
                <apex:commandButton action="{!save}" value="Save"/> 
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

My page 2


public class newClass {
    public newClass (ApexPages.StandardController Cases) {
    }
    public PageReference redirectToMyVF() {
        PageReference pref = new PageReference('/apex/Page');
        pref.setRedirect(true);
        return pref;
    }
    public PageReference save() {  
        try{
            update this.Cases;
        }catch(exception e){
        }
        PageReference page = new Pagereference('/apex/Case_page?Id='+Case.Id);
        page.setRedirect(true);
        return page;
    }
    
}

my apex class

Please help me
<apex:page standardController="CPL_Protocols__c" renderAs="pdf" applyBodyTag="false" docType="html-5.0" standardStylesheets="false" applyHtmlTag="false" extensions="PrintPageController" showHeader="false">
    
    <apex:form >
        <apex:pageBlock title="CPL Request Information Detail">  
            <br></br>
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left" >
            <apex:pageBlockSection title="Status" columns="1">
                
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.OwnerId}"/></table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Protocol_Number__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Approval_Step_Status__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Status_Date_Time_Stamp__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Protocol_Status__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labels_Due_Date__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Number_of_Labels_to_Printed__c}"/> </table> 
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Contact__c}"/> </table>
                <table> <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.user_email__c}"/>  </table>
            </apex:pageBlockSection>
        </table>
    </apex:pageBlock>
    
    <apex:pageblock >
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left" >
            <apex:pageBlockSection title="Study Information" columns="2" >
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Name}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Number_of_Study_Sites__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Type__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Treatment_Period__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Country__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Phase__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Protocol_Description__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.No_of_Treatment_Grp__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Enrollment_Period__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Study_Duration__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Dosing_Regimen__c}"/>  
            </apex:pageBlockSection>
        </table>
    </apex:pageblock>
    
    
    <apex:pageblock >
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left" >
            <apex:pageBlockSection title="Product Information" columns="2">
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Primary_Packaging__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Secondary_Packaging__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Label_Information__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labeling_Lot_Number__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Storage_Requirements__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Max_Exposure_Time__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Label_Expiration_Date__c}"/>   
            </apex:pageBlockSection>
        </table>
    </apex:pageblock>
    
    <apex:pageblock >
        <table width="60%" cellspacing="0" cellpadding="0" border="0" align="left">
            <apex:pageBlockSection title="Packaging/Labeling Operation" columns="2" >
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Packaging_Site__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labeling_Site__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Quantity_Required__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Sampling_Requirements__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.CreatedById}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Labeling_Package_Instructions__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Calculated_Qty_to_be_Prepared__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Randomization__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.Randomization_File_Acknowledgement__c}"/> 
                <apex:outputfield style="width:150px;height:25px; background:#B4C3D1;" value="{!CPL_Protocols__c.LastModifiedById}"/>   
            </apex:pageBlockSection>
        </table>
    </apex:pageblock>
    
</apex:form>

<apex:relatedList list="Parts__r" /> <br></br>
<apex:relatedList subject="{!CPL_Protocols__c}" list="Histories" /> 
<apex:relatedList subject="{!CPL_Protocols__c}" list="ProcessSteps" /> 

<apex:relatedList subject="{!CPL_Protocols__c}" list="ActivityHistories" /> 
<apex:relatedList subject="{!CPL_Protocols__c}" list="OpenActivities" /> 
<apex:relatedList subject="{!CPL_Protocols__c}" list="AttachedContentDocuments" />

</apex:page>

 
public class UpdateUser {
    Public static void method1(List<case> caseList){
        set<id> parentcaseId = new set<Id>();
        for(case cs:caseList){
            if(cs.Defect__c != null){
                parentcaseId.add(cs.Defect__c);
            }
        }
        
        List<Case> caseslistold = [SELECT Id, OwnerId FROM Case WHERE Id in : parentcaseId];
        for(Id csIdtoUpdate:parentcaseId){
            for(Case cas:caseslistold){
                for(case cs:caseList){
                    cs.Product_Lead__c=cas.ownerId;
                }
            }
        }
    }
}
 
trigger updateUsertrig on Case (before insert, before Update) {
    if((trigger.isInsert && trigger.isBefore) || (trigger.isUpdate && trigger.isBefore))
UpdateUser.method1(trigger.new);
}

 
<apex:page standardController="Case" showHeader="false" >
    <apex:form >
        <apex:pageBlock title="Case Status">
            <apex:pageBlockSection columns="1">
                <apex:inputField value="{!Case.Status}"/>
                <apex:inputField value="{!Case.Reason}"/>
                <apex:inputField value="{!Case.Priority}"/>
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="save"/> 
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

when giving reason and status for the case object and saving it. this saved record should be displayed in another new VF page
<apex:page standardController="Case" extensions="newClass" showHeader="false" >
    <apex:form >
        <apex:pageBlock title="Case Status">
            <apex:pageBlockSection columns="1">
                <apex:inputField value="{!Case.Status}"/>
                <apex:inputField value="{!Case.Reason}"/>
                <apex:inputField value="{!Case.Priority}"/>
            </apex:pageBlockSection>
            <div>
                <apex:commandButton action="{!redirectToMyVF}" value="CloseCase"/>
            </div>
        </apex:pageBlock>
    </apex:form>
</apex:page>

My page1


<apex:page standardController="Case" extensions="Displayrecord" showHeader="false" >
    <apex:form >
        <apex:pageBlock title="Case Status">
            <apex:pageBlockSection columns="1">
                <apex:inputField value="{!Case.Status}"/>
                <apex:inputField value="{!Case.Reason}"/>
                <apex:inputField value="{!Case.Priority}"/>
            </apex:pageBlockSection>
            <apex:pageBlockButtons>
                <apex:commandButton action="{!save}" value="Save"/> 
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

My page 2


public class newClass {
    public newClass (ApexPages.StandardController Cases) {
    }
    public PageReference redirectToMyVF() {
        PageReference pref = new PageReference('/apex/Page');
        pref.setRedirect(true);
        return pref;
    }
    public PageReference save() {  
        try{
            update this.Cases;
        }catch(exception e){
        }
        PageReference page = new Pagereference('/apex/Case_page?Id='+Case.Id);
        page.setRedirect(true);
        return page;
    }
    
}

my apex class

Please help me