• h20rider
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 21
    Replies

Is there a IsPostBack Equivalent in SFDC.  Or a way to get the request type (post,get, etc)

I have created an extension for the CampaignMember object, but for some season I am getting a null for the object.  I am not sure how the Subject works in the page.

 

I created this page to override the Add to Campaign Button.

 

any help is appreciated.

Page:

<apex:page standardController="CampaignMember" title="Add to Campaign" Extensions="CampaignMemberController" >
<apex:pageMessages />
<apex:detail subject="{!CampaignMember.Id}" showChatter="true" />
</apex:page>

 

Extension

public with sharing class CampaignMemberController {

public CampaignMember cm {get;set;}

public CampaignMemberController(ApexPages.StandardController controller) {
this.cm = (CampaignMember)controller.getRecord();
Id id = ((sObject)controller.getRecord()).Id;
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO , 'The contact does not have an Email'));

System.debug('#### campaignMember: ' + cm + ';' + id);
view();
}



public PageReference view() {
System.debug('#### campaignMember: ' + cm);
return null;
}

}

 

 

I need to be able to display a message based on some condition after adding  a member to a compaign.

 

I tried to addError in the trigger, but that prevents a user from adding that contact to the compaign. Is there anyway of adding messages without create a custom page?

 

thanks

 

John

I am trying to override one of the features in the events when a person clicks on Save and New Event. I dont want the account to be carried over the new event as a default.

 

I was able to blank out the account Name in edit screen, by creating adding an html home page component.  But I dont know how to determine if the page is new or being editted.  So right now it is blanking it out for both instances

 

Thanks 

 

john

I am trying to get the the users and the contacts from an event.  Is there a way in the SOQL to get the object type.

 

I tried doing 2 seperate queries

Select e.Status, e.Response, e.IsWhat, e.IsParent, e.IsInvitee, e.IsDeleted, e.Id, e.EventId, e.CreatedDate, e.CreatedById,  e.AccountId, (Select Id FirstName from User) From EventRelation

 

Select e.Status, e.Response, e.IsWhat, e.IsParent, e.IsInvitee, e.IsDeleted, e.Id, e.EventId, e.CreatedDate, e.CreatedById,  e.AccountId, (Select Id FirstName from Contact) From EventRelation

 

and I got Didnt understand the relationship

 

Also,  I do have a query the below query that has everything.  Is there a way that will tell me what object type it is

Select e.SystemModstamp, e.Status, e.Response, e.RespondedDate, e.Relation.Name, e.Relation.FirstName, e.Relation.LastName, e.RelationId, e.LastModifiedDate, e.LastModifiedById, e.IsWhat, e.IsParent, e.IsInvitee, e.IsDeleted, e.Id, e.EventId, e.CreatedDate, e.CreatedById, e.Account.Name, e.AccountId From EventRelation e where EventId in :eventMap.keySet() order by RelationId desc limit 100

 

any help is appreciated

I have been trying to get the list of ivitees on an event.

 

I wanted to create this trigger on the EventRelation which is not possible,

 

I heard you can you use thw who Id, but I get a null when I use that Id.  any ideas??

 

Right now I am just outputing that data

public static void UpdateEventAgencyClientAttendees(List<Event> newValues){

Integer i = 0;

for (Event t : newValues){
i = i + 1;
system.debug('#### whoId and whatId: ' + t.WhatId + ':' + t.WhoId + ':' + i);
}
}

 

How do I create a report in SFDC to tell me the duplicated in a table.

 

thanks.

 

As an admin I can change an email.  We have  profile for a Level 1 support which also needs to be able to edit the email  But when i edit under that user i get the follwoing message.  HOw can i give that user/profile permission

 

Error: Invalid Data. 
Review all error messages below to correct your data.
Please contact an administrator to change your user profile field values.

I am getting the message Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. 
Even if a field is indexed a filter might still not be selective when: 
1. The filter value includes null (for instance binding with a list that contains null) 
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

 

 

My query is as followed

