• B2A
  • NEWBIE
  • 50 Points
  • Member since 2009

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 38
    Questions
  • 51
    Replies

I have an email template that is related to Opportunity.  The opportunity has a lookup field to Accounts and the Account has a related list called Contact Roles (AccountContactRoles??).  I would like to get the contact that has a role "Executive Sponsor" to show on this email template.  Help would be great.

 

 

 

Thanks,

 

  • April 21, 2010
  • Like
  • 0

Hi I would like to be able to filter results of a related list in an email template.  Most examples I have seen are for visualforce PAGES, but not email Template.  The syntax seems to be different since it does not work on email template.  Here is the code I have found, although it only applies to VF Pages, rather than email templates:

 

<apex:page Controller="ActivityController" tabstyle="Account">

    <apex:detail subject="{!account}" relatedlist="False">
    </apex:detail>

    <apex:pageBlock title="Activities" >
    <apex:pageBlockSection title="Activities I have access to" columns="1" collapsible="true">
    <apex:dataTable value="{!Activities}" var="each" cellpadding="10" border="0" styleClass="list">
        <apex:column headerValue="Id"><a href="/{!each.Id}">{!each.Id}</a></apex:column>  
    </apex:dataTable>
    </apex:pageBlockSection>
    </apex:pageBlock>

</apex:page>

Any help would be great!!

Thanks

Aiyaz

  • April 15, 2010
  • Like
  • 0

Hi All,

 

I'm stuck with a problem:

 

I have a text field that has full name Eg. John Smith (and no we cannot use a lookup field lol), and our company has email structure firstname.lastname@company.com.

 

So i'm trying to extract the first string (John) and second string (Smith) to formulate an email address, so that I can use in an email alert.  I know i will need to get this email into an email field but I figured I could do that with a workflow.

 

Any help would be great.

 

So far I have tried

TRIM(LEFT( CustomField__c , FIND(" ", CustomField__c)))

 

and I am able to get "firstname", however if I try

TRIM(RIGHT( CustomField__c , FIND(" ", CustomField__c)))

 it does not always get the last string after the space " ".

 

Help would be great in figuring this out!

 

Thanks in advance.

 

B2A

  • April 12, 2010
  • Like
  • 0

Is there a way I can access report information and update the folder that reports belong to?  Even programmatically? 

  • March 19, 2010
  • Like
  • 0

Hi, I have successfully installed eclipse but cannot install force ide.  When I start the installation process it seems to work fine then a box appears listing the following errors:

 

An error occurred while collecting items to be installed
  No repository found containing: org.eclipse.emf.common/osgi.bundle/2.4.0.v200808251517
  No repository found containing: org.eclipse.emf.ecore/osgi.bundle/2.4.1.v200808251517
  No repository found containing: org.eclipse.emf.ecore.change/osgi.bundle/2.4.0.v200808251517
  No repository found containing: org.eclipse.emf.ecore.edit/osgi.bundle/2.4.1.v200808251517
  No repository found containing: org.eclipse.emf.ecore.xmi/osgi.bundle/2.4.1.v200808251517
  No repository found containing: org.eclipse.emf.edit/osgi.bundle/2.4.1.v200808251517
  No repository found containing: org.eclipse.wst.common.emf/osgi.bundle/1.1.202.v200809111955
  No repository found containing: org.eclipse.wst.common.emfworkbench.integration/osgi.bundle/1.1.201.v200808071700
  No repository found containing: org.eclipse.wst.common.frameworks/osgi.bundle/1.1.200.v200805140020
  No repository found containing: org.eclipse.wst.common.modulecore/osgi.bundle/1.1.203.v200809110700
  No repository found containing: org.eclipse.wst.common.project.facet.core/osgi.bundle/1.3.3.v200809102124
  No repository found containing: org.eclipse.wst.common.ui/osgi.bundle/1.1.301.v200805140415
  No repository found containing: org.eclipse.wst.html.core/osgi.bundle/1.1.202.v200808281704
  No repository found containing: org.eclipse.wst.html.ui/osgi.bundle/1.0.301.v200809120137
  No repository found containing: org.eclipse.wst.sse.core/osgi.bundle/1.1.302.v200808260045
  No repository found containing: org.eclipse.wst.sse.ui/osgi.bundle/1.1.2.v200809120159
  No repository found containing: org.eclipse.wst.validation/osgi.bundle/1.2.2.v200809050219
  No repository found containing: org.eclipse.wst.xml.core/osgi.bundle/1.1.305.v200809120354
  No repository found containing: org.eclipse.wst.xml.ui/osgi.bundle/1.0.410.v200809120143

 

 

 

