• Applauseguy
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
I have a custom object that contains Role information for contacts.  Each contact may have several role records.  I would like to use a Validation rule or Workflow rule to check when a value is being added to a contact that the same value has not already been assigned to that contact.  The role values are controlled by a picklist, and the object has a master relationship to Contact.  Any assistance would be appreciated.
Hi.  I'm in the process of parsing our First and Last name fields, removing Middle initials from first name and Generation and suffix data from the last name field.  I will be creating new custom fields to house this parsed data and need to cancatenate them back into a final full name field.  We work with attorneys, and correct presentation is critical.
 
Here is a sample of my data after parsing.  The Null's are actually empty values in SFDC but appear in these sql samples because they are formula results.
 
FullNameFirstNMIddleNLastNGenSuf
Veronica G. Kayne, Esq.VeronicaG.KayneNULLEsq.
Richard C. Nelson, Esq.RichardC.NelsonNULLEsq.
Angel Gomez, III, Esq.Angel GomezIIIEsq.
David Jacobs, Esq.David JacobsNULLEsq.
 
The FullName field above represents how I need the data to look after concatenation.  I am trying to perform the creation of this string in a Workflow rule Action step. 
 
Here is my current attempt:
 
FirstName &Case(Len(Name_Middle__c),0,""," " &  Name_Middle__c) &" "& LastName & " " & CASE(Name_Generation__C,"",CASE(Name_Suffix__C,"","",CASE(Name_Generation__C,"","",", " & Name_Generation__C & ", " & Name_Suffix__C)))
 
It generates this error on Syntax check
 
 Error: Field Name_Generation__c is a picklist field. Use it with an ISPICKVAL() or CASE() function instead. Error: Field Name_Generation__c is a picklist field. Use it with an ISPICKVAL() or CASE() function instead.
 
I have tried numerous itterations of Case, If, and IsPickVAl to no avail.
 
Any recommendations will be greatly appreciated.
 
Chuck Holm
Rust Consulting Inc
 
Hi all.  I've recently downloaded and deployed Attachments Manager, but I can't seem to figure out what I need to do to access it.  When I look at my list of Exchange apps, it's in there, but I can't find any objects related to it.  Any thoughts.  Am I missing the obvious.  There isn't any reference to it in my list of available apps or tabs either.
 
Thanks
I am unable to complete the installation because I get the attached message
 
 Apex Eclipse Toolkit (8.0.2002) requires plug-in "org.apache.axis"
 
 
Here's my full scontrol code to link a file as an attachment without uploading the file onto Salesforce. It saves SF storage space and upload/download time for large files. Most importantly, it relates documents to the appropriate Salesforce object and viewed instantaneously.
 
To use the code, you need to add your own way of parsing the URL for the parentID (eid) parameter, and base64 encoding (we have these in our common library which we bring in using !INCLUDE). Other than that it's good to go and will attach to any parent having attachments. Create a link that calls the scontrol. Here's a sample link we call Link Attachment:
 
Code:
{!URLFOR( $SControl.MUSW__LinkAttachment  , MUSW__Permit__c.Id, [debug= $User.MUSW__Debug__c, 
stepthrough= $User.MUSW__Step_Through__c ])}
 
The Case Detachifier app on the appExchange gave me the idea for the placeholder attachment. It's seemless to the user, except if the file was moved or removed in the user's network (link is effectively broken). Files added under the Notes & Attachments related list have the word (LINK) after the filename to show it is not stored on Salesforce.
 
We still cannot find a way to customize the Notes and Attachment section to add or overwrite their "Attach File" buttons so it remains as a link on the detail page instead of in the related list. Next step for us is having a tighter integration with a file repository/management with choices of folders, etc.
 
James Wikkerink
Municipal Software
 
Code:
<html>
<head>
 <title>Link Attachment</title>
 <link href="/dCSS/Theme2/default/common.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet">
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/8.0/connection.js"></script>
    {!INCLUDE($SControl.MUSW__lgmCommon)}
    <script id="clientEventHandlersJS" language="javascript">
    <!--  
var b64 = new lgmBase64();

