• Tabrez Ansari 14
  • NEWBIE
  • 12 Points
  • Member since 2014
  • Salesforce Developer
  • Techila Solutions Pvt. Ltd.

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
once my record is submitted for approval, I enqueue time-dependent actions, send email alert & create a Task.
I'm using Process Builder to do the above.
My Template as Follows
<messaging:emailTemplate recipientType="Contact" relatedToType="Demo_Equipment_Request__c" subject="REMINDER...!! Demo Equipment Request {!relatedTo.Name} Pending Approval">
    <messaging:htmlEmailBody >        
        <html>
            <body>
                <STYLE type="text/css">
                    P {font-size: 16px; font-family: arial; max-width:650px }
                    DIV {font-size: 14px; font-family:arial; max-width:650px}
                    TH {font-size: 16px; font-family: arial;background: #CCCCCC; border-width: 1;  text-align: center; width: 120px } 
                    TD  {font-size: 14px; font-family: verdana } 
                    TABLE {border: solid #CCCCCC; border-width: 0}
                    TR {border: solid #CCCCCC; border-width: 0}
                </STYLE>

                <div style="text-align:right" ><apex:image value="https://c.na16.content.force.com/servlet/servlet.ImageServer?id=015f1000002vlRm&oid=00Dj0000001tVXM" height="50"/></div>
                
                <p>Dear Approver</p>
                <p>Your approval is pending for the following request.<br/>
                Kindly approve.</p>
                
                <p>Demo Request : &nbsp; <apex:outputlink value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+relatedTo.Id}">{!relatedTo.Name}</apex:outputlink></p>
                
                <p><c:Email_Signature /></p>

                <p>Product(s) requested:</p>

                <table border="0" >
                    <tr>
                        <th width="30%">Product</th>
                        <th width="30%">Product Description</th>
                    </tr>                 
                    <apex:repeat var="prod" value="{!relatedTo.Demo_Products__r}">
                        <tr>
                            <td>{!prod.Display_Product__c}</td>
                            <!--<td>{!prod.Product__r.Description}</td>-->
                        </tr>
                    </apex:repeat>
                </table>
            </body>
        </html>
    </messaging:htmlEmailBody> 
</messaging:emailTemplate>
I get the following Error on execution.
47.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;NBA,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WAVE,INFO;WORKFLOW,INFO
21:32:59.0 (519336)|USER_INFO|[EXTERNAL]|0056g000000FK1u|tabreza@cybage.com|(GMT-08:00) Pacific Standard Time (America/Los_Angeles)|GMT-08:00
21:32:59.0 (301773462)|FLOW_ELEMENT_ERROR|We were unable to process the email template.
 Error Message: core.email.template.TemplateRenderingException: java.lang.IllegalStateException: You cannot ask for this if the context hasn't been established
|FlowActionCall|myWaitEvent_myWait_myRule_12_event_0_SA1
21:32:59.951 (951419199)|CODE_UNIT_STARTED|[EXTERNAL]|EventService:BatchApexErrorEvent
21:32:59.951 (968867599)|CODE_UNIT_FINISHED|EventService:BatchApexErrorEvent
21:32:59.970 (970576275)|CODE_UNIT_STARTED|[EXTERNAL]|EventService:FlowExecutionErrorEvent
21:32:59.970 (975281800)|CODE_UNIT_FINISHED|EventService:FlowExecutionErrorEvent
21:32:59.976 (976826046)|CODE_UNIT_STARTED|[EXTERNAL]|EventService:PlatformStatusAlertEvent
21:32:59.976 (980991812)|CODE_UNIT_FINISHED|EventService:PlatformStatusAlertEvent
21:33:00.27 (1027519590)|USER_INFO|[EXTERNAL]|0056g000000FK1u|tabreza@cybage.com|(GMT-08:00) Pacific Standard Time (America/Los_Angeles)|GMT-08:00
21:33:00.27 (1027542613)|EXECUTION_STARTED
21:33:00.27 (1027549036)|CODE_UNIT_STARTED|[EXTERNAL]|EventService:BatchApexErrorEvent
21:33:00.27 (1031813321)|CODE_UNIT_FINISHED|EventService:BatchApexErrorEvent
21:33:00.27 (1033024784)|EXECUTION_FINISHED
21:33:00.34 (1034705907)|USER_INFO|[EXTERNAL]|0056g000000FK1u|tabreza@cybage.com|(GMT-08:00) Pacific Standard Time (America/Los_Angeles)|GMT-08:00
21:33:00.34 (1034728397)|EXECUTION_STARTED
21:33:00.34 (1034734081)|CODE_UNIT_STARTED|[EXTERNAL]|EventService:FlowExecutionErrorEvent
21:33:00.34 (1038553061)|CODE_UNIT_FINISHED|EventService:FlowExecutionErrorEvent
21:33:00.34 (1039751379)|EXECUTION_FINISHED
21:33:00.41 (1041362712)|USER_INFO|[EXTERNAL]|0056g000000FK1u|tabreza@cybage.com|(GMT-08:00) Pacific Standard Time (America/Los_Angeles)|GMT-08:00
21:33:00.41 (1041381874)|EXECUTION_STARTED
21:33:00.41 (1041386902)|CODE_UNIT_STARTED|[EXTERNAL]|EventService:PlatformStatusAlertEvent
21:33:00.41 (1045299052)|CODE_UNIT_FINISHED|EventService:PlatformStatusAlertEvent
21:33:00.41 (1046804143)|EXECUTION_FINISHED
Please Assist.
Task is
"In this challenge, you set up the external sharing model, create a sharing set, and create a customer community user. First, set up the external sharing model with Case set to private. Then, enable Customer Portal settings, and create a sharing set titled Share cases with customers for the Customer Community User Profile. In this sharing set, grant customer community users read and write access to the case object for all cases associated with their account.

Ensure that your DE org user has a role assigned.
Create a customer community user from Edna Frank's contact record. (Your DE org should already have a contact record for Edna Frank. If it doesn't, create a new contact with first name Edna and last name Frank.)
Ensure that the account associated with Edna Frank has cases associated with it.
Ensure that sharing set mapping is set to User:Account = Case:Account."


I enabled the community, created a community user of edna frank but i'm not able to understand how to set role.
The role picklist is grayed out.
Pleae assist.
Task is
"In this challenge, you set up the external sharing model, create a sharing set, and create a customer community user. First, set up the external sharing model with Case set to private. Then, enable Customer Portal settings, and create a sharing set titled Share cases with customers for the Customer Community User Profile. In this sharing set, grant customer community users read and write access to the case object for all cases associated with their account.

Ensure that your DE org user has a role assigned.
Create a customer community user from Edna Frank's contact record. (Your DE org should already have a contact record for Edna Frank. If it doesn't, create a new contact with first name Edna and last name Frank.)
Ensure that the account associated with Edna Frank has cases associated with it.
Ensure that sharing set mapping is set to User:Account = Case:Account."


I enabled the community, created a community user of edna frank but i'm not able to understand how to set role.
The role picklist is grayed out.
Pleae assist.
Greetings:

I have been trying to do check the challenge of the the first part of the "Apex Basics & Database" module. I have been restructuring my apex code but nothing seems to work. This is the error that I'm getting:
User-added image