I've tried the workaround solution (i think) but adding a url but not sure if I have done this properly.  Any help would be appreciated.

 

Thank you

 

Aiyaz

  • March 09, 2010
  • Like
  • 0

Hello All,

 

I've created the following formula, however I noticed if the field is 'blank' it is treated as ' = 0 ', which it should not.

 

I've tried using ISBLANK, and BLANKVALUE, with no luck.  Any ideas guys?

 

IF( LS_Implicit_Lead_Score__c > 39, IMAGE("URL", "Hot, Hot, Hot"), IF( LS_Implicit_Lead_Score__c > 29, IMAGE("URL", "Looks Promising"), IF( LS_Implicit_Lead_Score__c > 0, IMAGE("URL", "Getting Warmer"), IF( LS_Implicit_Lead_Score__c = 0, IMAGE("URL", "Check for a Pulse"), IMAGE("URL", "Good Luck")))))

 

Thanks.

 

  • March 06, 2010
  • Like
  • 0

Hello All, i have the following use case:

 

Before saving a record (custom object), with a lookup field to a Contact,I need to check whether the contact already has one of these records created and associated to it.  In other words, I want to enforce that the contact record allows one record from a custom object created for it, else a validation rule should say "You have already created a 'custom object record entry for this contact."

 

Any idea whether this can be done via validations or apex triggers?

 

Thanks for any suggestions.

 

B2A

  • February 02, 2010
  • Like
  • 0

Hi ,

 

I'm receiving an error when trying import opportunity line items, where price book entry ID is required.  I have provided it and I get an error (Below), although it seems as if the curency is USD for all.

 

field integrity exception: PricebookEntryId (pricebook entry currency code does not match opportunity currency code)

 

Any help would be great!

  • January 14, 2010
  • Like
  • 0

I read somewhere in the community that the Opportunity's stage history is read-only for API purposes.  For that I just wanted to confirm whether or not I can import stage history from an old instance of SF to a New instance, or is it like Field History where it is disallowed?

 

Thanks for any feedback!!

  • January 11, 2010
  • Like
  • 0

Hello,


I have a test file i'm trying to import into Salesforce with Data Loader and all the fields are being mapped correctly, however I only get errors no successes.  The error says "Contact <name of an Admin> if you require this Account information changed".

 

My role in salesforce is System Administrator as well.

 

Any help would be great!!

 

Thanks

  • January 07, 2010
  • Like
  • 0

Hi I am doing some data migration and was hoping someone would have some tips on this.  The data is going from an OLD instance of Salesforce to a new one.

 

I have to reimport the accounts and contacts along with Activities. 

 

The activities, have a whatID and a whoID, however the accounts will be given new ID's in the new SF instance so I need help on how to quickly associate contacts to these new accounts, and the same for activities to accounts or contacts or could be even associated to other objects eg. Opps.

 

Any help would be great!!

 

Thanks

  • December 30, 2010
  • Like
  • 0

So far in my apex playing time I have been able to parse out values from a string of characters