Select Id, User__c, Role__c, Start_Date__c, End_Date__c, BFP_Account__c From BFP_Account_Team__c where BFP_Account__c in :BFPIds and Start_Date__c <= Today and (End_Date__c>=Today or End_Date__c = null) 

 

BFP_Account__c is a lookup field and should be indexed.  But I did notice that is some cases it did contain a null as one of the values.  I am also filtering by End_Date__c = null

 

The question is if I get rid of the nulls in the  BFPIds, can I still use  End_Date__c = null? or do I have to find another way to replace End_Date__c = null

 

I was able to create a HTML email using the email template

 

Now I am being told that it is suppose to open an outlook email to send. So basically we have meeting notes that are being sent to the managers.

So after the meeting, they want to click on a button on the event-> and it will open there outlook email populated and formated in HTML

 

Update:

I think I can do the following using SFDC Methods?? Is there a way to get the HTML content of a email tempate or page in SFDC?

<a href "mailto: abc def<abc.def@ex.com>?subject= exSub &body="+Server.UrlEncode(MailToBody??"")"

I have written a custom component for a Email template.  Everything looks fine except the table doesnt get populated with the date within the component. I do see the table headings. I tried to add debugging using the system.debug but that doesnt appear in the logs

 

here is what I have

Email Tamplate

<c:BD_Email_Template_Invitees EventId="{!relatedTo.Id}"></c:BD_Email_Template_Invitees>

 

Component

<apex:component controller="BD_Email_Template_Invitees_Controller" access="Global">
<apex:attribute name="EventId" description="This is the EventId." type="Id" assignTo="{!thisEventId}"/>
<table border="1">
<tr>
<td><apex:outputText value="Name"/></td>
<td><apex:outputText value="Account"/></td>
<td><apex:outputText value="Title"/></td>
<td><apex:outputText value="Email"/></td>
<td><apex:outputText value="Phone"/></td>
</tr>
<apex:repeat value="{!invitees}" var="xx" id="theRepeat">
<tr>
<td>{!xx.Name}</td>
<td>{!xx.Account}</td>
<td>{!xx.Title}</td>
<td>{!xx.Email}</td>
<td>{!xx.Phone}</td>
</tr>
</apex:repeat>
</table>
</apex:component>

 

Conponent Controller

public with sharing class BD_Email_Template_Invitees_Controller {

public Id thisEventId {get;set;}

public Set<Id> attendeeId = new Set<Id>{};
public List<Invitees> invitees = new List<Invitees>{};

public List<Invitees> GetInvitees()
{
system.debug('#### GetInvitees(): ' + thisEventId);
invitees = new List<Invitees>{};
for (EventAttendee eventAttendee : [Select Id, EventId, AttendeeId From EventAttendee where EventId = :thisEventId])
attendeeId.add(eventAttendee.Id);
try
{
for ( User user : [Select Title, Phone, Name, Email, AccountId From User where Id in :attendeeId])
{
Invitees invitee = new Invitees();
invitee.Title = user.Title;
invitee.Name = user.Name;
invitee.Email = user.Email;
invitee.Phone = user.Phone;

invitees.add( invitee );
}
} catch (Exception ex) {}

try
{
for (Contact contact : [Select Title, Phone, Name, Email, AccountId From Contact where Id in :attendeeId])
{
Invitees invitee = new Invitees();
invitee.Title = contact.Title;
invitee.Name = contact.Name;
invitee.Email = contact.Email;
invitee.Phone = contact.Phone;

invitees.add( invitee );
}
} catch (Exception ex) {}
return invitees;
}

public class Invitees {

public String Name { get; set; }
public String Account { get; set; }
public String Title { get; set; }
public String Email { get; set; }
public String Phone { get; set; }
}
}

 

 

is there a way to hide the Call Log and app info in the mobile app

 

I see a way to edit the tabs but not the Call Log or Application Info

Is there a way to color code meeting types in the calendar.  Ie have an internal meeting be blue 

I am trying to log into our UAT enviroment but I cant connect.    when I look in the Mobile management, it says it is registered

