• blakeLL
  • NEWBIE
  • 25 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 11
    Replies

I want to add the Loading animation to all of my buttons while salesforce is thinking but hasn't processed and loaded the next page:

 

Just like when you Click save on a case, Upload an attachment, etc.

I have been using a few fields on my opportunities to track certain rates for some core products we sell. I am setting up the use of opportunity products, so the old fields will not be needed.

 

I've seen some functionality in salesforce that will tell me where objects, or pages are used. How can I figure out what reports, pages, formulas, workflow rules, approval processes, etc. use a particular field?

I have a Visualforce page rendering as PDF. I have two problems:

 

1) One of the pages has text that fits completely on the page, but for whatever reason the page wraps to a new blank page. How can I make the pdf stop after that last element.

 

<table width="100%" cellspacing="0" cellpadding="0" class="signaturebox1">
<tr>
<td colspan="2" width="46%" class="signatureheading1">
Authorized Agent for LetterLogic, Inc.:<br /><br />
</td>
<td>&nbsp;</td>
<td colspan="2" width="46%" class="signatureheading1">
Authorized Agent for {!opportunity.account.name}:<br /><br />
</td>
</tr>
<tr>
<td class="signatureline1">Signature<br /><br /></td>
<td class="signatureline1">Date<br /><br /></td>
<td>&nbsp;</td>
<td class="signatureline1">Signature<br /><br /></td>
<td class="signatureline1">Date<br /><br /></td>
</tr>
<tr>
<td class="signatureline1bot">Name</td>
<td class="signatureline1bot">Title</td>
<td>&nbsp;</td>
<td class="signatureline1bot">Name</td>
<td class="signatureline1bot">Title</td>
</tr>
</table>
</apex:page>

 

2) I would like to reduce the margins of at least that page to be more like 0.25 inches or 0.50 inches. Seems like the default is 0.75 inches. The PDF is cutting off the text.

 

Thank you!

Here is my trigger:

 

 

trigger SetDefaultAgreementTerms on Opportunity (before insert) {

for (Opportunity o : trigger.new) {
if (o.RecordTypeId == '012300000002OYW') {
o.Agreement_TermsRTF__c = 'test';
}
}
}


And here is my test

 

@isTest
private class ProposalTestSuite {

static testMethod void SetDefaultAgreementTermsTest() {

test.startTest();

Account a = new account();
a.Name = 'Test1DefaultAgreementAccount';
a.RecordTypeId = '01230000000SZKW';
a.Type = 'Customer';
String acctid;

try{
insert a;
acctid = a.id;
}
catch(System.DMLException e){
system.assert(false,'Error inserting account');
}

//validate single insert
Opportunity o = new Opportunity();
o.RecordTypeId = '012300000002OYW';
o.name = 'Test2DefaultAgreementOpp';
o.AccountId = acctid;
o.StageName = 'Prospect- B';
o.CloseDate = Date.today();
try{
insert o;
}catch(System.DMLException e){
system.assert(false,'Error inserting opportunity');
}

Opportunity NewO = [select id,Agreement_TermsRTF__c from Opportunity where id= :o.Id];

System.assertEquals(NewO.Agreement_TermsRTF__c, 'test');

test.stopTest();

}
}

 

 I have tried multiple steps to deploy these. I can't save the trigger to the server because of code coverage, and I can't get the test to pass either.

 

In the Apex Test Runner, I get  System.Exception: Assert Fale: Expecte null, ACtual: test

 

It seems that my opportunity trigger isn't working, but I don't really know.

 

Can someone help me get from here to a deployed trigger?

 

 

Message Edited by blakeLL on 02-19-2010 11:48 AM

I have a controller with the following call:

public ProposalController() { opportunity = [ select o.AccountId, o.Account.BillingCity, o.Account.BillingState, o.Account.BillingStreet, o.Account.BillingPostalCode, o.Account.Industry, o.Account.Name, o.Contract_Date__c, o.HasOpportunityLineItem, o.Id, o.Pieces_per_Month__c, o.Agreement_Terms__c, (SELECT contact.name, contact.Title,contact.email FROM OpportunityContactRoles where isprimary = true), (SELECT PriceBookEntry.Name, PriceBookEntry.UnitPrice,PriceBookEntry.Product2.ContractSection__c FROM OpportunityLineItems) from opportunity o where id = :ApexPages.currentPage().getParameters().get('id')]; }

 

 

If I try to add a rich text field ot the query and save in Force.com ide:

 

public ProposalController()