function setup() {

 lgm.href.getParameters();
 
}
function submit2(fullFileName) {
var fileName = "";
var placeholder = "";
var nameSuffix = " (LINK)";
 
 //get just file name
 if (fullFileName.indexOf('/') > -1)
        fileName = fullFileName.substring(fullFileName.lastIndexOf('/')+1,fullFileName.length);
    else
        fileName = fullFileName.substring(fullFileName.lastIndexOf('\\')+1,fullFileName.length);
 
 //make filename URL friendly
 URLfullFileName = "file:\/\/" + fullFileName.replace(/\\/g,"/");
 
 //confirm if want to link to a local file
 if ((fullFileName.indexOf("C:\\") > -1)  || (fullFileName.indexOf("D:\\") > -1)) {
 
  var x = window.confirm("Are you sure you want to link to a local file that no other users can access—"); 
  if (!x)
   return true;
  else
   nameSuffix = " (LOCAL LINK)";
 }
 
 if (URLfullFileName.indexOf("'") > -1 ) {
  alert("File names or paths containing single quotes (') are not allowed. Please rename file name or path.");
 } else {
 
  placeholder = "<html><head><meta http-equiv='refresh' content='1;url=" + URLfullFileName + "'></head>"+
     "<body><br><center>Opening file <a href='" + URLfullFileName + "'>" + URLfullFileName + "</a> <br>" +
     "Click link if file does not automatically open.</center></body></html>";
  
  var attachmentRecord = new sforce.SObject("Attachment"); 
  attachmentRecord["ParentId"] = lgm.href.param["eid"];
  attachmentRecord["Name"] = fileName + nameSuffix;
  attachmentRecord["ContentType"] = "text/html";
  attachmentRecord["IsPrivate"] = false;
  attachmentRecord["Body"] =b64.encode(placeholder);// b64.encode(documentContent)
  
  
  try {
   var error = sforce.connection.create([attachmentRecord]);
   if (error.toString().indexOf("errors") != -1 ) {
    throw ("Document Save Error: " + error.toString());
   }
   
   opener.location.reload();
   if (lgm.debug.flag != true ) { //see debug statements remaining
    window.close();
   }
   
  }
  catch (err) {
   addMessage(err.toString());
   retval = false;
  }
 }
}
function isUrl(s) {
 var regexp = /(ftp|http|https|file):\/\/(\w+:{0,1}\w*@)–(\S+)(:[0-9]+)˜(\/|\/([\w#!:.™+=&%@!\-\/]))?/
 return regexp.test(s);
}

//-->
</script>
</head>

<body onload="setup()">
  <form id = "myform" name = "myform">
   <div class="lookup">
    <div class="bPageTitle">
     <div class="ptBody primaryPalette">
      <div class="content">
       <img src="/s.gif" alt="Lookup"  class="pageTitleIcon">
       <h1>Link Attachment</h1>
      </div>
     </div>
    </div>
    <table cellspacing = 0 cellpadding = 0 border = 0>
     <tr>
      <td width = 5>&nbsp;</td>
      <td width = 100% style = "padding:2px 10px 2px 2px; font-size: 9pt; font-weight: bold; color:#333;">Select the File</td>
      
      <td width = 5>&nbsp;</td>
     </tr>
     <tr>
      <td width = 5>&nbsp;</td>
      <td width = 100% style = "padding:2px 10px 2px 2px; font-size: 9pt; color:#333;">Ensure file path is accessible to entire organization.
      <br>Note: Do not move or rename file after linking
      <td width = 5>&nbsp;</td>
     </tr>
     <tr>
      <td width = 5>&nbsp;</td>
      <td width = 100%>&nbsp;</td>
      <td width = 5>&nbsp;</td>
     </tr>
     <tr>
      <td>&nbsp;</td>
      <td align = left><input  id="file" name="file" size="35" title="Type the path of the file or click the Browse button to find the file." type="file" /></td>
      <td>&nbsp;</td>
     </tr> 
     <tr>
      <td>&nbsp;</td>
      <td align = center>&nbsp;</td>
      <td>&nbsp;</td>
     </tr>
    
     <br>
     <tr>
      <td>&nbsp;</td>
      <td align = center>
       <div class="pBody" align = center>
        <input id = "submit" Name = "submit" class="btn" type=button value="Submit" onClick="submit2(myform.file.value);" disable = "true">
        <input id = "cancel" Name = "Cancel" class="btn" type=button value="Cancel" onClick="window.close();" disable = "true">     
       &nbsp;&nbsp;&nbsp;&nbsp;
       </div> 
       
      </td>
      <td>&nbsp;</td>
     </tr>
    </table>       
   </div>
   <DIV id="divDebug"></DIV> 
  </form> 
 </body>
</html>