• Stefan
  • NEWBIE
  • 50 Points
  • Member since 2007

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 52
    Replies

I am trying to create a custom field that links to an attachment in salesforce.

 

I did this through a custom URL field but the address is extremely lengthy.  Is there a way to create a hyperlink "click here"?

 

Thanks, 

We are loading external data via a nightly job from SQL Server using DBAmp.

 

Some of the fields we populate need to be picklists so that users can easily select filter criteria in reports.

 

Is there a way that I can change the pick list values automatically when new values get added in the source system?

 

 

  • March 10, 2010
  • Like
  • 0

I am struggling to understand the basics in Apex triggers. Can anyone tell me simply how I  should detect a field change. For example in the below. If the contact name has changed then I want to make some updates to the contact record.

 

trigger AfterUpdate on Contact (before update) {

If (Contact.Name changed)

}

}

 

 

  • January 25, 2010
  • Like
  • 0

 I'm complete beginner to Apex code and would appreciate some help.

 

I would like to refine the below code to:

  1. Trigger only whenPicklist field Contact.Status__c changes from 'Active' to 'Inactive'
  2. Change record type from Active to Inactive

 

trigger InactiveContact on Contact (before insert, before update) { private Contact[] newContact = Trigger.new; newContact[0].Original_Account__c = newContact[0].Accountid; newContact[0].Original_Owner__c = newContact[0].OwnerId; newContact[0].Original_Country_ID__c = newContact[0].Country__c; }

 

Also is there anywhere I can find examples of apex triggers.

 

  • January 20, 2010
  • Like
  • 0

I need to display the Account Description on a child custom object (Account Plan)

 

Salesforce doesn't seem to give me the option of creating a formula field, I guess because Account Description is a long text field.

 

Any suggestions for a workaround would be appreciated.

  • October 14, 2009
  • Like
  • 0

I currently have a link on the contact link section created by ExactTarget:

 

http://members.exacttarget.com/Integration/SalesforceUI/SFResubscribe.aspx?subtype=Contact&sfid={!Contact.Id}&sessid={!API.Session_ID}&sessurl={!API.Partner_Server_URL_60}

 

I would like to create this link as a formula field using Hyperlink() but am struggling with where to put the quote marks in this URL.

  • August 12, 2009
  • Like
  • 0

Is it possible to use a hyperlink field to link to a filtered report

 

I created a custom link : /00O4000000283d8?pv0={!Account.Id}

 

I would like to create a hyperlink something like the below:

 

IF( SAP_ProductCount__c >0,
HYPERLINK(/00O4000000283d8?pv0={!Account.Id}), "Click to view products"),
"")

I would appreciate advice how to achieve the following. I have installed Eclipse and Force.com but so far have not got that far with it, so would appreciate some ideas how I could implement the below and the steps required to get from Developer edition into Production:

 

On the Account I have two custom fields:

 

1. Client Relations - Lookup to user field

2. Client Relations Last visit date

 

I would like to update the "Client Relations Last visit date" when a Client Relations person creates an event.

 

Simple version would update the account date field (even if a date in future) with Event date when Account Client Relations id = Event Assigned to.

 

More complex version would only update field if <= Today (but update future event when became past) and update date when event was assigned to any user with a Client Relations profile.

How can I stop users from creating new Salesforce contacts from Outlook?

 

I would like them to be able to sync changes just not add new records.

 

We have some required fields in Salesforce but these are ignored whe adding a contact from Outlook.

  • April 22, 2009
  • Like
  • 0

I am following the instructions to install Force.com IDE here

 

Step 3 completes fine

 

But when I get to step 4. In search results I only see Force.com IDE. I do not see Europe Discovery Site.

 

If I check Force.com IDE I get the following error message:

 Force.com IDE (15.0.0.200902181452) requires plug-in "org.eclipse.wst.html.ui (1.0.0)", or compatible.

 

I have uninstalled, rebooted, installed several times.

  • March 17, 2009
  • Like
  • 0
I have a lookup field on Account whcih looks up a custom object.
 
I would like this field to be unique on the account record. Is there any way using validation that I can enforce this.
 
  • December 11, 2008
  • Like
  • 0
I am distributing an o_dictionary.xml file to users.

I can not find any instructions in the documentation which would allow me to add a registry entry to uncheck the Advanced Options for Events, Contacts and Tasks: Confirm record deletions & Confirm record changes and additions.