{ opportunity = [ select o.AccountId, o.Account.BillingCity, o.Account.BillingState, o.Account.BillingStreet, o.Account.BillingPostalCode, o.Account.Industry, o.Account.Name, o.Contract_Date__c, o.HasOpportunityLineItem, o.Id, o.Pieces_per_Month__c, o.Agreement_TermsRTF__c, (SELECT contact.name, contact.Title,contact.email FROM OpportunityContactRoles where isprimary = true), (SELECT PriceBookEntry.Name, PriceBookEntry.UnitPrice,PriceBookEntry.Product2.ContractSection__c FROM OpportunityLineItems) from opportunity o where id = :ApexPages.currentPage().getParameters().get('id')]; }

 

for elipse I get the following error:

 

Save error: No such column 'Agreement_TermsRTF__c' on entity 'Opportunity'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

I would like to have my visual force page show this field, but I can't get the controller to allow it yet. It also is not showing up in the salesforce.schema view for the Force IDE.

Message Edited by blakeLL on 02-15-2010 12:53 PM
I have a formula that is calculating a due date for a case, based off of the status and type of case.
 
Problem is that I am hitting a compile limit when I create the custom formula as a custom case field. I need to use the calculated date in case views, so I am not thinking a s-control will work, but I could be wrong.
 
Can some one tell me the best way to create a formula for a case and work around the size limitation?
I have created 4 custom objects for a series of checklist involving customer implementation. Each will be related to a case, but also to the account. The problem is that the account detail page is starting to look too cluttered and segmented. Is there a way to combine these custom objects under one heading?
I can't seem to find how to add my custom object to the drop downs for create new on the home page and console.
I know about the master-detail relationship field and the lookup relationship field, but I have what I believe is a different scenario. I have a custom object that contains a list of inventory parts that our customers use. The problem is that come customers use multiple parts, and some parts are used by multiple customers.
 
Seems that if I have only figured out a one-to-many relationship for these fields... can I do more than that, and how?
I have built a custom s-control that refers to text values stored in a custom text field for accounts. It is apparently only showing info if the custom text field is present. I would like to not have to show the custom text field on the detail page, because the info is redundant. Can someone help?
 
Here is my HTML s-control that is set to display on the Accounts Detail Page:
 
