• Toyetoyetoye
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies

 

Hello...I consolidated 6 plain text email templates into 1 using conditional mark up (CASE) thus rendering the appropriate phrasing for the particular instance of the email. This worked like a charm and enabled me to have one CommandButton on a related VisualForce page instead of the 6 I had previously had.
Unfortunately the client made a follow up request: consolidate two of them further into one email but with much less content. On the surface it didn’t sound like too much work until I realized the only way to still use the same template was to obscure whole sections of text for this final scenario.
 
Below is a snippet of what I’ve been testing in the plain text template:

 
{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “START OF TEST”, “START OF TEST”)}
{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “”, “Please pay special attention to instructions below.”)}

{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “”, “Instructions:”)}
{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “”, “In lieu of a tire blow out, keep your ipad strapped in with a seat belt. Rear seating is always preferable for an ipad. But enough about Pat Metheny.”)}
{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “END OF TEST”, “END OF TEST”)}

 

The above code renders great for records that are not flagged “FIRST APPOINTMENT” e.g

START OF TEST
Please pay special attention to instructions below.

Instructions:
In lieu of a tire blow out, keep your ipad strapped in with a seat belt. Rear seating is always preferable for an ipad. But enough about Pat Metheny.
END OF TEST

But it literally puts white spaces for records that are flagged "FIRST APPOINTMENT", so they render as:
 
START OF TEST
 
 
 
 
END OF TEST

 
I am looking for a way to completely collapse white space as 75% of the template ends up rendering as white space for the FIRST APPOINTMENT scenario.
 
I also tested the following:
 
 
{!IF(ISPICKVAL(Session__c.Email_Notification__c , "FIRST APPOINTMENT"), "random1", NULL)}
{!IF(ISPICKVAL(Session__c.Email_Notification__c , "FIRST APPOINTMENT"), NULL, "random2")}
{!IF(ISPICKVAL(Session__c.Email_Notification__c , "FIRST APPOINTMENT"), "random3", NULL)}

The code above renders as:

 
random1
 
random 3

 
Suggestions greatly appreciated!

 

Working on a trigger/query to populate a field on a Case with a ContactRole's parent Acct name. Anybody using something similar.

 

Thanks

I'm trying out EventForce from the AppExchange. Can the events be synchronized with the Salesforce calendar? After creating events how can they be viewed graphically and shared? Can notifications be sent to attendees for a Session?

 

Hello...I consolidated 6 plain text email templates into 1 using conditional mark up (CASE) thus rendering the appropriate phrasing for the particular instance of the email. This worked like a charm and enabled me to have one CommandButton on a related VisualForce page instead of the 6 I had previously had.
Unfortunately the client made a follow up request: consolidate two of them further into one email but with much less content. On the surface it didn’t sound like too much work until I realized the only way to still use the same template was to obscure whole sections of text for this final scenario.
 
Below is a snippet of what I’ve been testing in the plain text template:

 
{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “START OF TEST”, “START OF TEST”)}
{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “”, “Please pay special attention to instructions below.”)}

{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “”, “Instructions:”)}
{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “”, “In lieu of a tire blow out, keep your ipad strapped in with a seat belt. Rear seating is always preferable for an ipad. But enough about Pat Metheny.”)}
{!CASE(Session__c.Email_Notification__c, "FIRST APPOINTMENT", “END OF TEST”, “END OF TEST”)}

 

The above code renders great for records that are not flagged “FIRST APPOINTMENT” e.g

START OF TEST
Please pay special attention to instructions below.

Instructions:
In lieu of a tire blow out, keep your ipad strapped in with a seat belt. Rear seating is always preferable for an ipad. But enough about Pat Metheny.
END OF TEST

But it literally puts white spaces for records that are flagged "FIRST APPOINTMENT", so they render as:
 
START OF TEST
 
 
 
 
END OF TEST

 
I am looking for a way to completely collapse white space as 75% of the template ends up rendering as white space for the FIRST APPOINTMENT scenario.
 
I also tested the following:
 
 
{!IF(ISPICKVAL(Session__c.Email_Notification__c , "FIRST APPOINTMENT"), "random1", NULL)}
{!IF(ISPICKVAL(Session__c.Email_Notification__c , "FIRST APPOINTMENT"), NULL, "random2")}
{!IF(ISPICKVAL(Session__c.Email_Notification__c , "FIRST APPOINTMENT"), "random3", NULL)}

The code above renders as:

 
random1
 
random 3

 
Suggestions greatly appreciated!

 

Working on a trigger/query to populate a field on a Case with a ContactRole's parent Acct name. Anybody using something similar.

 

Thanks

Hi,

 

   i'm new to apex. I need help in writing nested Query in soql.

 

I need the following nested query in SOQL form. IS it possible write in this way?Then how to write it in SOQL.

please help me

 

the query is written in sql form:

 

select emailid from userprofile where empname in (select deptHead from department where deptId in (select deptId from Userprofile where empId='1001'));

 

-Shravan

I'm trying out EventForce from the AppExchange. Can the events be synchronized with the Salesforce calendar? After creating events how can they be viewed graphically and shared? Can notifications be sent to attendees for a Session?