private void testBookParser() { XmlStreamReaderDemo demo = new XmlStreamReaderDemo(); String str = '<books><book author="Manoj">Foo bar</book>' + '<book author="Mysti">Baz</book></books>'; XmlStreamReader reader = new XmlStreamReader(str); books = demo.parseBooks(reader); //System.debug(books.size()); //for (Book book : books) {System.debug(book); //} }

 

 

However, syntatically how can I read in a URL string which contains XML (eg. 'https://na6.salesforce.com/servlet/servlet.ReportList') so that I can parse it?

 

Any help would be appreciated!

  • December 14, 2009
  • Like
  • 0

Just testing out some code from the xmlstreamreader tutorial using the string:

 

     String str = '<books><book author="Manoj">Foo bar</book>' +
        '<book author="Mysti">Baz</book></books>';

 

I only get values for author if i use the "reader.getAttributeValueAt(0)" however I get NO values if I use "reader.getAttributeValue('','author');"

 

Can anyone shed light on why this is so?

 

Thanks!

  • December 14, 2009
  • Like
  • 0

Hi All!

 

I'm playing around with VF pages and and I am trying to create a custom controller that basically reads and parses XML from a URL (eg. https://na6.salesforce.com/servlet/servlet.ReportList).  I have not been able to find how I can get this controller to read xml from a URL. 

 

I"m basically trying to get report IDs from the source.  Help would be appreciated!

 

Thanks!

  • December 10, 2009
  • Like
  • 0

Hi , I was hoping someone would be able to shed some light on this topic!

 

I currently have a visual force page and it's in it's early stages.  It uses a custom object as a standardcontroller and I used a custom picklist field to determine what report shows (report shows via an iFRAME) after a partial page refresh.  However, this is all hardcoded so the reports are pre-set. 

 

Is there a way (without hardcoding) that I can query existing reports? 

 

Or any workaround .. i have a feeling I may have to hard code this :S

 

Also, has anyone used dependant picklist using visualforce?  I have a feeling I will need to create depend picklists so that the user will have to getmore specific on the type of report they want.

  • December 07, 2009
  • Like
  • 0

I found out (after creating a trigger) that Mass Email actions do not invoke triggers :( (to my delight!!)

 

 What I was trying to do is update a date field for all the leads from a Mass Email.  Has any one done any type of workaround similar to this?

 

 

 

fyi:

 

I found this from the developer guide:

 

I found this from the developer guide:

 

Operations That Do Not Invoke Triggers

Triggers are only invoked for data manipulation language (DML) operations that are initiated or processed by the Java

application server. Consequently, some system bulk operations do not currently invoke triggers. Some examples include:

Cascading delete operations. Records that did not initiate a delete do not cause trigger evaluation.

Cascading updates of child records that are reparented as a result of a merge operation

Mass campaign status changes

Mass division transfers

Mass address updates

Mass approval request transfers

Mass email actions

Modifying custom field data types

Renaming or replacing picklists

Managing price books

Note: Inserts, updates, and deletes on person accounts fire account triggers, not contact triggers.

 

 

DOES this mean I cannot do this at all?  Any workarounds that anyone can think of?

  • December 03, 2009
  • Like
  • 0

Hi,

 

I've created a trigger which seems to work perfectly fine when sending email from a Lead record manually (as a task).  However, when sending a Mass email to several  leads the trigger fails to fire.  Not sure why this is happening as I thought my code would handle bulk.   I've pasted the code below..

 

trigger UpdateLeadAfterMassEmail on Task (after insert) { /**This is designed to update a date field on a Lead record once 1 week or 2 week follow up email has been mass mailed*/ integer mycounter = 0; string LeadID =''; List<Id> Ids = New List<Id>(); //Stores a batch of tasks For (Task NewRecord : trigger.new){ if(NewRecord.whoid != null){ LeadID = NewRecord.whoid; if(LeadID.startsWith('00Q')){ if(NewRecord.subject.startsWith('Email: Test email 1')){ Ids.add(LeadId); }else if(NewRecord.subject.startsWith('Mass Email: Followup3')){ Ids.add(LeadId); } } } } List<Lead> Lead_list = [Select Id, Second_Notification_Sent__c, Final_Notification_Sent__c FROM Lead Where Id IN: Ids]; For (Task NewRecord: trigger.new){ if(LeadID.startsWith('00Q')){ if(NewRecord.subject.startsWith('Email: Test email 1')){ Lead_list[mycounter].Second_Notification_Sent__c = date.today(); } else if(NewRecord.subject.startsWith('Mass Email: Followup3')){ Lead_list[mycounter].Final_Notification_Sent__c = date.today(); } } mycounter++; } update(Lead_list); }

 

  • December 02, 2009
  • Like
  • 0

Hi, I am testing a trigger that seems to work only when both objects are standard (date on contact record updates date on account record which is parent).

 

However, when I try the same thing with custom object being child I get an error when saving the custom object record (Meeting) ... below is the code  (the area highlighted in red is the problem area)

 

trigger UpdateAccount_fromMeetingDate on Meetings__c (after insert, after update) { //Triger to test update of relatwed records based on child trigger integer MyCounter=0; Set<Id> Ids = new Set<Id>(); For (Meetings__c NewRecord : trigger.new){ Ids.add(NewRecord.Account__r.id); } List<Account> Account_list = [Select Id,Name, LastMeeting__c From Account Where Id IN :Ids ]; For (Meetings__c MyItem : trigger.new){ Account_list[MyCounter].LastMeeting__c = MyItem.MeetingDate__c; MyCounter++; } update(Account_list); }

The error I get is "System.ListException: List index out of bounds: 0: Trigger.UpdateAccount_fromMeetingDate: line 27, column 22.

 

 

 

When I was using std object (Contact) I never had a problem with indexing and I was using accountID to ref Account (eg. NewRecord.AccountID), rather than what I had to do with a custom object (NewRecord.Account__r.id).   I think the problem is rooting with the ID not saving to the list and thus not having a valid array index existing?

 

Any ideas on ?  I think i'm close but maybe not :S

  • November 23, 2009
  • Like
  • 0

I'm in a pickle - how do I update an account record if I cannot write to account.id for storing in a LIST. 

 

Below is the code in which i'm getting the error: "Save error: file is not writeable: Account.id"

 

What should I do to get past this?  Thanks for any help!

 

List<Account> Account_list = [Select Id, Last_meeting__c From Account where Id IN: Ids]; For(Meetings__c MyItem : trigger.new){ Account acc = new Account(); acc.id = MyItem.Account__r.id; Account_list.add(acc); } update(Account_list);

 

 

  • November 20, 2009
  • Like
  • 0

I'm unsure what happened but I am trying to reuse some old code I used for a similar small project, but now I am getting an error when using the Apex Collection "MAP"

 

trigger F2FUpdateAccount on F2F_Meetings__c (after update, after insert) { //Get a LIST of Account IDs SET<ID> setAccountID = new SET<ID>(); string accountID = ''; //if t's whoID is NOT null then it may be an Account that //the task is associate to, and if it starts with '001' then it //definately has to be an Account record! //*** //The for loop below is a SOQL for loop: //- it iterates through the collection of records in the trigger.new array, // which will contain any records either inserted or updated. for(F2F_Meetings__c f: trigger.new){ accountID = f.account__r.id; // AccountID is the Account id setAccountID.add(accountID); // Add to the LIST } //Key-Value pairs (ID, Account) to store mapipng for Account (setAccountID) MAP<ID,Account> mapAccount = new MAP<ID,Account>([Select Id,Last_Face_to_Face_meeting__c From Account Where Id IN : setAccountID]); LIST<Account> accountsToUpdate = new LIST<Account>(); Account a = new Account(); for(F2F_Meetings__c f : trigger.new){ } if(accountsToUpdate.size() > 0){ database.update(accountsToUpdate, false); } }

 

 

 

Here is the error when trying to save this in eclipse (using with a developer edition):

X    Save error: Invalid initial type LIST:SOBJECT:Account for MAP:Id,Account

 

 

I cannot figure this one out.  Any help would be great!

  • November 19, 2009
  • Like
  • 0

Hi, I have successfully installed eclipse but cannot install force ide.  When I start the installation process it seems to work fine then a box appears listing the following errors:

 

An error occurred while collecting items to be installed
  No repository found containing: org.eclipse.emf.common/osgi.bundle/2.4.0.v200808251517
  No repository found containing: org.eclipse.emf.ecore/osgi.bundle/2.4.1.v200808251517
  No repository found containing: org.eclipse.emf.ecore.change/osgi.bundle/2.4.0.v200808251517
  No repository found containing: org.eclipse.emf.ecore.edit/osgi.bundle/2.4.1.v200808251517
  No repository found containing: org.eclipse.emf.ecore.xmi/osgi.bundle/2.4.1.v200808251517
  No repository found containing: org.eclipse.emf.edit/osgi.bundle/2.4.1.v200808251517
  No repository found containing: org.eclipse.wst.common.emf/osgi.bundle/1.1.202.v200809111955
  No repository found containing: org.eclipse.wst.common.emfworkbench.integration/osgi.bundle/1.1.201.v200808071700
  No repository found containing: org.eclipse.wst.common.frameworks/osgi.bundle/1.1.200.v200805140020
  No repository found containing: org.eclipse.wst.common.modulecore/osgi.bundle/1.1.203.v200809110700
  No repository found containing: org.eclipse.wst.common.project.facet.core/osgi.bundle/1.3.3.v200809102124
  No repository found containing: org.eclipse.wst.common.ui/osgi.bundle/1.1.301.v200805140415
  No repository found containing: org.eclipse.wst.html.core/osgi.bundle/1.1.202.v200808281704
  No repository found containing: org.eclipse.wst.html.ui/osgi.bundle/1.0.301.v200809120137
  No repository found containing: org.eclipse.wst.sse.core/osgi.bundle/1.1.302.v200808260045
  No repository found containing: org.eclipse.wst.sse.ui/osgi.bundle/1.1.2.v200809120159
  No repository found containing: org.eclipse.wst.validation/osgi.bundle/1.2.2.v200809050219
  No repository found containing: org.eclipse.wst.xml.core/osgi.bundle/1.1.305.v200809120354
  No repository found containing: org.eclipse.wst.xml.ui/osgi.bundle/1.0.410.v200809120143

 

 

 

I've tried the workaround solution (i think) but adding a url but not sure if I have done this properly.  Any help would be appreciated.

 

Thank you

 

Aiyaz

  • March 09, 2010
  • Like
  • 0

Hello All,

 

I've created the following formula, however I noticed if the field is 'blank' it is treated as ' = 0 ', which it should not.

 

I've tried using ISBLANK, and BLANKVALUE, with no luck.  Any ideas guys?

 

IF( LS_Implicit_Lead_Score__c > 39, IMAGE("URL", "Hot, Hot, Hot"), IF( LS_Implicit_Lead_Score__c > 29, IMAGE("URL", "Looks Promising"), IF( LS_Implicit_Lead_Score__c > 0, IMAGE("URL", "Getting Warmer"), IF( LS_Implicit_Lead_Score__c = 0, IMAGE("URL", "Check for a Pulse"), IMAGE("URL", "Good Luck")))))

 

Thanks.

 

  • March 06, 2010
  • Like
  • 0

Hi ,

 

I'm receiving an error when trying import opportunity line items, where price book entry ID is required.  I have provided it and I get an error (Below), although it seems as if the curency is USD for all.

 

field integrity exception: PricebookEntryId (pricebook entry currency code does not match opportunity currency code)

 

Any help would be great!

  • January 14, 2010
  • Like
  • 0

Hello,


I have a test file i'm trying to import into Salesforce with Data Loader and all the fields are being mapped correctly, however I only get errors no successes.  The error says "Contact <name of an Admin> if you require this Account information changed".

 

My role in salesforce is System Administrator as well.

 

Any help would be great!!

 

Thanks

  • January 07, 2010
  • Like
  • 0

Hi I am doing some data migration and was hoping someone would have some tips on this.  The data is going from an OLD instance of Salesforce to a new one.

 

I have to reimport the accounts and contacts along with Activities. 

 

The activities, have a whatID and a whoID, however the accounts will be given new ID's in the new SF instance so I need help on how to quickly associate contacts to these new accounts, and the same for activities to accounts or contacts or could be even associated to other objects eg. Opps.

 

Any help would be great!!

 

Thanks

  • December 30, 2010
  • Like
  • 0

Just testing out some code from the xmlstreamreader tutorial using the string:

 

     String str = '<books><book author="Manoj">Foo bar</book>' +
        '<book author="Mysti">Baz</book></books>';

 

I only get values for author if i use the "reader.getAttributeValueAt(0)" however I get NO values if I use "reader.getAttributeValue('','author');"

 

Can anyone shed light on why this is so?

 

Thanks!

  • December 14, 2009
  • Like
  • 0

Hello,

 

I am trying to make some edits to the "Simple Quote" application from the appexchange.

 

I am able to included fields for Opportunities and Accounts, but unable to figure out the syntax for the primary contact associated with the opportunity?

 

For example:

 

This works...

{!Opportunity.Account.BillingStreet}
{!Opportunity.QuoteNumber__c}

{!Opportunity.Owner.FirstName}

 

but this won't work (and produces the error in the subject line of this post):

{!Opportunity.Contact.Name}

 

I realize an Opportunity can have multiple Contacts, but ideally I would like to include the information for the Decision Maker in the quote. 

 

Anyone help?

  • December 14, 2009
  • Like
  • 0

Hi All!

 

I'm playing around with VF pages and and I am trying to create a custom controller that basically reads and parses XML from a URL (eg. https://na6.salesforce.com/servlet/servlet.ReportList).  I have not been able to find how I can get this controller to read xml from a URL. 

 

I"m basically trying to get report IDs from the source.  Help would be appreciated!

 

Thanks!

  • December 10, 2009
  • Like
  • 0

Hi,

 

I've created a trigger which seems to work perfectly fine when sending email from a Lead record manually (as a task).  However, when sending a Mass email to several  leads the trigger fails to fire.  Not sure why this is happening as I thought my code would handle bulk.   I've pasted the code below..

 

trigger UpdateLeadAfterMassEmail on Task (after insert) { /**This is designed to update a date field on a Lead record once 1 week or 2 week follow up email has been mass mailed*/ integer mycounter = 0; string LeadID =''; List<Id> Ids = New List<Id>(); //Stores a batch of tasks For (Task NewRecord : trigger.new){ if(NewRecord.whoid != null){ LeadID = NewRecord.whoid; if(LeadID.startsWith('00Q')){ if(NewRecord.subject.startsWith('Email: Test email 1')){ Ids.add(LeadId); }else if(NewRecord.subject.startsWith('Mass Email: Followup3')){ Ids.add(LeadId); } } } } List<Lead> Lead_list = [Select Id, Second_Notification_Sent__c, Final_Notification_Sent__c FROM Lead Where Id IN: Ids]; For (Task NewRecord: trigger.new){ if(LeadID.startsWith('00Q')){ if(NewRecord.subject.startsWith('Email: Test email 1')){ Lead_list[mycounter].Second_Notification_Sent__c = date.today(); } else if(NewRecord.subject.startsWith('Mass Email: Followup3')){ Lead_list[mycounter].Final_Notification_Sent__c = date.today(); } } mycounter++; } update(Lead_list); }

 

  • December 02, 2009
  • Like
  • 0

Hi, I am testing a trigger that seems to work only when both objects are standard (date on contact record updates date on account record which is parent).

 

However, when I try the same thing with custom object being child I get an error when saving the custom object record (Meeting) ... below is the code  (the area highlighted in red is the problem area)

 

trigger UpdateAccount_fromMeetingDate on Meetings__c (after insert, after update) { //Triger to test update of relatwed records based on child trigger integer MyCounter=0; Set<Id> Ids = new Set<Id>(); For (Meetings__c NewRecord : trigger.new){ Ids.add(NewRecord.Account__r.id); } List<Account> Account_list = [Select Id,Name, LastMeeting__c From Account Where Id IN :Ids ]; For (Meetings__c MyItem : trigger.new){ Account_list[MyCounter].LastMeeting__c = MyItem.MeetingDate__c; MyCounter++; } update(Account_list); }

The error I get is "System.ListException: List index out of bounds: 0: Trigger.UpdateAccount_fromMeetingDate: line 27, column 22.

 

 

 

When I was using std object (Contact) I never had a problem with indexing and I was using accountID to ref Account (eg. NewRecord.AccountID), rather than what I had to do with a custom object (NewRecord.Account__r.id).   I think the problem is rooting with the ID not saving to the list and thus not having a valid array index existing?

 

Any ideas on ?  I think i'm close but maybe not :S

  • November 23, 2009
  • Like
  • 0

I'm in a pickle - how do I update an account record if I cannot write to account.id for storing in a LIST. 

 

Below is the code in which i'm getting the error: "Save error: file is not writeable: Account.id"

 

What should I do to get past this?  Thanks for any help!

 

List<Account> Account_list = [Select Id, Last_meeting__c From Account where Id IN: Ids]; For(Meetings__c MyItem : trigger.new){ Account acc = new Account(); acc.id = MyItem.Account__r.id; Account_list.add(acc); } update(Account_list);

 

 

  • November 20, 2009
  • Like
  • 0
My triggers and classes are getting in the way of using the data loader to load my data. If I make the triggers "inactive", my test coverage drops to 0% and I can't deploy the triggers in the inactive state.  Is there any way to turn off all code including classes (as if none existed)? And of course I'll need to put it all back afterwards.