Does anyone know what code I should add to the XML file to achieve this?
  • October 08, 2008
  • Like
  • 0
I have created a new button on the related list on account to a custom object. When I save the new object I want the object to close and return to the account.
 
The following code opens the new object but throws an error: /a0E/e?retURL=%2F{!Account.Id}&saveURL=%2F{!Account.Id}&CF00N40000001fj0E={!Account.Id}
 
Account: 0014000000FurVB
Error: no matches found
 
0014000000FurVB is a valid Account ID
  • August 23, 2008
  • Like
  • 0
I am looking to improve the below S-Control taken from the AppExchange and am a bit out of my depth.
 
Looking to achieve the following when mass updating contact addresses from the Account:
 
1. Populate null values on account with null values on contact. Currently if I have Account state = null and Contact State = London. I end up with City = London, State = London which is incorrect.
 
2. Add a custom field to the update. I have a custom lookup field on Account and Contact (Country ISO Code).
 
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
<!--  
 AJAX  scontrol to update one or many contact records to match the parent account

 jan 25 2007 updated to new ajax toolkit, fix skin, test with more locales
 
-->
<title>Mass Change Contact Addresses</title>
<link  href="/dCSS/Theme2/default/common.css" type="text/css" rel="stylesheet" >
<link  href="/dCSS/Theme2/default/custom.css" type="text/css" rel="stylesheet" >
<script type="text/javascript" src="/js/functions.js"></script>
<script type="text/javascript" src="/js/setup.js"></script>

  <script type="text/javascript" src="/soap/ajax/8.0/connection.js"></script>

<script language="javascript"> 
<!--
function pageInit() {
 loadAccountInfo();
 setupForm();
}

var accId = "{!Account.Id}"; 
var accName = "{!Account.Name}"; 
var addStreet = ""; // this link is filled in by loadAccountInfo(), because it may be a multi line...
var retUrl = "{!Account.Link}"; 
var addZip = "{!Account.BillingPostalCode}"; 
var addCity = "{!Account.BillingCity}"; 
var addCountry = "{!Account.BillingCountry}"; 
var addState = "{!Account.BillingState}";

function loadAccountInfo() {
 var account = sforce.connection.retrieve(
  "Id, Name, BillingStreet, BillingPostalCode, BillingCity, BillingCountry, BillingState", "Account", ["{!Account.Id}"])[0];
 addStreet = account.get("BillingStreet"); // should not be a multi line

 var html = "<table width=70%><tr>";
 html += "<td width=35% nowrap valign=top class='dataLabel'>Account Name:</td>";
 html += "<td class='dataField'><a color='#FFFFFF' href='" + 
  retUrl + "' target=_blank>" + "{!Account.Name}" + "</a></td></tr><tr>";
 html += "<td class='bodyBold' colspan=5 nowrap>Address Information:</td>";
 html += "</tr><tr><td class='blackLine' colspan=5><img src='/s.gif'></td></tr><tr>";
 html += "<td width=35%  valign=top class='dataLabel'>Apply Address to Checked Contacts</td>";
 html += "<td valign=top colspan=4 class='dataField'>" + addStreet + "<br>";
 html += "{!Account.BillingCity}, ";
 html += "{!Account.BillingState} ";
 html += "{!Account.BillingPostalCode} <BR>";
 html += "{!Account.BillingCountry}</td>";
 html += "</tr></table>";
 document.getElementById("divAccountInfo").innerHTML = html;
} 

function cancelUpdate() { window.parent.parent.location.href = retUrl; }

function trim(string) { return string.replace(/(^\xA0*)|(^\s*)|(\s*$)/g,''); } 

function SelectChecked(form, element_name, value) { 
 var i = 0; for (i = 0; i < form.elements.length; i++) { 
  if (form.elements[i].name == element_name) { 
   form.elements[i].checked = value; 
  } 
 } 
} 

