• blnt
  • NEWBIE
  • 25 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 20
    Replies

Hello,

 

We have written a apex webservice in Salesforce which will be invoked by the java program. We have scheduled it to run every day at one specific time. This is all about our application.

 

The problem is that sometimes some records are throwing out exception and the error description is "Entity is deleted". These records are executing successfully when we reprocess them. What could be the reason? Why these records(error) not throwing exceptions in the second run?

 

Thanks,

Hi,

 

I need to show the translation of some custom messages on an s-control HTML page. I have these messages created as Custom Labels but I am unable to access the translated values from the server through my s-control since CustomLabel is not an Object. I even tried with Metadata API using describeSObject and describeGlobal but couldn't fetch the values.

 

Can anybody tell me how I can fetch these labels?

Hi,

 

I'm converting an old unmanaged package into a new managed packaged and I am running into an issue. I have an S-Control named Checklist_New, shown here:

<html>
<head>
<script type="text/javascript" language="javascript" src="/soap/ajax/9.0/connection.js"></script>
<script type="text/javascript" language="javascript">
<!--
function init() {
// Call the 'new checklist' page and set the save URL to our custom populate SControl.
// Always set the return URL to the checklist view page.
// Request.CF00N70000001aCWA contains entity name, if called from the entity
if ('{!$Request.CF00N70000001aCWA}' != '') {
window.parent.location.href = "{!URLFOR($Action.Checklist__c.New, null, [CF00N70000001aCWA=$Request.CF00N70000001aCWA, saveURL=URLFOR($SControl.Checklist_Populate, null, [retURL=URLFOR($Request.retURL, null, null, true)]), retURL=URLFOR($Request.retURL, null, null, true)], true)}";
} else {
window.parent.location.href = "{!URLFOR($Action.Checklist__c.New, null, [saveURL=URLFOR($SControl.Checklist_Populate, null, [retURL=URLFOR($Request.retURL, null, null, true)]), retURL=URLFOR($Request.retURL, null, null, true)], true)}";
}
}
// -->
</script>
</head>

<body onLoad="init()">
<p>&nbsp;</p>
</body>

</html>

 

 When I attempt to upload my package I get the following error:

Component Type Name Problem
Custom S-Control Checklist New This component depends on another component that is not included in this package.

 If I remove this S-Control from my package the upload is sucessful, but clearly this is not an option.

 

The S-Control Checklist_Populate and the Object  Checklist__c are both included in the package by Checklist_New.

 

I can't seem to think of anything else it could possible be dependant on so I'm thinking something quirky is going on here...

 

Any ideas?

 

Thanks a lot,

Mike

 

 

 

What is the trick to get the system log to actually show your debug statements consistently?  Whether it shows them seems to be based on luck and I am not very lucky today.
 
Thanks
Hi,

In one of the organizations I'm working on I've been getting a javascript error in the browser based system log so I can't see the log information. The error from firebug is:

initSystemLogUi is not defined

Thanks for any help
Scott

BrainEngine has just released the first version our Developer Workbench product. Features Include:
  • Ability to work simultaneously with several queries in separate windows
  • Editing capabilities: snippets, intellisense, syntax highlight, code folding
  • Export data to 8 popular formats: MS Excel, MS Access, MS Word, RTF, HTML, PDF, XML, and CSV
  • Import data from MS Excel
  • Generate reports on object definition, object schema and relationships
  • Generate object ER Diagrams
  • View Page Layout Definitions
  • Outbound Messaging Support
  • Enhanced HTML Page Editor
The Workbench comes in two different versions. The Community Edition (freeware) and the Professional Edition (Community Edition + Priority Support). Click here for more details
Is there a way to view/monitor these? I am strongly thinking that the IDE makes a LOT of calls as we have been hitting the REQUEST_LIMIT_EXCEEDED error with hardly no user activity. We only have rolled out the app to a handfull of users and only have a handfull of S-Controls.

Any docs or info on this would be greatly appreciated. Ex: how many calls for each full refresh from server, refresh of a single file (modified outside of the IDE), each save to server, etc...

Thanks,


Bao-Long Nguyen-Trong
Glam Media
 
hi,
 
