• Noodle
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 3
    Replies
I have a trigger on a Parent Object_A to update records on a Child Object_B 

I have a Set<ID> myID to get current record from Object A.

Object_B has a Picklist field Status__c.

List<Object_B> ToUpdate = [SELECT id, Name, Status__c from Object_B WHERE Status__c = 'Open' OR Status__c = 'Late' AND Object_B.Object_A in ;myID];

I would like to choose records that have the picklist value of EITHER Open or Late and where the lookup for Object A has the ID from my set myId.
It all works perfectly if I do Where Status equals one value. But I can't figure out how to say one value or the other.

Thanks in advance
  • March 20, 2015
  • Like
  • 0
Hi there.

I have an issue with a Visualforce email template. Because I'm using Rendered as on column values, it's not showing the HEADER of the column.
 
<messaging:emailTemplate subject="Your late Tasks" recipientType="User" 

    relatedToType="User"
    replyTo="noreply@acme.com" >

 <messaging:htmlEmailBody >
 
    <style>
    .col1 {width:50%; text-align:center;}
    .col2 {width:20%; text-align:center;}
    .col3 {width:30%; text-align:center;}       
    </style>
  
 Hello
 
  
 <br></br>
 <br></br>
 <br></br>
     
   
    
   <html>  
          <apex:dataTable var="a" value="{!recipient.Actions_Tasks_Assigned__r}" columns="3" width="100%" columnClasses="col1, col2, col3" border="1" >
            
            <apex:column value="{!a.Task__c}" headerValue="Name" rendered="{!a.Status__c == 'Complete'}"/> 
            <apex:column value="{!a.Project__c}" headerValue="Name2" rendered="{!a.Status__c == 'Complete'}"/>
            <apex:column value="{!a.Status__c}" headerValue="Name3" rendered="{!a.Status__c == 'Complete'}"/>
            
          </apex:dataTable>  
    </html>


 
 
 </messaging:htmlEmailBody>

</messaging:emailTemplate>

Any ideas how I can get the Header of each Column to Show?

Thanks in advance
  • January 23, 2015
  • Like
  • 0
Hi there. I have a Visualforce template that I want to use to send out a weekly email.
 
<messaging:emailTemplate subject="Your late Tasks" recipientType="User" 

    relatedToType="User"
    replyTo="cases@acme.nomail.com" >

 <messaging:htmlEmailBody >
 
  .............
.............
.............
..........

 </messaging:htmlEmailBody>

</messaging:emailTemplate>

Then I have my Scheduled Class:
global class massTaskEmail implements Schedulable {
      
    global void execute(SchedulableContext sc) {
   
      Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
      
        email.setTemplateId('templateId');
	    email.setSaveAsActivity(false);
	    email.setTargetObjectId('userId');
            
        Messaging.sendEmail(new Messaging.SingleEmailMessage[]{email});   
     }
}

I would like to test this out by inserting both UserID's like I would if I was trying to preview the template. I already have the Object Target via setTargetObjectId('userId'); . How do I set the second one?

User-added image
  • January 12, 2015
  • Like
  • 0

Hi there

I have a situation where I need to create a list of Users, then for each user show their tasks.

So I would like something as follows.

List<User> user = Select Id From User

List<Task> task= Select Name from Task where User = user[0]
List<Task> task= Select Name from Task where User = user[1]
List<Task> task= Select Name from Task where User = user[2]
....
List<Task> task= Select Name from Task where User = user[n]


To explain the context a bit. I'm trying to make a weekly email to EACH user with their open tasks (or other condition, such as Task Status = Late). To do this, I've found that the only solution that might work will be a Visualforce Email Template. 

Thanks in Advance

  • December 22, 2014
  • Like
  • 0
I have a custom object similar to tasks called "Actions". I would like to send an email to users once a week to list all their Actions "Tasks", that are late (so with status = Late).

Info about VF email template

....
recipientType = "User"
relatedToType="User"
....
....
       <apex:datatable cellpadding="5" var="cx" value="{!relatedTo.Action__r}">
            <apex:column value="{!cx.Name}" headerValue="Action Name"/>
            <apex:column value="{!cx.Overall_Status__c} = Late" headerValue="Status"/>
        </apex:datatable
....
...

In the snippet of the code above, I've put in bold the condition I want to use. Is there any way of doing this?
  • December 19, 2014
  • Like
  • 0

Hi there,

Forgive me if I'm not clear or if my question seem a bit silly. I'm new to programming in general, and Apex is the first language I've started learning.



I have a wsdl, I've parsed it and created the class no problem. Now, I need to display data on a visualforce page.

The way I'd like it to work is as so... 

On Salesforce, on the VF page, a user would enter an ID (a series of numbers), press a button, and it will go get some text values related to this ID. So far, the VF side isn't causing me a lot of trouble, I can understand what I have to do from the various tutorials I've found online. I'm having a problem with the Controller.

Most of the guides I'm finding about controllers seem to concern operations within Salesforce (i.e. getting information from Salesforce objects and fields)

Help please!

  • February 04, 2014
  • Like
  • 0
I have a custom object similar to tasks called "Actions". I would like to send an email to users once a week to list all their Actions "Tasks", that are late (so with status = Late).

Info about VF email template

....
recipientType = "User"
relatedToType="User"
....
....
       <apex:datatable cellpadding="5" var="cx" value="{!relatedTo.Action__r}">
            <apex:column value="{!cx.Name}" headerValue="Action Name"/>
            <apex:column value="{!cx.Overall_Status__c} = Late" headerValue="Status"/>
        </apex:datatable
....
...

In the snippet of the code above, I've put in bold the condition I want to use. Is there any way of doing this?
  • December 19, 2014
  • Like
  • 0

I am experimenting with Visualforce email templates.

1.) Is there a way to run a query for a list of open Leads that belongs to a specific campaign?
2.) Can I then have the results render as a csv?


Essentially I would like something similar to this,
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_messaging_emailTemplate.htm
but want it to display information for Lead instead of Account.

Thank you in advance for any help.

  • March 18, 2013
  • Like
  • 0

I am getting an error "SessionId invalid at this location" when I try to use Query method. I am tying to integrate PeopleSoft with SalesForce.com using SOAP API (consuming a Web service in PeopleSoft). I can successfully use the login method. Using the sessionId and serverURl, I get from login method, I am trying to use the query method. I gets above error. Can anyone help me?