When I log in it just says connectiing

 

I have a samsung galaxy s3 Jellybean which I download the SFDC app today.

 

 

We are using CastIron to insert records into SFDC.

 

What has been happening is that when we have one error in the batch, the entire batch fails.  This has been happening to the Opportunity object

 

Also I am curious about how SFDC handles batches with triggers.  We have serveral triggers for this object.  So what happens when you have a record that fails

 

So you have x opportunities

and you have the following methods inside the trigger

Method1

Method2

Method3

 

if record#1 fails in Method1, is that part of the list that is sent to Method2 and 3

I am using a email template in one of the pages.  I notitced there are fields that are available.  How can I get those the values for those fields to be populated

I am having some issues with mailing for some reason I am getting the:

550 Error: content rejected

 

 

I think part of the problem is the sender in the log is coming out as 

rvakkalagadda=[our company].net__02ku55ks299yo@dapr48kb4k52zl.e-cvn2eac.el.bnc.sandbox.salesforce.com

 

any ideas if that is the issue and how to correct it

I have a scheduled job that runs nightly which basically updates any team member that is active and becomes inactive due the the start and end date and visa versa.  When update these records there are a lot of triggers that get set off.  If the list of active --> Inactive or the inactive -->active is too big I will run into soql limits

 

In my code put a limit on the query to only retrieve x amount for inactive or active lists.  but really I need it to run all of them

 

any way of accomplishing this.

 

I have a few test classes where i I running under a different user

 

When I can quering objects I am getting 0 rows.  For example  the custom object: Pipeline_Stage__c

where I looked at sharing I see this.

 

Pipeline Stage

Public Read OnlyChecked

 

Any Ideas why I am not able to see all the records

I have tried adding a string with both a \n and <br>.

 

The \n does do a line return in the source

and the <br> displays <br> instead if do a br

 

How can I get it to not encode the <br>

Is there a IsPostBack Equivalent in SFDC.  Or a way to get the request type (post,get, etc)

I need to be able to display a message based on some condition after adding  a member to a compaign.

 

I tried to addError in the trigger, but that prevents a user from adding that contact to the compaign. Is there anyway of adding messages without create a custom page?

 

thanks

 

John

I have been trying to get the list of ivitees on an event.

 

I wanted to create this trigger on the EventRelation which is not possible,

 

I heard you can you use thw who Id, but I get a null when I use that Id.  any ideas??

 

Right now I am just outputing that data

public static void UpdateEventAgencyClientAttendees(List<Event> newValues){

Integer i = 0;

for (Event t : newValues){
i = i + 1;
system.debug('#### whoId and whatId: ' + t.WhatId + ':' + t.WhoId + ':' + i);
}
}

 

How do I create a report in SFDC to tell me the duplicated in a table.

 

thanks.

 

I am getting the message Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. 
Even if a field is indexed a filter might still not be selective when: 
1. The filter value includes null (for instance binding with a list that contains null) 
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

 

 

My query is as followed

Select Id, User__c, Role__c, Start_Date__c, End_Date__c, BFP_Account__c From BFP_Account_Team__c where BFP_Account__c in :BFPIds and Start_Date__c <= Today and (End_Date__c>=Today or End_Date__c = null) 

 

BFP_Account__c is a lookup field and should be indexed.  But I did notice that is some cases it did contain a null as one of the values.  I am also filtering by End_Date__c = null

 

The question is if I get rid of the nulls in the  BFPIds, can I still use  End_Date__c = null? or do I have to find another way to replace End_Date__c = null

 

I'm having issues writing a trigger that will insert a Contact record from information based on the Account.

 

Basically, if it's an account is inserted, I want it to create a Contact.  That part is easy.  The next part that I am having trouble writing is if the account is updated part.   If it's an update, I want it to look to see if there are any Contacts with the Contact_Type__c = General.  If not, then it needs to create a Contact like in the insert portion.  Thought it was simple enough but I can't get it work correctly.  I also need to make sure that this bulk safe since we load accounts nightly.

 

 