<html>
<head>
{!INCLUDE($SControl.Resize_Iframe_head)}
<style>
body,td {font-size = 12;background-color: #F3F3EC;}
.dataCol {background-color:#F3F3EC; padding:2px 2px 2px 10px; text-align:left; width:32%;}
.data2Col {padding: 2px 2px 2px 10px; text-align: left; width: 82%;}
.col02 {border-right: 20px solid #F3F3EC;}
th.last, td.last {border-bottom:none;}
</style>
<script type="text/javascript">
var dirlist;
dirlist = "{!Account.Report_Directory__c}";
dirlist = dirlist.replace(/ /g, "");
var valueArray = dirlist.split(",");
for(var i=0; i<valueArray.length; i++){
  document.write ("<a href='file://spoolers/reportspsx/" + valueArray[i] + "'>" + valueArray[i] + "</a>");
  if (i < valueArray.length-1) { document.write (", ");}
}
</script>
</head>
<body onload="{!INCLUDE($SControl.Resize_Iframe_onload)}">
</body>
</html>

In a formula on a custom case field, can I use the most recent date/time stamp of when a case was changed to a certain status. For example, I want to have a formula that is based off of the last time a case was set to STATUS X.

I have a custom field on accounts that stores a list of directories, for example: "letters1, letters2, letters3, statements" and I would like to have it turn into a list of hyperlinks that point to local network connections. I thought I would create a formula field that turns this list into:
HYPERLINK ("file://xxx/" & "letters1","letters1"), HYPERLINK ("file://xxx/" & "letters2","letters2"), HYPERLINK ("file://xxx/" & "letters3","letters3"), HYPERLINK ("file://xxx/" & "statements1","statements1")
 
Is there a way to work with a list and perform functions on it like this?

Here is my trigger:

 

 

trigger SetDefaultAgreementTerms on Opportunity (before insert) {

for (Opportunity o : trigger.new) {
if (o.RecordTypeId == '012300000002OYW') {
o.Agreement_TermsRTF__c = 'test';
}
}
}


And here is my test

 

@isTest
private class ProposalTestSuite {

static testMethod void SetDefaultAgreementTermsTest() {

test.startTest();

Account a = new account();
a.Name = 'Test1DefaultAgreementAccount';
a.RecordTypeId = '01230000000SZKW';
a.Type = 'Customer';
String acctid;

try{
insert a;
acctid = a.id;
}
catch(System.DMLException e){
system.assert(false,'Error inserting account');
}

//validate single insert
Opportunity o = new Opportunity();
o.RecordTypeId = '012300000002OYW';
o.name = 'Test2DefaultAgreementOpp';
o.AccountId = acctid;
o.StageName = 'Prospect- B';
o.CloseDate = Date.today();
try{
insert o;
}catch(System.DMLException e){
system.assert(false,'Error inserting opportunity');
}

Opportunity NewO = [select id,Agreement_TermsRTF__c from Opportunity where id= :o.Id];

System.assertEquals(NewO.Agreement_TermsRTF__c, 'test');

test.stopTest();

}
}

 

 I have tried multiple steps to deploy these. I can't save the trigger to the server because of code coverage, and I can't get the test to pass either.

 

In the Apex Test Runner, I get  System.Exception: Assert Fale: Expecte null, ACtual: test

 

It seems that my opportunity trigger isn't working, but I don't really know.

 

Can someone help me get from here to a deployed trigger?

 

 

Message Edited by blakeLL on 02-19-2010 11:48 AM

Hi all:

  Does anyone know how to format a number in Apex so that a number in VF appears correctly...

for example 25000 appears 25,000.00

Anyone have an idea or did this already??

Thanks

Let MMA guide you

I have a custom object called "Maintenance Window", which includes a start date/time and end date/time for the event.  Typically these are 1-6 hour long events, but the often cross the midnight boundary.  My current project is to map these events on to a calendar -- so that a user can see all the upcoming (or historic) maintenance windows on a monthly calendar, at a glance.  The Maintenance Window detail records and Calendar need to stay in synch, so that if the start or end date/time fields on the Maintenance Window are updated, the calender will be updated to reflect this information, as well.
 
I've yet to decide where I'm going to map these events -- either to a public calendar in SFDC, a group calendar in Google, or a PHP calendar.  I'm leaning toward the latter, I think.  We're already copying the data over manually to a PHP calendar (it's this manual copy / data duplication that I'm looking to eliminate), and I really like the visual appearance of the PHP calendar (and the ability to control the font colors and details in the PHP Calendar). 
 
Still, as much as I like the PHP calendar, my preference is to keep everything in one tool -- SFDC.  Less databases / servers to maintain, yeah? 
 
Have any of you done something like this?  Which of these options (or something completely different) did you go with, and why?  What were your biggest pitfalls and "if I had to do it all again, I would have ..."
I have a formula that is calculating a due date for a case, based off of the status and type of case.
 
Problem is that I am hitting a compile limit when I create the custom formula as a custom case field. I need to use the calculated date in case views, so I am not thinking a s-control will work, but I could be wrong.
 
Can some one tell me the best way to create a formula for a case and work around the size limitation?
I have created 4 custom objects for a series of checklist involving customer implementation. Each will be related to a case, but also to the account. The problem is that the account detail page is starting to look too cluttered and segmented. Is there a way to combine these custom objects under one heading?
I have built a custom s-control that refers to text values stored in a custom text field for accounts. It is apparently only showing info if the custom text field is present. I would like to not have to show the custom text field on the detail page, because the info is redundant. Can someone help?
 
Here is my HTML s-control that is set to display on the Accounts Detail Page:
 
<html>
<head>
{!INCLUDE($SControl.Resize_Iframe_head)}
<style>
body,td {font-size = 12;background-color: #F3F3EC;}
.dataCol {background-color:#F3F3EC; padding:2px 2px 2px 10px; text-align:left; width:32%;}
.data2Col {padding: 2px 2px 2px 10px; text-align: left; width: 82%;}
.col02 {border-right: 20px solid #F3F3EC;}
th.last, td.last {border-bottom:none;}
</style>
<script type="text/javascript">
var dirlist;
dirlist = "{!Account.Report_Directory__c}";
dirlist = dirlist.replace(/ /g, "");
var valueArray = dirlist.split(",");
for(var i=0; i<valueArray.length; i++){
  document.write ("<a href='file://spoolers/reportspsx/" + valueArray[i] + "'>" + valueArray[i] + "</a>");
  if (i < valueArray.length-1) { document.write (", ");}
}
</script>
</head>
<body onload="{!INCLUDE($SControl.Resize_Iframe_onload)}">
</body>
</html>

In a formula on a custom case field, can I use the most recent date/time stamp of when a case was changed to a certain status. For example, I want to have a formula that is based off of the last time a case was set to STATUS X.

I have a custom field on accounts that stores a list of directories, for example: "letters1, letters2, letters3, statements" and I would like to have it turn into a list of hyperlinks that point to local network connections. I thought I would create a formula field that turns this list into:
HYPERLINK ("file://xxx/" & "letters1","letters1"), HYPERLINK ("file://xxx/" & "letters2","letters2"), HYPERLINK ("file://xxx/" & "letters3","letters3"), HYPERLINK ("file://xxx/" & "statements1","statements1")
 
Is there a way to work with a list and perform functions on it like this?