function IsChecked(form, element_name, value) { 
 var updateObjects = new Array();
 for (i = 0; i < form.elements.length; i++) { 
  if ((form.elements[i].name == element_name) && (form.elements[i].checked)) { 
   var contact = new sforce.SObject("Contact");
   contact.set("Id",form.elements[i].value);
   contact.set("MailingCity", addCity);
   contact.set("MailingStreet", addStreet);
   contact.set("MailingCountry", addCountry);
   contact.set("MailingPostalCode", addZip);
   contact.set("MailingState", addState);
   updateObjects.push(contact);
  } 
 } 

 try { 
  if (updateObjects.length > 0) { 
   var x = window.confirm("Are you sure you want to update "+ updateObjects.length +" record(s) —"); 
   if (x) { 
    var sr = sforce.connection.update(updateObjects); 
    window.parent.parent.location.href = retUrl; 
   } 
  } else { 
   alert("No Records will be updated"); 
   window.parent.parent.location.href = retUrl; 
  } 
 } catch (e) { alert('could not update contacts '+e); }
} 

//--> 
 </script>
<script language="javascript"> 
<!-- 
function setupForm() { //  Query to get Contact informaiont at this accont
 var qr = sforce.connection.query("Select Id, FirstName, LastName, MailingStreet, MailingCity, MailingPostalCode, MailingState, MailingCountry from Contact Where AccountId = '" + accId + "'");

 var docContents ="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"list\" >";  
 docContents += "<tr class=\"headerRow\">"; 
 docContents += "<th class=\"booleanColumn\" scope=\"col\"><input name=\"\" type=\"checkbox\" id=\"\" onClick=\"javascript:SelectChecked(document.forms['Multi_Contact'],'ids',this.checked)\" value=\"\"></td>"; 
 docContents += "<th nowrap class=\"dataCell\"> &nbsp;First Name</td>"; 
 docContents += "<th nowrap class=\"dataCell\"> &nbsp;Last Name</td>"; 
 docContents += "<th nowrap class=\"dataCell\"> &nbsp;Street</td>"; 
 docContents += "<th nowrap class=\"dataCell\"> &nbsp;City</td>"; 
 docContents += "<th nowrap class=\"dataCell\"> &nbsp;Zip Code</td>"; 
 docContents += "<th nowrap class=\"dataCell\"> &nbsp;State</td>"; 
 docContents += "<th nowrap class=\"dataCell\"> &nbsp;Country</td>"; 
 docContents += "</tr>";  

 if (qr.size > 0) {
  var records = qr.getArray('records');
  for (var i=0;i<records.length;i++) {
   var row;
   if (i%2 == 0) {
    docContents += '<tr onmouseover="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onblur="if (window.hiOff){hiOff(this);}" class="dataRow even ">';  // TODO how to make this look good on both skins
   } else { 
    docContents += '<tr onmouseover="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onblur="if (window.hiOff){hiOff(this);}" class="dataRow odd ">';  // TODO how to make this look good on both skins
   } 
   contact = records[i];

var tabCol = [contact.get("Id"), contact.get("FirstName"), contact.get("LastName"), contact.get("MailingStreet"), contact.get("MailingCity"), contact.get("MailingPostalCode"), contact.get("MailingState"), contact.get("MailingCountry")];
   docContents += "<th class=\"booleanColumn dataCell\" scope=\"row\" ><input type=\"checkbox\" name=\"ids\" value=\"" + tabCol[0] + "\" id=\"ids\"> </td>"; 
   for (var j=1;j<tabCol.length;j++) {
    docContents += "<td class=\"dataCell\" >&nbsp;" + tabCol[j] + "</td>"; 
   } 
   docContents += "</tr>";
   
  }
  docContents += "</table>";
 }     
 document.getElementById("divTableHeader").innerHTML = docContents;
 
 docContents = ""; 
 docContents += '<INPUT class="button" id="button1" onclick="javascript: IsChecked(document.forms[\'Multi_Contact\'],\'ids\',this.checked)" type="button" value="Update" name="Button1">';
 docContents += '&nbsp;&nbsp;<INPUT class="button" id="button2" onclick="javascript: cancelUpdate()" type="button" value="Cancel" name="Button2">';
 document.getElementById("divButtons").innerHTML = docContents;
}
//--> 
</script>
</head>
<body vLink="#000000" aLink="#99cc00" link="#000000" onload="pageInit()" class="contact" >
 <FORM id="Multi_Contact">  