I marked the line it's failing on in red.

 

 

 

trigger CreateAccountContact on Account (after insert, after update){

    if(Trigger.isInsert){
    
        List<Contact> ct = new List <Contact>();
        
        for(Account acc : trigger.new){

        Contact c = new Contact(LastName = acc.name,
                        AccountId=acc.id,
                        Fax=acc.Fax,
                        MailingStreet=acc.BillingStreet,
                        MailingCity=acc.BillingCity,
                        MailingState=acc.BillingState,
                        MailingPostalCode=acc.BillingPostalCode,
                        MailingCountry=acc.BillingCountry,
                        Phone=acc.Phone);

        ct.add(c);
        
        }
        
        if(!ct.isEmpty())
            insert ct; 
    }
    
    else{
        
        List<contact> cntsload = new List <Contact>();
        
        for(Account acc : trigger.new){
                List<Contact> cnt = new List<Contact>([select id, Contact_Type__c from Contact where AccountId = acc.id and Contact_Type__c = 'General']);
        
        if(cnt.isEmpty()){

        Contact c = new Contact(LastName = acc.name,
                        AccountId=acc.id,
                        Fax=acc.Fax,
                        MailingStreet=acc.BillingStreet,
                        MailingCity=acc.BillingCity,
                        MailingState=acc.BillingState,
                        MailingPostalCode=acc.BillingPostalCode,
                        MailingCountry=acc.BillingCountry,
                        Phone=acc.Phone);

        cntsload.add(c);
        
        }
        }
        
        if(!cntsload.isEmpty())
            insert cntsload; 
    
    
    }
    
}

 

I have written a custom component for a Email template.  Everything looks fine except the table doesnt get populated with the date within the component. I do see the table headings. I tried to add debugging using the system.debug but that doesnt appear in the logs

 

here is what I have

Email Tamplate

<c:BD_Email_Template_Invitees EventId="{!relatedTo.Id}"></c:BD_Email_Template_Invitees>

 

Component

<apex:component controller="BD_Email_Template_Invitees_Controller" access="Global">
<apex:attribute name="EventId" description="This is the EventId." type="Id" assignTo="{!thisEventId}"/>
<table border="1">
<tr>
<td><apex:outputText value="Name"/></td>
<td><apex:outputText value="Account"/></td>
<td><apex:outputText value="Title"/></td>
<td><apex:outputText value="Email"/></td>
<td><apex:outputText value="Phone"/></td>
</tr>
<apex:repeat value="{!invitees}" var="xx" id="theRepeat">
<tr>
<td>{!xx.Name}</td>
<td>{!xx.Account}</td>
<td>{!xx.Title}</td>
<td>{!xx.Email}</td>
<td>{!xx.Phone}</td>
</tr>
</apex:repeat>
</table>
</apex:component>

 

Conponent Controller

public with sharing class BD_Email_Template_Invitees_Controller {

public Id thisEventId {get;set;}

public Set<Id> attendeeId = new Set<Id>{};
public List<Invitees> invitees = new List<Invitees>{};

public List<Invitees> GetInvitees()
{
system.debug('#### GetInvitees(): ' + thisEventId);
invitees = new List<Invitees>{};
for (EventAttendee eventAttendee : [Select Id, EventId, AttendeeId From EventAttendee where EventId = :thisEventId])
attendeeId.add(eventAttendee.Id);
try
{
for ( User user : [Select Title, Phone, Name, Email, AccountId From User where Id in :attendeeId])
{
Invitees invitee = new Invitees();
invitee.Title = user.Title;
invitee.Name = user.Name;
invitee.Email = user.Email;
invitee.Phone = user.Phone;

invitees.add( invitee );
}
} catch (Exception ex) {}

try
{
for (Contact contact : [Select Title, Phone, Name, Email, AccountId From Contact where Id in :attendeeId])
{
Invitees invitee = new Invitees();
invitee.Title = contact.Title;
invitee.Name = contact.Name;
invitee.Email = contact.Email;
invitee.Phone = contact.Phone;

invitees.add( invitee );
}
} catch (Exception ex) {}
return invitees;
}

public class Invitees {

public String Name { get; set; }
public String Account { get; set; }
public String Title { get; set; }
public String Email { get; set; }
public String Phone { get; set; }
}
}

 

 

