• bmartinez76
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 18
    Replies

I created my trigger and it seems to work fine. When I try to create a bulk insert test I get 100% coverage but get an error which I can't seem to overcome. Any help would be greatly appreciated.

 

Error

22:56:46.254|FATAL_ERROR|System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LastFTFDateforAccountStamp: execution of BeforeInsert

caused by: System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []

Trigger.LastFTFDateforAccountStamp: line 27, column 9: []

Class.AEREGIONROLECLASSONACTIVITIES.testBulkInsert: line 85, column 10
External entry point

 

Trigger

 

trigger LastFTFDateforAccountStamp on Event (before insert, after update){ Set<Id> Events = new Set<id> (); List<Account> AccountList = new List<Account>(); for (Event e : Trigger.new) Events.add(e.id); Map<Id, Event> eventdate= new Map<Id,Event> ([Select ActivityDatetime from event where id in :Events]); for (Event e : Trigger.new){ if (e.call_type__c =='In Person' && e.EventStatus__c=='Completed'&& e.ActivityDatetime < datetime.now()) { //update account if event is in Person and completed Account a = new Account( Id = e.AccountId ); a.Last_FTF_Activity__c=e.endDatetime; AccountList.add(a); } else if (e.call_type__c =='Sales Phone Call' && e.EventStatus__c=='Completed'&& e.ActivityDatetime < datetime.now()) { Account a = new Account( Id = e.AccountId ); a.Last_SPC_Activity__c=e.endDatetime; AccountList.add(a); update AccountList; } } }

 

 Test Class

public with sharing class AEREGIONROLECLASSONACTIVITIES { static testMethod void testSingleInsert() { Profile p = [select id from profile where name='Standard User']; UserRole ur= [select ID from UserRole where name='Support Analyst']; User u = new User(alias = 'test123', email='test123@noemail.com', emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US', localesidkey='en_US', profileid = p.Id, country='United States', timezonesidkey='America/Los_Angeles', username='test123@noemail.com'); insert u; Lead L = new Lead(LastName='Tester',Company='Test Inc',OwnerId=u.Id,ownerRoleid__c=ur.id); insert L; Contact co = new Contact( firstname='John', lastname='Doe', Survey_sent__c=true); insert co; Account a= new Account( Name = 'Test Account', OwnerId = u.Id ); insert a; case c = new Case(Taken_By__c='Internal',customer_type__C='Internal',priority='low', origin='Email',status='Assigned',escalation__C='Level 2',subject='Brian Trigger Test', Description='Brian Trigger Test',Update_Contact_Survey_Value__c = True,Send_Internal_Survey_to_User__c=true,contactid=co.id,OwnerId = u.Id ); insert c; Event e2= new Event(subject='Test', ActivityDatetime= datetime.now(), DurationInMinutes=60,eventstatus__c='Completed', Product_Subject__c='Arrow',format__c='Demo',Call_type__c='In Person',OwnerId = u.Id); insert e2; update e2; Account bb= new Account( Name = 'Test Account', Last_SPC_Activity__c=e2.ActivityDatetime, OwnerId = u.Id ); insert bb; Opportunity o= new Opportunity(Name='Brian Test', type='COA', ordertype__c='Defensive COA',stagename='S0-Suspect Pool', closedate=date.today()); insert o; System.assertEquals(u.unavailable__c,[Select Unavailable__c From CASE Where Id = :c.Id].unavailable__c); } static testMethod void testBulkInsert() { List<Event> events = new List<Event>(); Profile p = [select id from profile where name='Standard User']; User u = new User(alias = 'test123', email='test1234@noemail.com', emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US', localesidkey='en_US', profileid = p.Id, country='United States', timezonesidkey='America/Los_Angeles', username='test1234@noemail.com'); insert u; Account a= new Account( Name = 'Test Account', OwnerId = u.Id ); insert a; for (Integer i=0;i<200;i++) { Event e2= new Event(subject='Test', ActivityDatetime= datetime.now(), DurationInMinutes=60,eventstatus__c='Completed', Product_Subject__c='Arrow',format__c='Demo',Call_type__c='Sales Phone Call',OwnerId =u.Id); events.add(e2); } insert events; } }

 


 

Hello, I'm fairly new to apex, but I have been able to complete the following code below to capture the last in person and sales phone call activity date. The trigger works perfectly, but I would like to have the trigger fire when an event is entered and closed immediately or when an event is scheduled for the future and then closed as completed when that future date passes and the event is closed by the user. I don't want the trigger to fire everytime a record is updated that meets the criteria only when a record is updated and has somehow changed.

 

So my question comes down to how can I add the ischanged functionality to my trigger?

 

Or better yet how can I incorporate the following which you typically find when creating a workflow using the UI.

 

"When a record is created, or when a record is edited and did not previously meet the rule criteria"

 

Thanks for the help in advance. 

 

 

trigger LastFTFDateforAccountStamp on Event (after insert, after update){
Set<Id> Events = new Set<id> ();
List<Account> AccountList = new List<Account>();
for (Event e : Trigger.new)
Events.add(e.id);

Map<Id, Event> eventdate= new Map<Id,Event> ([Select ActivityDatetime from event
where id in :Events]);

for (Event e : Trigger.new){
if (e.call_type__c =='In Person' && e.EventStatus__c=='Completed'&& e.ActivityDatetime < datetime.now()) {

//update account if event is in Person and completed

Account a = new Account( Id = e.AccountId );
a.Last_FTF_Activity__c=e.endDatetime;
AccountList.add(a);

update AccountList;

}
else if (e.call_type__c =='Sales Phone Call' && e.EventStatus__c=='Completed'&& e.ActivityDatetime < datetime.now())
{
Account a = new Account( Id = e.AccountId );
a.Last_SPC_Activity__c=e.endDatetime;
AccountList.add(a);

update AccountList;
}
}
}

 

 

 

Hello, I've done quite a few validation rules, but I'm no expert and I'm currently stumped.  In our CASE object we have a custom picklist field which has analyst names.  The field is changed to the analyst that the case is being assigned to.  so lets say a issue is reported to our support center. A case is created by the helpdesk then they select the person from the L3 Analyst field to escalate the issue to.  The level 1 analyst saves the record and clicks on change owner to assign to the analyst selected for L3 .  This cause problems as sometimes the L3 analyst is on vacation or out sick.  I'm trying to create validation that if L3_Analyst_Assigned__c is equal to "John Doe" it checks a custom object i created to store a check box named John Doe.  If the check box is true then I want the validation rule to go off and tell the level 1 analyst that the person they are trying to assign the case to is not available.
 
 
I saw the VLOOKUP feature but to be honest with you I have read just about every post but i can't get it to work.  Any assistance would be greatly appreciated.  There might be a different way to accomplish my goal, but so far this is what I have been able to come up with:
 
AND(ISPICKVAL( L3_Analyst_Assigned__c , "John Doe"),

VLOOKUP( $ObjectType.Support_Analyst_Availability__c.Fields.John_Doe__c , $ObjectType.Support_Analyst_Availability__c.Fields.Name , ***not sure what to put here*** ))
 
John_Doe__c in the support analyst object is a checkbox.


Message Edited by bmartinez76 on 06-26-2008 02:00 PM
Hello, I'm trying to create some code for an S-control that checks the users profile and if not an administrator it redirects them to another page.  If the user is an admin it allows them to delete otherwise it will give them a message saying "only admins can delete".  The reason I want to do it this way is because we have a group that deals with cases and I wish to give them manage case ability but not delete.  I removed the delete button from their page layout but when you click on cases you can see the del link in the view layout and i can't remove it.  I am trying to override the delete button so that only a person with an admin profile can delete a case.
 
I have so far created a redirect (below) but can't seem to find coding on how to check the users profile when they click on the link.  Can someone assist me please?
 
(admin profile ID)
00e00000006okRY
 
Code:
<html>
<body> 
<script language="JavaScript">
<!-- 
window.parent.location.href = ("https://na5.salesforce.com/500/o");
-->
</script>
</body>
</html>

 
Hello everyone, I'm not a programmer so scripting is not my first language. I am trying to create an s-control using javascript that when a user clicks on the SWAT Form tab it will check the value of a checkbox for a record in a custom object and whether it is true or false it will redirect to another url or display a messae.  What I want to do is if the checkbox is checked, the scontrol will redirect them to the form page where they can submit a request.  If the checkbox isn't checked I want it to display a message saying "Sorry but the SWAT team is not accepting forms at this time" instead of redirecting.  I created a custom object and created the fields SWAT Form availability name, SWAT Accepting Forms(this is a checkbox), and SWAT form message (this is a long text area field).   After creating these fields I created an entry to be used as the trigger.  The entry is called SWAT Form Trigger and for testing purposes I checked the box and entered a message in the SWAT form message field.  I looked up codes online and found different examples of validating checkboxes but the source code on the SF page seems to label the check box field differently.  Not sure if this is a simple request since I'm not a programmer, but can someone guide me in the right direction?  I'm not expecting a free pass, since understanding this would help me more than just having it provided to me.  Thank you in advance. 
 
/a04000000009Vvb is the ID for the trigger record.  When I view source on that page I has the checkbox listed as follows:Code:
<tr><td class="labelCol">SWAT Accepting Forms</td><td class="dataCol col02"><img src="/img/checkbox_checked.gif" alt="Checked" width="21" height="16" class="checkImg" id="00N00000006yuG0" title="Checked" /></td><td class="labelCol empty">&nbsp;</td><td class="dataCol empty">&nbsp;</td></tr>
<tr><td class="labelCol last">SWAT Form Message</td><td class="dataCol col02 last">The SWAT time is not currently accepting forms at this time.</td><td class="labelCol empty last">&nbsp;</td><td class="dataCol empty last">&nbsp;</td></tr>


Hello everyone.  I am new to these boards and to S-Controls.  I am not a programmer per say,but I have been assigned to role of admin for my company.  I have so far done a great job setting up the objects and creating simple formulas and validation rules.  I am now trying to create a process in the opportunity tab that will fetch the renewal billing month from the account object and place it in the opportunity renewal billing month field. So when entering an opportunity, the person would look up the company and then once selected the S-Control would search the account object for that company and retrieve the renewal billing information and paste it on the opportunity.  I was told that an S-Control can achieve this.  If anyone can lead me in the right direction it would be greatly appreciated.  Thank you in advance.

I created my trigger and it seems to work fine. When I try to create a bulk insert test I get 100% coverage but get an error which I can't seem to overcome. Any help would be greatly appreciated.

 

Error

22:56:46.254|FATAL_ERROR|System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LastFTFDateforAccountStamp: execution of BeforeInsert

caused by: System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []

Trigger.LastFTFDateforAccountStamp: line 27, column 9: []

Class.AEREGIONROLECLASSONACTIVITIES.testBulkInsert: line 85, column 10
External entry point

 

Trigger

 

trigger LastFTFDateforAccountStamp on Event (before insert, after update){ Set<Id> Events = new Set<id> (); List<Account> AccountList = new List<Account>(); for (Event e : Trigger.new) Events.add(e.id); Map<Id, Event> eventdate= new Map<Id,Event> ([Select ActivityDatetime from event where id in :Events]); for (Event e : Trigger.new){ if (e.call_type__c =='In Person' && e.EventStatus__c=='Completed'&& e.ActivityDatetime < datetime.now()) { //update account if event is in Person and completed Account a = new Account( Id = e.AccountId ); a.Last_FTF_Activity__c=e.endDatetime; AccountList.add(a); } else if (e.call_type__c =='Sales Phone Call' && e.EventStatus__c=='Completed'&& e.ActivityDatetime < datetime.now()) { Account a = new Account( Id = e.AccountId ); a.Last_SPC_Activity__c=e.endDatetime; AccountList.add(a); update AccountList; } } }

 

 Test Class

public with sharing class AEREGIONROLECLASSONACTIVITIES { static testMethod void testSingleInsert() { Profile p = [select id from profile where name='Standard User']; UserRole ur= [select ID from UserRole where name='Support Analyst']; User u = new User(alias = 'test123', email='test123@noemail.com', emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US', localesidkey='en_US', profileid = p.Id, country='United States', timezonesidkey='America/Los_Angeles', username='test123@noemail.com'); insert u; Lead L = new Lead(LastName='Tester',Company='Test Inc',OwnerId=u.Id,ownerRoleid__c=ur.id); insert L; Contact co = new Contact( firstname='John', lastname='Doe', Survey_sent__c=true); insert co; Account a= new Account( Name = 'Test Account', OwnerId = u.Id ); insert a; case c = new Case(Taken_By__c='Internal',customer_type__C='Internal',priority='low', origin='Email',status='Assigned',escalation__C='Level 2',subject='Brian Trigger Test', Description='Brian Trigger Test',Update_Contact_Survey_Value__c = True,Send_Internal_Survey_to_User__c=true,contactid=co.id,OwnerId = u.Id ); insert c; Event e2= new Event(subject='Test', ActivityDatetime= datetime.now(), DurationInMinutes=60,eventstatus__c='Completed', Product_Subject__c='Arrow',format__c='Demo',Call_type__c='In Person',OwnerId = u.Id); insert e2; update e2; Account bb= new Account( Name = 'Test Account', Last_SPC_Activity__c=e2.ActivityDatetime, OwnerId = u.Id ); insert bb; Opportunity o= new Opportunity(Name='Brian Test', type='COA', ordertype__c='Defensive COA',stagename='S0-Suspect Pool', closedate=date.today()); insert o; System.assertEquals(u.unavailable__c,[Select Unavailable__c From CASE Where Id = :c.Id].unavailable__c); } static testMethod void testBulkInsert() { List<Event> events = new List<Event>(); Profile p = [select id from profile where name='Standard User']; User u = new User(alias = 'test123', email='test1234@noemail.com', emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US', localesidkey='en_US', profileid = p.Id, country='United States', timezonesidkey='America/Los_Angeles', username='test1234@noemail.com'); insert u; Account a= new Account( Name = 'Test Account', OwnerId = u.Id ); insert a; for (Integer i=0;i<200;i++) { Event e2= new Event(subject='Test', ActivityDatetime= datetime.now(), DurationInMinutes=60,eventstatus__c='Completed', Product_Subject__c='Arrow',format__c='Demo',Call_type__c='Sales Phone Call',OwnerId =u.Id); events.add(e2); } insert events; } }

 


 

Hello, I'm fairly new to apex, but I have been able to complete the following code below to capture the last in person and sales phone call activity date. The trigger works perfectly, but I would like to have the trigger fire when an event is entered and closed immediately or when an event is scheduled for the future and then closed as completed when that future date passes and the event is closed by the user. I don't want the trigger to fire everytime a record is updated that meets the criteria only when a record is updated and has somehow changed.

 

So my question comes down to how can I add the ischanged functionality to my trigger?

 

Or better yet how can I incorporate the following which you typically find when creating a workflow using the UI.

 

"When a record is created, or when a record is edited and did not previously meet the rule criteria"

 

Thanks for the help in advance. 

 

 

trigger LastFTFDateforAccountStamp on Event (after insert, after update){
Set<Id> Events = new Set<id> ();
List<Account> AccountList = new List<Account>();
for (Event e : Trigger.new)
Events.add(e.id);

Map<Id, Event> eventdate= new Map<Id,Event> ([Select ActivityDatetime from event
where id in :Events]);

for (Event e : Trigger.new){
if (e.call_type__c =='In Person' && e.EventStatus__c=='Completed'&& e.ActivityDatetime < datetime.now()) {

//update account if event is in Person and completed

Account a = new Account( Id = e.AccountId );
a.Last_FTF_Activity__c=e.endDatetime;
AccountList.add(a);

update AccountList;

}
else if (e.call_type__c =='Sales Phone Call' && e.EventStatus__c=='Completed'&& e.ActivityDatetime < datetime.now())
{
Account a = new Account( Id = e.AccountId );
a.Last_SPC_Activity__c=e.endDatetime;
AccountList.add(a);

update AccountList;
}
}
}

 

 

 

Overview of My Scenario

 

Custom Fields Involved, in my Opportunity Object

 

A.    Deal Approved, date field

B.    Deal Rejected, date field

C.    Reason Deal Rejected, text field

D.   Close Sheet Attached, check box

E.    Stage = Closed Won

 

Usually the process flows as follows:

 

1.    Sales Rep receives a signed agreement, thencompletes Customer Close Sheet

2.    Sales Rep Attaches CLOSE SHEET to theOpportunity

3.    Sales Rep Updates Sales Stage to Closed Won(validation rule prevents close won if Close Sheet = False)

4.    Workflow Notifies Operations of Closed Deal

5.    Operations reviews the Close Sheet and either:

a.    Marks Opportunity Approved by inserting todaysDate in the Close Sheet Approved; or

b.    Marks Close Sheet Rejected; then

                                              i.     AddsReason Rejected.

6.    Workflow then notifies Sales Rep of Rejectionand includes data “Reason Rejected” field

7.    Sales Rep corrects the issue, then notifiesOperations that issues were resolved.

8.    If Operations reviews and  then approves the Opportunity, Operationsthey can set the Approved Date and erase the Rejected Reason, and Date Rejected.

 

Formulas that I have tried and are failing to meet my ultimate objectivethus far

F1.(Rejected_Reason__c ) = 0

F2.NOT ( ISNULL ( Rejected_Reason__c ))

F3.Close Sheet_Attached__c = FALSE ) && (ISPICKVAL( StageName ,"Won"))  ********NOTE: This formula appears to be working, with a slight workaround … I’ve included a default value (a DOT) in the field “Rejected Reason”

 

My objective is to create a formula that will enable:

Objective 1.              New Opportunities to be created without needinga Rejected Reason, until or unless an Opportunity has been rejected;

Objective 2.              No opportunity can be Approved unless it’sclosed won.

Objective 3.              IDEALLY (but not a MUST), when Operationsupdates the Approved Date, the system would automatically remove the RejectedReason and Rejected Date

  • December 08, 2009
  • Like
  • 0

Hi, 

 

I am fairly new to Apex development and programming in general.  My particular issue is that I am having trouble creating a test method for a custom controller.  I have a VF page with a simple form for submitting cases, and a custom controller to handle it.  I've deployed the VF page and controller to my developement org and everything works properly.  Now I want to deploy it to production but need test coverage.  

 

I have read through the Apex Developer's Guide and countless forum postings on developing test methods but I am still stumped.  

 

Below is the VF page, Custom Controller class, and my current (inadequate) test method.

 

VF Page: simple case submit form

 

<apex:page controller="SubmitCaseController"> <h1>Submit New Case</h1> <apex:form > <apex:pageMessages /> <table> <tr> <th>Your Name:</th> <td><apex:inputText value="{!c.SuppliedName}"/></td> </tr> <tr> <th>Your Email:</th> <td><apex:inputText value="{!c.SuppliedEmail}"/></td> </tr> <tr> <th>Your Account Number:</th> <td><apex:inputText required="true" value="{!acctNum}"/></td> </tr> <tr> <th>Title:</th> <td><apex:inputText required="true" value="{!c.Subject}"/></td> </tr> <tr> <th>Your Problem:</th> <td><apex:inputTextArea required="true" rows="5" value="{!c.Description}"/></td> </tr> <tr> <td><apex:commandButton value="Submit Case" action="{!submitCase}"/></td> </tr> </table> </apex:form></apex:page>

 

 Custom Controller: The general functionality is to use the acctnum field to match an existing account.  Then, find the appropriate contact by matching the account and email address.  Then insert the case.

 

public with sharing class SubmitCaseController { public Case c { get; set; } public String acctNum { get; set; } public SubmitCaseController() { c = new Case(); } public PageReference submitCase() { List<Account> accts = [SELECT Id FROM Account WHERE AccountNumber = :acctNum]; if (accts.size() != 1) { ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Invalid account number'); ApexPages.addMessage(msg); return null; } else { try { c.AccountId = accts.get(0).Id; // now look for an associated contact with the same email Contact cnt = [SELECT Id FROM Contact WHERE AccountId = :c.AccountId AND Email = :c.SuppliedEmail LIMIT 1]; if (cnt != null) c.ContactId = cnt.Id; // Specify DML options to ensure the assignment rules are executed Database.DMLOptions dmlOpts = new Database.DMLOptions(); dmlOpts.assignmentRuleHeader.useDefaultRule = true; c.setOptions(dmlOpts); // Insert the case INSERT c; return new PageReference('/thanks'); } catch (Exception e) { ApexPages.addMessages(e); return null; } } }}

 

 My current test method:

 

@isTestprivate class SubmitCaseControllerTests { public static testMethod void testSubmitCaseController() {PageReference pageRef = Page.PortalCaseSubmit; Test.setCurrentPage(pageRef); Account testaccount = new Account(name = 'Acme', AccountNumber='123456'); insert testaccount; Contact testcontact = new Contact(firstname='joe', lastname='smith', email='joe@smith.com'); insert testcontact; Case c; c.SuppliedName='Joe Smith'; c.SuppliedEmail='joe@smith.com'; c.Subject = 'Test'; c.Description = 'This is a test.'; String acctnum = '123456'; SubmitCaseController controller = new SubmitCaseController(); controller.submitcase(); Case cases = [Select ID, subject, description from Case Where account.id = :testaccount.id]; System.assertequals(cases.description, c.description); } }

 

My logic is to instantiate an account and contact and insert them into the database.  Then, mimic the process of someone completing the form and submitting it.  I could test both positive and negative results this way.  However, I am stumped as to how to populate the form fields and submit the form using Apex.  Any help would be appreciated.

 

Thanks,

 

Clint 

 

 

 

 

Hello, I've done quite a few validation rules, but I'm no expert and I'm currently stumped.  In our CASE object we have a custom picklist field which has analyst names.  The field is changed to the analyst that the case is being assigned to.  so lets say a issue is reported to our support center. A case is created by the helpdesk then they select the person from the L3 Analyst field to escalate the issue to.  The level 1 analyst saves the record and clicks on change owner to assign to the analyst selected for L3 .  This cause problems as sometimes the L3 analyst is on vacation or out sick.  I'm trying to create validation that if L3_Analyst_Assigned__c is equal to "John Doe" it checks a custom object i created to store a check box named John Doe.  If the check box is true then I want the validation rule to go off and tell the level 1 analyst that the person they are trying to assign the case to is not available.
 
 
I saw the VLOOKUP feature but to be honest with you I have read just about every post but i can't get it to work.  Any assistance would be greatly appreciated.  There might be a different way to accomplish my goal, but so far this is what I have been able to come up with:
 
AND(ISPICKVAL( L3_Analyst_Assigned__c , "John Doe"),

VLOOKUP( $ObjectType.Support_Analyst_Availability__c.Fields.John_Doe__c , $ObjectType.Support_Analyst_Availability__c.Fields.Name , ***not sure what to put here*** ))
 
John_Doe__c in the support analyst object is a checkbox.


Message Edited by bmartinez76 on 06-26-2008 02:00 PM
Hello, I'm trying to create some code for an S-control that checks the users profile and if not an administrator it redirects them to another page.  If the user is an admin it allows them to delete otherwise it will give them a message saying "only admins can delete".  The reason I want to do it this way is because we have a group that deals with cases and I wish to give them manage case ability but not delete.  I removed the delete button from their page layout but when you click on cases you can see the del link in the view layout and i can't remove it.  I am trying to override the delete button so that only a person with an admin profile can delete a case.
 
I have so far created a redirect (below) but can't seem to find coding on how to check the users profile when they click on the link.  Can someone assist me please?
 
(admin profile ID)
00e00000006okRY
 
Code:
<html>
<body> 
<script language="JavaScript">
<!-- 
window.parent.location.href = ("https://na5.salesforce.com/500/o");
-->
</script>
</body>
</html>

 
Hello everyone.  I am new to these boards and to S-Controls.  I am not a programmer per say,but I have been assigned to role of admin for my company.  I have so far done a great job setting up the objects and creating simple formulas and validation rules.  I am now trying to create a process in the opportunity tab that will fetch the renewal billing month from the account object and place it in the opportunity renewal billing month field. So when entering an opportunity, the person would look up the company and then once selected the S-Control would search the account object for that company and retrieve the renewal billing information and paste it on the opportunity.  I was told that an S-Control can achieve this.  If anyone can lead me in the right direction it would be greatly appreciated.  Thank you in advance.

Hi guys!

I need to create email template with links in the body. For example I want my email body to have name of account which would be not just a string but link (ordinary anchor: <a href=https://na1.salesforce.com/Account.ID>Account.Name</a>. Currently I'm generating email body programmatically (body={!Campaign_Description}, I fill in Campaign.Description field and then trigger workflow rule which sends email based on my custom email template. All this done programmatically). If I'm using ordinary Text-type email template and filling Campaign.Description field with string

    <a href=https://na1.salesforce.com/Account.ID>Account.Name</a>

than when I receive email its body is not recognized as HTML content and I see the whole string shown above with all tags - just plain text.

I tried to build Custom-type email template, but didn't achieve my point - I fill in Campaign.Description field with the same string but after receiving email I see that chars '<' and '>' are replaced with '&lt;' and '&gt;' respectively - smart action but I don't want that. As a result I see just plain text again - no link. .

So I wonder, is it possible in some way to get email which will contain links? May be my method of generating email body programmatically is not pretty good and some of you know better ways to accomplish that - please advice. Also may be you can advice how can I build merge template without programmatical building of its body and having links in it at the same time?

Any advices/comments/links are apreciated

  • January 12, 2005
  • Like
  • 0