<div class="bPageTitle">
<div class="ptBody secondaryPalette">
<div class="content">
<img title="Contact" class="pageTitleIcon" alt="Contact" src="/s.gif"/>
<h1 class="pageType noSecondHeader">Update Contact Addresses</h1>
<div class="blank"> </div>
</div>
<div class="links">
<a title="Help for this Page (New Window)" href="javascript:openPopupFocusEscapePounds('/help/doc/user_ed.jsp–loc=help&target=contacts_merge.htm&section=Contacts', 'Help', 700, 600, 'width=700,height=600,resizable=yes,toolbar=yes,status=no,scrollbars=yes,menubar=yes,directories=no,location=no,dependant=no', false, false);">
</a>
</div>
</div>
<div class="ptBreadcrumb" >

</div>
</div>

<div class="bNext">
 <div class="withFilter">
  <div class="clearingBox"></div>
 </div>
</div>

 <div id="divAccountInfo"></div>

<div class="bPageBlock secondaryPalette">
 <div class="pbHeader">
  <table cellspacing="0" cellpadding="0" border="0">
  <tbody>
  <tr>
  <td class="pbTitle">
  </td>
  <td class="pbButton" id="divButtons" >
  </td>
  <td class="pbHelp">
  </td>
  </tr>
  </tbody>
  </table>
 </div>

 <div class="pbBody" id="divTableHeader" ></div>
 <div class="pbFooter secondaryPalette"><div class="bg"></div></div>
</div>


</FORM> </body>
</html>

 
Can anyone help with the code for a new button to override the Account tab New Account button.
 
I am looking to populate a custom Division list field on the Account with the users division.
I have added a language list box to the contact page: English, Italian, French
 
I have added a formula field and want to populate this:
 
If Saluation = Mr. and Language = Italian
           Egregio Dottor LastName
 
If Saluation = Mrs. and Language = Italian
           Gentile Dottoressa Last Name
 
If Saluation = Mr. and Language = English
            Dear Mr. LastName
 
If Saluation = Mrs. and Language = English
            Dear Mrs. LastName
 
How do I write a formula to handle this, I am running into error messages because these fields are pick lists
 
 
 
  • March 13, 2008
  • Like
  • 0
Can't find any option to extract opportunity tab settings. Is this possible?
  • March 03, 2008
  • Like
  • 0
I get a message reading:
 
id from RevenueForecast where StartDate > 2007-12-31T00:00:00.000Z
value of filter criterion for field 'StartDate' must be of type date and should not be enclosed in quotes
 
This used to work!
 
 
  • January 23, 2008
  • Like
  • 0
I have a custom object with fields:
 
Sap Number: 10000
Company: XYZ Company Ltd
 
I would like to put a field on account page to store SAP Number. However I would like to be able to look up using characters e.g. XYZ
 
This does not seem possible using standard functionality, I am wondering whether it is possible using S Controls....
 
Regards
Stefan
  • November 27, 2007
  • Like
  • 0

I am trying to use a button to update opportunity stage to Finance Approved. What is wrong with the below code which gives me an error message: Invalid Field: No such column 'Stage' on entity 'opportunity'

<html>
<head>
<script src="/soap/ajax/9.0/connection.js"></script>
<script language="JavaScript">
var temp= new sforce.SObject("Opportunity");
temp["Id"]="{!Opportunity.Id}";
temp["Stage"]="Finance Approved";
try
{ sforce.connection.update([temp]);
} catch(e)
{ alert(e)
}
window.top.location.href = "/{!Opportunity.Id}";
</script>
</head>
</html>

  • October 30, 2007
  • Like
  • 0
This sounds very basic but I can not find an example of how to do this.
 
I want to put a button on the Opportunity detail page Button Section. When clicked this should set custom checkbox field EmailDistribute_c to true.
 
(EmailDistribute is linked to workflow to send an HTML email to Account Team, Account owner etc.)
 
 
  • October 09, 2007
  • Like
  • 0

We are loading external data via a nightly job from SQL Server using DBAmp.

 

Some of the fields we populate need to be picklists so that users can easily select filter criteria in reports.

 

Is there a way that I can change the pick list values automatically when new values get added in the source system?

 

 

  • March 10, 2010
  • Like
  • 0

I am struggling to understand the basics in Apex triggers. Can anyone tell me simply how I  should detect a field change. For example in the below. If the contact name has changed then I want to make some updates to the contact record.

 

trigger AfterUpdate on Contact (before update) {

If (Contact.Name changed)

}

}

 

 

  • January 25, 2010
  • Like
  • 0

 I'm complete beginner to Apex code and would appreciate some help.

 