I am trying to log into our UAT enviroment but I cant connect.    when I look in the Mobile management, it says it is registered

When I log in it just says connectiing

 

I have a samsung galaxy s3 Jellybean which I download the SFDC app today.

 

 

I am having some issues with mailing for some reason I am getting the:

550 Error: content rejected

 

 

I think part of the problem is the sender in the log is coming out as 

rvakkalagadda=[our company].net__02ku55ks299yo@dapr48kb4k52zl.e-cvn2eac.el.bnc.sandbox.salesforce.com

 

any ideas if that is the issue and how to correct it

I have a scheduled job that runs nightly which basically updates any team member that is active and becomes inactive due the the start and end date and visa versa.  When update these records there are a lot of triggers that get set off.  If the list of active --> Inactive or the inactive -->active is too big I will run into soql limits

 

In my code put a limit on the query to only retrieve x amount for inactive or active lists.  but really I need it to run all of them

 

any way of accomplishing this.

 

I have a few test classes where i I running under a different user

 

When I can quering objects I am getting 0 rows.  For example  the custom object: Pipeline_Stage__c

where I looked at sharing I see this.

 

Pipeline Stage

Public Read OnlyChecked

 

Any Ideas why I am not able to see all the records

I have tried adding a string with both a \n and <br>.

 

The \n does do a line return in the source

and the <br> displays <br> instead if do a br

 

How can I get it to not encode the <br>

I have a trigger that I update before wether a insert or update. The problem that I am having is that I update the value in the trigger before section.  But for some reason that update to the object is trigger another update.  Is there a way to either not have the trigger, trigger the update after or capture the object before the trigger.

 

Thanks

 

JWG

I have a page where I have a javascript form validation where some of the input variables are within custom components.  I have not problem access the input variables that are within the page.  but if there are in the custom components, I can figure out how to access them

 

Any ideas? It is using the apex to assign the Id ( ie <apex:selectList)

 

Update:

 

I highlighted the issue I am having below. I am unable to get the input of the component in the page

<apex:component controller="MultiSelectPicklistCont" selfClosing="true" >
<apex:selectList id="selectList" styleClass="{!picklistStyleClass}" multiselect="true" size="5">
<apex:selectOptions value="{!unselected}" />
</apex:selectList>
</apex:component >

Page
<apex:page>
</script type="text/javascript">
var start = parseInt(document.getElementById("{!$Component.frmFilter.dateRangeStart}").value);
var end = parseInt(document.getElementById("{!$Component.frmFilter.dateRangeEnd}").value);
var marketlist = document.getElementById("{!$Component.frmFilter.mspm.picklist}"); // equals null
</script>
<apex:form id="frmFilter">

<c:MultiSelectPicklist SelectOptions="{!mMediator.selectOptions}" PicklistStyleClass="pickList" MultiSelectPicklistManager="{!mspm}" />


<apex:selectList size="1" styleClass="dropdown" value="{!FO_StartDate}" id="dateRangeStart" >
<apex:selectOption itemValue="0" itemLabel="Q1" />
<apex:selectOption itemValue="3" itemLabel="Q2" />
<apex:selectOption itemValue="6" itemLabel="Q3" />
<apex:selectOption itemValue="9" itemLabel="Q4" />
</apex:selectList>
<apex:selectList size="1" styleClass="dropdown" value="{!FO_EndDate}" id="dateRangeEnd" >
<apex:selectOption itemValue="2" itemLabel="Q1" />
<apex:selectOption itemValue="5" itemLabel="Q2" />
<apex:selectOption itemValue="8" itemLabel="Q3" />
<apex:selectOption itemValue="11" itemLabel="Q4" />
</apex:selectList>
</apex:form>

</apex:page>