• Geisner@google.com
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi there,

 

I could use some help with an approach to this problem. We have a custom link on our page layouts that uses visualforce to open up and submit a form. That form needs to be translated into 12 or so languages, so that the links can be used globally. The problem is that we've set up our page layouts globally by region: NA, EMEA, APAC, LATAM, not by language. This has worked fine, but now I think we would have to recreate all our page layouts by language instead of by region, and this would be a big overhaul for us. I don't see any way around it, but I thought someone might have a workaround or a suggestion. Thanks!

 

Gabe Eisner

SFDC Admin for Google Adwords Telesales

How do I tell if I'm approaching my org's validation rule limit? Can I use the Workbench for that?

I can't seem to find where in Setup that info would be. It doesn't seem to be in Company Info. Thanks.

Hi there,

 

I could use some help with an approach to this problem. We have a custom link on our page layouts that uses visualforce to open up and submit a form. That form needs to be translated into 12 or so languages, so that the links can be used globally. The problem is that we've set up our page layouts globally by region: NA, EMEA, APAC, LATAM, not by language. This has worked fine, but now I think we would have to recreate all our page layouts by language instead of by region, and this would be a big overhaul for us. I don't see any way around it, but I thought someone might have a workaround or a suggestion. Thanks!

 

Gabe Eisner

SFDC Admin for Google Adwords Telesales

I am batching the data loader to do upserts to five objects, using external IDs that need to be unique so that I can make sure to reference the same salesforce records every time I run the upsert, since each time, some of the records will have some different values.

 

The problem I'm having is that sometimes the records are updated when a match is found that already exists, and sometimes it gives me the error "duplicate value found". It's about a 50/50 split between the outcome that I want and the error messages. In theory, I shouldn't ever get any error messages when I re-run the upsert, since it should just update the records to the new values.

 

Removing the unique restriction on the external ID is not an option for me, as it just defeats the purpose of me using one completely if more than one record can have it.

 

I haven't been able to find anything so far, so any help on this would be greatly appreciated.

I am trying to change case ownership by providing a custom "ACCEPT" button on the Case Page Layout page so that the user can accept the case without having to go through multiple steps of searching and then accepting the case being reviewed.
 
To do so, I have created a new S-Control which was placed on the Page Layout for Case object. I am able to display the current field values for this case as you may see from my code. However, when the code attempts to execute the updateCaseOwner() Javascript function, nothing happens. Any clues what I may be doing wrong?
 
Here is the source code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <link href="/dCSS/Theme2/default/common.css" type="text/css" media="handheld,print,projection,screen,tty,tv"  rel="stylesheet" >
    <link href="/dCSS/Theme2/default/custom.css" type="text/css" media="handheld,print,projection,screen,tty,tv"  rel="stylesheet" >
<script type="text/javascript" src="/js/functions.js"></script>
<script type="text/javascript" src="/soap/ajax/10.0/connection.js"></script>
<script type="text/javascript">
   /*  Author = Komal T
    Date = Jan 16, 2009
    Description = Use this S Control to change case ownership using an ACCEPT button.
    Dependencies = This S-Control utilizes the standard cases object.
 */
 
    function setupPage() {
     alert("Inside setupPage, UserID is set to: {!User.Id} and UserName is set to: {!User.Username}");
      ///this if statement skips getElementById; IE7 can access the resultsHolder element directly by name
      if (!document.all){
        resultsHolder = document.getElementById('resultsHolder');
      }
        //search for all cases on the account
        alert("Executing the query now....");
        var query = "SELECT CaseNumber, OwnerId, Subject, Priority, CreatedDate, Status ";
        query = query + " FROM Case WHERE CaseNumber = '{!Case.CaseNumber}' ";
        try {
          var caseResult = sforce.connection.query(query);
          var caseNum = caseResult.getArray("size");
          var caseRecords = caseResult.getArray("records");
          var newOwnerId = '{!$User.Id}' ;
          alert("newOwnerId="+newOwnerId);
        } catch (e) {
          alert("Error executing SOQL search query: " + e);
        }
        //display the cases to choose
        displayList(caseRecords, caseNum);
        updateCaseOwner(caseRecords,caseNum,newOwnerId);
   } // End of setupPage
  
   function displayList(caseRecords, caseNum) {
     alert("Inside displayList...");
     var output = "";
     //write out table
     output += "<table border=1>";
//     output += "<tr class='headerRow'><th>&nbsp;</th><th>Case Number</th><th>Contact</th><th>Subject</th><th>Priority</th><th>Created On</th><th>Status</th><th>Owner</th>";
     output += "<tr class='headerRow'><th>&nbsp;</th><th>Case Number</th><th>Owner</th><th>Subject</th><th>Priority</th><th>Created On</th><th>Status</th></tr>";
     for (i=0;i<caseNum;i++) {
      output += "<tr onmouseover='hiOn(this);' onmouseout='hiOff(this);'><td><input type='checkbox'></td>";
      output += "<td>"+caseRecords[i].CaseNumber+"</td>";
      output += "<td>"+caseRecords[i].OwnerId+"</td>";
      output += "<td>"+caseRecords[i].Subject+"</td>";
      output += "<td>"+caseRecords[i].Priority+"</td>";
      output += "<td>"+caseRecords[i].CreatedDate+"</td>";
      output += "<td>"+caseRecords[i].Status+"</td>";
      output += "</tr>";
  }
//  output += "<input class=btn type='button' value='Next' onclick='displayMergeDetails(document.forms[0]);'>";
  output += "</table></form>";
    
     //write HTML to the browser
     resultsHolder.innerHTML = output;
   } // End of displayList
  
   function updateCaseOwner(caseRecords,caseNum,newOwnerId){
     alert("Inside updateCaseOwner...");
     for (i=0;i<caseNum;i++) {
//      Case myCase = caseRecords[i]
      caseRecords[i].OwnerId = newOwnerId ;
      sfdc.update(caseRecords);
  }// End of for loop
    
   }// End of updateCaseOwner

  
</Script>
</head>
<body align="left">
<Table border="0" cellspacing="0" cellpadding="0">
  <TR>
    <TD class="dataCol" align="left"><font size="-1"><A HREF="#" onclick="javascript:alert('HELLO!!! S Control');setupPage();">Accept Case</A></font></TD>
  </TR>
</TABLE>
<div id="resultsHolder">
<h3>Loading cases, please be patient.</h3>
</div>
</body>
</html>