I would like to refine the below code to:

  1. Trigger only whenPicklist field Contact.Status__c changes from 'Active' to 'Inactive'
  2. Change record type from Active to Inactive

 

trigger InactiveContact on Contact (before insert, before update) { private Contact[] newContact = Trigger.new; newContact[0].Original_Account__c = newContact[0].Accountid; newContact[0].Original_Owner__c = newContact[0].OwnerId; newContact[0].Original_Country_ID__c = newContact[0].Country__c; }

 

Also is there anywhere I can find examples of apex triggers.

 

  • January 20, 2010
  • Like
  • 0

I created 4 custom fields (check boxes) on the Opportunity page for different tax scenarios my company has:

GST

GST & PST
HST
Miami Dade Tax

 

I need to prevent the opportunity from being saved if 2 or more check boxes are selected, while still being allowed to save the opportunity if no check boxes are selected.  Any idea how I would do this?

 

FYI - I had started off with a picklist, but unfortunately you cannot write IF statements for picklists.

Error: Field TaxSelect is a picklist field. Picklist fields are only supported in certain functions.
  • December 15, 2009
  • Like
  • 0

I am trying to create a custom field that links to an attachment in salesforce.

 

I did this through a custom URL field but the address is extremely lengthy.  Is there a way to create a hyperlink "click here"?

 

Thanks, 

Hi, We recently moved our CRM to sales force, I have found everything pretty easy and straight forward. However I have a issue inside the opportunity column. Basically we have a pick list for Probability it is set in percentages 10% 20% 30% etc I'm basically trying to multiply field based on whatever percentage they select.

 

I know pick lists have issues with being used in formulas here is what I am trying to do

 

RandomNum  *  Value(text(Prcentagepicklist)) 

 

Basically I get #err . If I do what I believe the math would be I don't see how the system is messing this up but I really don't know to much about how sales force manipulates values. 

Can some help me see if they can produce a value. The randomnum is a currency normally like 200,000.  

 

Hi folks,

 

I've got a custom object which has seven different record types, whose names are exactly as follows:

 

Child assessment

Child 8-session evaluation

Child final evaluation

Parent assessment

Parent evaluation

School assessment

School evaluation

 

These can obviously be split into three broad categories - Child, Parent and School, and I'm wanting to create a custom formula field which will do just that for reporting, but I'm struggling on the syntax of the nested IF/OR statements, using record type IDs for each of these.

 

The formula I've gone with so far is:

 

=IF

  (OR

     (Record Type = "Parent assessment", "Parent evaluation"),"parent",

        (IF

           (OR(Record Type = "School assessment", "School evaluation"),"School"),"child))

 

 

I'm typing this out from memory so I may have missed out a parenthesis or two, that's not a big deal, but when I plugged this into my formula editor, it basically said that it was expecting a boolean, which I assume is relating to my record type names.  I couldn't work out where to find my record type ID numbers, else I'd have used them instead of the record type names.

 

Any thoughts?

 

Many thanks,
Charlotte

 

I currently have a link on the contact link section created by ExactTarget:

 

http://members.exacttarget.com/Integration/SalesforceUI/SFResubscribe.aspx?subtype=Contact&sfid={!Contact.Id}&sessid={!API.Session_ID}&sessurl={!API.Partner_Server_URL_60}

 

I would like to create this link as a formula field using Hyperlink() but am struggling with where to put the quote marks in this URL.

  • August 12, 2009
  • Like
  • 0

Is it possible to use a hyperlink field to link to a filtered report

 

I created a custom link : /00O4000000283d8?pv0={!Account.Id}

 

I would like to create a hyperlink something like the below:

 

IF( SAP_ProductCount__c >0,
HYPERLINK(/00O4000000283d8?pv0={!Account.Id}), "Click to view products"),
"")

I get a message reading:
 
id from RevenueForecast where StartDate > 2007-12-31T00:00:00.000Z
value of filter criterion for field 'StartDate' must be of type date and should not be enclosed in quotes
 
This used to work!
 
 
  • January 23, 2008
  • Like
  • 0
Is this possible? Trying to subtract the smaller date from the larger date, then divide by 30 to get the approximate number of months between 2 dates. Can't figure out how to convert the date value to an integer to do this....or is there another way completely?