I need to customize the error message during the approval process, when criteria is not true.
Please help me on this.
 
Thanks
Swati
 
 
Hi,

I am trying to save a clone of some object in a trigger in certain cases. However, as sObject.clone() copies over the Id and the Id is a read only field I am unable to insert the cloned object. Can anyone help?

Thanks,


Bao-Long Nguyen-Trong

* Error Message when trying to insert cloned object:

Insert failed. First exception on row 0 with id xxxxx; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]:
Trigger.OnProposalUpdate: line 14, column 5


* Error message when trying to null the Id before inserting:
Error: Compile Error: Field is not writeable: Proposal__c.Id at line 11 column 9

* Sample code:

trigger OnProposalUpdate on Proposal__c (before update) {
List clonedProposals = new List();
For (Proposal__c oldProposal : Trigger.old) {
Proposal__c clonedProposal = oldProposal.clone();
if (oldProposal.Version__c != null) {
clonedProposal.Version__c = oldProposal.Version__c + 1;
}
else {
clonedProposal.Version__c = 1;
}
oldProposal.Id = null;
clonedProposals.add(clonedProposal);
}
insert clonedProposals;
}
We are using the remoteFunction and we have set a timeout but it still defaults to the 10 second timeout? 
Here is the code we are using.
 
sforce.connection.remoteFunction({ url : url,
timeout : 60000,
method: "POST",
requestData: template,
async: false,
requestHeaders: { "Content-Type": "text/xml","SOAPAction": https://www.ourwebsite.com},
    onSuccess : function(response) { message = response;},
    onFailure : function(error) { alert(error); }});
 
we pass in XML and retrieve XML as a response.  It works great until we have a larger sized XML
being sent and then we run into issues.  The server is receiving the data and the remoteFunction
is not paying attention to the timeout call. So we get
 
<html>
<head><title>400 Unable to forward request due to: Read timed out</title></head>
<body>
<h1>400 Unable to forward request due to: Read timed out</h1>
<p /><hr />
<small>
Resin-3.0.12 (built Wed, 23 Feb 2005 10:29:38 PST)
</small>
</body></html> 
 
Does anybody have any ideas or know of any work a rounds... Any help will be greatly appreacheated.
Hi,

I've been trying to reuse the code from:http://wiki.apexdevnet.com/index.php/Create_a_many_to_many_relationship_with_a_multi-select_picklist

I have just changed the api names to my custom objects, but nothing else, and am
hitting a problem.

When I click on the Add button, nothing happens, and I get an error in Fire bug:
DuelingListBoxesElement is not defined
moveOption(select#select_0, select#select_1, "--None--", [], null, "--None--", undefined, undefined, undefined)functions.js (line 797)
DuelingListBoxesElement.moveOption(sourceSelect, targetSelect, keepSourceLab...

I tracked it down to the following line:

<td align=center><a href="javascript:moveOption(document.placebook.select_0,document.placebook.select_1,'--None--', [],null,'--None--');"><img src="/img/arrow_rt.gif" border="0" alt="Add" title="Add" width=23 height=23></a></td>
</tr>

Does anyone have any thoughts on this? Really appreciate it, as this is key functionality for me.

Full code is below, with error line about 2/3rds down.

Andy





<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<link href="/css/ie_global.css" rel="stylesheet" type="text/css">
<link href="/css/ie_navigation.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.row1 {
background-color: #EEEEEE;
padding: 0px 3px 0px 3px;
vertical-align: top;
}
.row2 {
background-color: #DDDDDD;
padding: 0px 3px 0px 3px;
vertical-align: top;
}
A, A:visited, A:active {
color: #000000;
text-decoration: underline;
}
A:hover {
color: #FFCC00;
text-decoration: underline;
}
-->
</style>

<script language="JavaScript1.2" src="/js/functions.js"></script>
<script src="/soap/ajax/9.0/connection.js" type="text/javascript"></script>
<script id="clientEventHandlersJS" language="javascript">

function toIsoDateTime(theDate) {

var today = new Date(theDate);
var year = today.getYear();
if (year < 2000) {
    year = year + 1900;
}
var month = today.getMonth() + 1;
var day = today.getDate();
var hour = today.getHours();
var hourUTC = today.getUTCHours();
var diff = hour - hourUTC;
var hourdifference = Math.abs(diff);
var minute = today.getMinutes();
var minuteUTC = today.getUTCMinutes();
var minutedifference;
var second = today.getSeconds();
var timezone;

if (minute != minuteUTC && minuteUTC < 30 && diff < 0) { hourdifference--; }
if (minute != minuteUTC && minuteUTC > 30 && diff > 0) { hourdifference--; }
if (minute != minuteUTC) {
    minutedifference = ":30";
} else {
    minutedifference = ":00";
}
if (hourdifference < 10) {
    timezone = "0" + hourdifference + minutedifference;
} else {
    timezone = "" + hourdifference + minutedifference;
}
if (diff < 0) {
    timezone = "-" + timezone;
} else {
    timezone = "+" + timezone;
}
if (month <= 9) month = "0" + month;
if (day <= 9) day = "0" + day;
if (hour <= 9) hour = "0" + hour;
if (minute <= 9) minute = "0" + minute;
if (second <= 9) second = "0" + second;
return year + "-" + month + "-" + day + "T" + hour + ":" + minute + ":" + second + timezone;
}

// InitPage Called by OnLoad.
function initPage() {
var existingSel = document.getElementById('select_0');
try
    {
  var qr = sforce.connection.query("Select Name, Id From AppTest2__Assessment__c ORDER BY Name") ;   
    }
catch (error)
    {
    alert(error.faultstring);
    }

if (qr.records.length > 0)
    {
    for (var i=0;i<qr.records.length;i++)
        {
         existingSel.options[i] = new Option(qr.records[i].get("Name"), qr.records[i].get("Id"));
         }
    }
    else
    {
        alert("Query to populate picklist failed. No Rows.");
    }
// End Init Page with the bracket below.
}

// Create Placement is called when the submit button is pushed.
function CreatePlacement() {
var bp = [];
var NewSel = document.getElementById('select_1');
var nd = toIsoDateTime(document.getElementById('inputDate').value);
var qt = document.getElementById('quantity');
if ((NewSel.options[0].value == '--None--') || (NewSel.options[0].value == '')) {
    alert("You Must select a book to be added!");
}
else
{
for (var i=0;i<NewSel.options.length;i++)
    {
    var placement = new sforce.SObject("AppTest2__Assessment_Judges_Influencer__c");
    placement.set("AppTest2__Assessing_Assessment__c", NewSel.options[i].value);
    placement.set("AppTest2__Assessed_Influencer__c", "{!AppTest2__Influencer__c.Id}");
    //placement.set("Delivery_Date__c",nd);
    //placement.set("Quantity__c",qt.value);
    bp.push(placement);
    }
var cr = sforce.connection.create(bp);
for (var i=0; i<cr.length ;i++ )
    {
    if (cr[i].getBoolean("success"))
        {
        } else {
        alert("Failed to create Book Placement: " + cr[i]);
        }
    }
}
parent.frames.location.replace("/{!AppTest2__Influencer__c.Id}");
}

//-->
</script>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>
<body onload="javascript:initPage();">
<form name="placebook" id="placebook">
<table width="100%" cellpadding=0 cellspacing=0 border=0>
<tr>
<td> <table width="100%" cellpadding=0 cellspacing=0 border=0>
<tr>
<td align=LEFT class="pageTitle" nowrap><img src="/img/campaign_target_large.gif" border="0" alt="Accounts"

width=30 height=20 align="texttop">Mass Place Books for: &nbsp<b>{!AppTest2__Influencer__c.Name}</b></td>
<td width="100%" align=RIGHT bgcolor="#FFFFFF" nowrap><a href="#"><img src="/img/help_icon.gif" border="0"

width=25 height=18 align="texttop">Help</a></td>
</tr>
</table></td>
</tr>
<tr>
<td class="moduleLine"><img src="/s.gif" height="2"></td>
</tr>
<tr>
<td><img src="/s.gif"></td>
</tr>
<tr>
<td align=LEFT bgcolor="#CCCCCC" height=15 class="bodySmallBold"><a href="javascript:history.back()">� Back</a></td>
</tr>
</table>
<table border=0 cellspacing=1 cellpadding=0 id="ep" width="100%">
<tr id="btn">
<td colspan=5 align=center><input type="button" name="save" value=" Save " class="button"

onclick="javascript:CreatePlacement();">
  
<input type="button" name="cancel" value="Cancel" class="button" onClick="javascript:history.back();"><div

class=errorMsg id="error_General"></div></td>
</tr>
<tr>
<td colspan=5> </td>
</tr>
<tr id="head_1_ep">
<td class="bodyBold" colspan=4 nowrap>Book Placement Information:</td>
<td nowrap colspan=1 align=left><img src="/img/required_icon.gif" border="0" alt="Required Information" title="Required Information" width=18 height=18 align="texttop"><span class="bodySmallBold"> = Required Information</span></td>
</tr>
<TR >
<TD CLASS="blackLine" COLSPAN=5><img src="/s.gif"></TD>
</TR>
<tr >
<td class="requiredInput">Book Name:</td>
<td colspan="4"><table border=0 cellspacing=1 cellpadding=0 id="selbook" width="100%">
<TR>
<TD COLSPAN=5 ><table cellpadding=1 cellspacing=1 border=0>
<tr>
<div class=errorMsg id="error_select_0"></div></td>
</tr>
<tr>
<td height=5 colspan=100%></td>
</tr>
<tr>
<td align=center valign=bottom class=bodyBold>Available Books </td>
<td width=3 rowSpan=2><IMG src="/s.gif" width=3 border=0></td>
<td> </td>
<td width=3 rowSpan=2><IMG src="/s.gif" width=3 border=0></td>
<td align=center valign=bottom class=bodyBold>Selected Books </td>
</tr>
<tr>
<td align=center valign=top><select name="select_0" id="select_0" MULTIPLE width="200" size="10">
<option value="">--None--</option>
</select></td>
<td align=center valign=center class=bodySmall><table cellpadding=0 cellspacing=0 border=0>
<tr>
<td valign=bottom align=center class=bodySmall>Add</td>
</tr>
<tr>
<td align=center><a href="javascript:moveOption(document.placebook.select_0,document.placebook.select_1,'--None--', [],null,'--None--');"><img src="/img/arrow_rt.gif" border="0" alt="Add" title="Add" width=23 height=23></a></td>
</tr>
<tr>
<td><IMG src="/s.gif" height=3>
<tr>
<td align=center><a href="javascript:moveOption(document.placebook.select_1,document.placebook.select_0,'--None--', [],null,'--None--');"><img src="/img/arrow_lt.gif" border="0" alt="Remove" title="Remove" width=23 height=23></a></td>
</tr>
<tr>
<td align=center valign=top class=bodySmall>Remove</td>
</tr>
</table></td>
<td align=center valign=top><select name="select_1" id="select_1" MULTIPLE width="200" size="10">
<option value="">--None-- </option>
</select></td>
</tr>
<tr><td colspan="5"><div class=errorMsg id="error_select_1"></div></td></tr>
</table></TD>
</TR>
</table></td>
</tr>
<tr >
<td nowrap class="dataLabel">Date Delivered:</td>
<td style="border-left: 5px solid #990000;"><nobr>
<input name="inputDate" id="inputDate" type="text" size=12 tabindex="3">
<a href="javascript:openPopupFocus('/home/calendar.jsp?form=placebook&field=inputDate&mo=0', '_blank', 193, 148,'width=193,height=148,resizable=yes,toolbar=no,status=no,scrollbars=no,menubar=no,directories=no,location=no,dependant=yes',true, true);" tabindex="3" onclick="setLastMousePosition(event)"><img src="/img/date_picker.gif" border="0" alt="Pick A Date" title="Pick A Date" width=24 height=16></a><span class="bodySmall">[ <a href="#" onclick="if(document.getElementById('inputDate') && document.getElementById('inputDate').disabled == false) { document.getElementById('inputDate').value = '{!Today}';}return false;">{!Today}</a> ]</span></nobr><div class=errorMsg id="error_inputDate"></div></td>
</tr>
<tr>
<td nowrap class="dataLabel"><label>Quantity</label></td>
<td style="border-left: 5px solid #990000;">
<input name="quantity" type="text" value="1" id="quantity" onblur="MM_validateForm('quantity','','RisNum');return document.MM_returnValue" />
</td>
</tr>
</table>
</form>
<hr><br>
</body>
</html>
I have an application where I want to tie Worker objects to Address objects. The same address can be used by many workers and each worker can be located at many addresses.

I looked in the development area and saw a reference to a junction object. Is this just a simple object containing two Lookup fields or is there someway to automatically create a many-to-many relationship?

Would it work to simply have the Worker object contain a lookup field for the Address object and the Address object have a Lookup(Worker) field?
Hi all,
 
The wsdl that I have got from a client compiles and creates the java objects. But the build fails and the error I see is "too many parameters". I checked in the wsdl and the particular type has about 400 elements.
 
Is there a way to get around this.
 
Please help!
 
Thanks,
-vish
Hello,

I have developed a composite application, with a variety of S-Controls.  I am concurrently working on a Japanese translation for the content.  The translation workbench is activated on my account, and I have changed all the Custom Object field labels, etc.  The problem I am encountering is that I have a list of error messages, that  I also want to display in Japanese.  How do you suggest I do this?  Do I need to have another set of S-Controls that are all in Japanese?  Is there a way to have a messages.properties file of some sort, that will be accessed when the browser and Salesforce language fields are set?


Thanks,
AtTaskBravo
Eclipse uses lots of API calls - particularly when refreshing.  We frequently hit the 5000 API calls per day because of this.  It appears that you get at least one API call per file refreshed.
 
We have a team of 3 developers working on about 200 triggers, sobjects and classes.  As our development continues this will get worse.  We are hitting the ceiling more and more often.  When it happens we have to wait 24 hours.
 
Any plan to make the API call usage less?  Or raise the 5000 API call limit? 
I've been having a few problems with the eclipse addin for editing sControls.  I wondered whether anyone else had seen similar problems and/or knows how to work around them.

Eclipse generally works well, but a couple of times a day it refuses to save the sControl that I am editing at the time, and refuses to sync either.  The typical error is "REQUEST_LIMIT_EXCEEDED: TotalRequests Request Limit exceeded".  So at first I assumed that it must have been because I had made a lot of API calls, and exceeded my rolling 24-hour quota, as mentioned in other threads on this forum.  At the time I was making quite a few API calls in my code, so this made sense.  So I just waited a while for the limit to time out.

However, since then I've found that this problem can occur even when I've made hardly any API requests at all in the preceding 24 hours.  For example, prior to yesterday I had not run or changed any of my sControl code for over a week, but yesterday when I opened an sControl in eclipse and made a change, it refused to save it, giving the REQUEST_LIMIT_EXCEEDED message.  This would have been the first request made for several days.

Other messages that I get include "Could not fetch meta-data" (this is when starting eclipse or doing a sync operation), or "Invalid thread access".  It's as though eclipse has lost its connection to salesforce.

When the problem occurs, I have to stop using eclipse for a time.  But I can still edit my sControls through the standard web browser interface, and I can still run pages that make Ajax calls, so I'm concluding from those that (a) I can connect to salesforce OK, and (b) I have not exceeded my request limit.

Sometimes I can "fix" it by a combination of logging out of all sf connections, deleting the project in eclipse and renaming it.  But other times, no matter what I do, it refuses to work again. So I revert to editing sControls in the web browser interface.  Then I'll try eclipse again a bit later, and it'll be fine.

I've noticed today that when the problem occurs, the last sControl that I have edited will have been renamed.  For example from "my_sControl" to "my_sControl1".  I can see this from the list of sControls in the browser-based editor.  Does this suggest anything?

Any suggestions would be most welcome.  Thanks.

PS am I correct to assume that each time that I save an sControl from eclipse, this counts as an API call (perhaps more than one) ?
I'm building an S-Control which will reference an another one.
Both of them are referenced by custom links of the same custom object.

One S-Control should call the custom link for the second. Is there a way to get the link without copy / paste method?
Could I insert something like {!ObjectLink} to get the link id the same way as I get retrieve the field value?

If I use the hard-coded link, it can easily brakedown just because the preferences of the custom link changes.

Thanks a lot.