• jmasl7
  • NEWBIE
  • 0 Points
  • Member since 2007

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

I'm developing (in a sandbox) an Apex class to perform a mass update of Accounts on our system. Normally when some kind of error occurs during the processing, I receive an e-mail giving me details of the error. However, when the process fails at the start, no such e-mail gets sent so I have no details of what the error is.

 

Is there any way to get more information about what caused an Apex Batch Job to fail?

 

The (similified) code I'm trying to execute is:

 

global class JL_BatchTest implements Database.Batchable<SObject> {

public static void submit() {

JL_BatchTest x = new JL_BatchTest();

Database.executeBatch(x);

}

 

private String soqlQuery = 

'Select' + 

' Id' + 

', Name' + 

' from Account';

global Database.QueryLocator start(Database.BatchableContext bc) {

return Database.getQueryLocator(soqlQuery);

}

global void execute(Database.BatchableContext bc, List<SObject> sObjects) {

processList((List<Account>) sObjects);

}

global void finish(Database.BatchableContext bc) {

}

private void processList(List<Account> acs) {

System.Debug('acs.size() = ' + acs.size());

for (Account ac: acs) {

// Do something with each account

}

}

 

 

 

Is there anything wrong in this code? I suspect it may be failing at the start because the number of Accounts returned by the query is very high (474,000 on our system), but my understanding is that Batch Apex should be able to handle such numbers of records and, indeed, much higher numbers up to 50 million records (?).

 

The same class runs without error on a smaller sandbox  which contains just 10 Accounts.

 

Thanks in advance

 

John 

  • October 22, 2009
  • Like
  • 0
Hello,

I want to try out the Salesforce Mobile (formerly Apex Mobile) product on my iPAQ device. I have followed the installation instructions, accepted the licence agreement and entered my salesforce.com user name and password (for a developer account).

I get the message "Your password has been sen to salesforce.com for verification" on my iPAQ screen, but then nothing happens.

Is there some setting I have to enable for this to work?

Any help appreciated.

Regards

John
 Hello,

in our Salesforce.com org we have a specific SControl which keeps disappearing.

This happens sometimes (though not always) when using the Apex Plug-In for Eclipse to work on SControls - not specifically this SControl. The SControl above seems to disappear when we refresh Eclipse from the Salesforce.com server.

We are using Eclipe Version 3.3.1.1 build id: M20071023-1652 and the Apex Toolkit for Eclipse 8.1.0.200710161138

I am sure that it is significant that this particular SControl was not directly referenced by any button - when I click the 'Where is this used?' button it shows no S-Control references. (We have now created a 'Dummy Button' to reference it so as to hopefully prevent it disappearing again). Although the SControl was not used directly, it was used indirectly by another SControl which builds a value for the saveURL containing a reference to the Id of the first SControl. This enables us to have the user redirected to the record just created rather than being directed back to the Contact Detail page which is what we need in some situations.

Does anybody know what the cause of this is? We assume it must be some kind of bug in the Apex Toolkit for Eclipse (?)

I have already reported this problem to Salesforce.com by logging a support case (case number 01716002), but I've been told that to get assistance I need to post the question on this discussion board.

Thanks and regards

John

  • March 04, 2008
  • Like
  • 0
Hello,

is it possible to use the Salesforce.com API to determine which fields are visible to a specified Profile and which of these are read-only?

I thought this information might be accessible from the Profile object, but as far as I can tell it isn't.

Thanks in advance

Regards

John
  • January 29, 2008
  • Like
  • 0
Hello,

I'm trying to analyse the potential impact of proposed changes to picklist values. Is there any tool or utility available which assists with this?

I'm finding it particularly time consuming having to open the definitions of a huge set of Reports to determine whether or not the fields in question are used as selection criteria.

Thanks and regards

John
  • April 05, 2007
  • Like
  • 0
Is there anyway to do the following, possibly using S-Controls/Javascript?
 
I'd like to add a custom picklist field called 'Subtype' to the Task object and define the values of this field such that each value corresponds to a valid value of the (standard) 'Type' field.
 
Whichever value the user enters/selects for the 'Subtype' field would then automatically set the value of the 'Type' field.
 
For example a value of 'Normal visit' in Subtype would set the value of Type to 'Visit'.
 
Generally speaking there would be several 'Subtype' values corresponding to each 'Type' value.
 
Ideally, the Type field would not be displayed on the Task Page at all, but if it can't be removed then as long as it's value was set automatically - possibly with invalid combinations of values being disallowed by a Validation Rule - then this would be ok. What has to be avoided if possible (users have already been promised they won't have to do this) is for the user to have to enter both values.
 
Can this be done?
 
Thanks and regards
 
John
  • April 02, 2007
  • Like
  • 0
In developing an S-Control I'm trying to do a combination of the following:
 
1) output certain Date values to the web page, formatting them according to the user's SF.com locale settings
 
2) fill in AND accept back Date values from editable Text Boxes (within HTML forms), again formatting these dates according to the user's SF.com locale settings
 
Questions are:
 
1) how can my S-Control (i.e. my javascript code) determine what the user's locale settings are?
 
2) having determined these, how can I convert date values to/from the user-visible format in a sensible way? i.e. is some kind of callable function available rather than just coding stuff like
 
if (locale == "English (United Kingdom)") {
  dateSeparator = "/";
  dateFormat = "dmy";
}
else if (locale == "English (United States)") {
  dateSeparator = "/";
  dateFormat = "mdy";
}
 
etc. etc.
 
Seems to me I'd be 'reinventing the wheel' if I did stuff like that - and it would also be a headache regarding testing and future maintainability.
 
Is there a better way to do this?
 
Regards
 
John Lewis
 
  • March 28, 2007
  • Like
  • 0

Hello,

I'm strying to get started using the salesforce.com API in Java to log on to our salesforce.com org, based on the sample code in the quickstartJava.zip file.

To do this I create a SoapBindingStub object by calling the getSoap() method of a SforceServiceLocator object, call its setTimeout() method to set the timeout to 60 seconds and then call its login() method, passing my salesforce.com user name and password as arguments.

The login() method fails with an exception:

java.net.UnknownHostException: www.salesforce.com

I think this is probably because it is trying to access www.salesforce.com directly rather than going through our proxy server. But how do I specify the proxy settings such as URL and port number? I can't find any documentation or example of doing this.

Any help appreciated.

Regards

John Lewis

  • March 20, 2007
  • Like
  • 0
Hi all,
 
I am getting weird errors when I try and do a repaint of an area of my Visualforce page, in response to an actionFunction. The whole page initially displays ok, so I know that all the necessary apex properties are visible and accessible.
 
When I execute my actionFunction (via onchange of a picklist) I do a couple of things
- update the value of the field back to SFDC immediately
- redraw a section of the page
 
The code is:

<apex:actionFunction action="{!resetStatus}" name="redraw" rerender="commandbuttons" >

    </apex:actionFunction> 
 
When I do this via my sys admin user it works fine. When I do via my customer portal user, I get an Insufficient Privileges error.
 
What's weird is that the update definitely works, as if I go back and check SFDC the updated value is there. This means the page refresh isn't working properly.

Things I have tried:
- debug, but this shows up no notion of the error, only that the action function posts and runs my code (without error)
- customer portal profile - all apex classes and vf pages have been granted, as well as field level security

I am not quite sure what else I can look at. The redraw of the section of page doesn't put anything additional on the page that is not already accessed when the page first loads (successfully), so I'm a little confused what might be causing this.

Anyone seen this before?

Thanks,
Stephen
Hello,

is it possible to use the Salesforce.com API to determine which fields are visible to a specified Profile and which of these are read-only?

I thought this information might be accessible from the Profile object, but as far as I can tell it isn't.

Thanks in advance

Regards

John
  • January 29, 2008
  • Like
  • 0
Hello --

In one of my applications that uses the partner wsdl, the system calls DescribeGlobal as a given user.  It's my understanding that DescribeGlobal will only return objects that the user has access to, right?

Anyway, I use the results of the DescribeGlobal (broken down into groups of not more than 100), in calling DescribeSObjects, but I'm getting a error for one user.  I don't the particulars of the error yet, but from the cursory glance, it looks like the same error that results if the user calls DescribeSObjects on an object to which he does not have access.

Is anyone aware of any special security caveats that I should be aware of when calling DescribeSObjects?

Message Edited by ColoradoMike on 05-15-2007 09:58 AM

Is there anyway to do the following, possibly using S-Controls/Javascript?
 
I'd like to add a custom picklist field called 'Subtype' to the Task object and define the values of this field such that each value corresponds to a valid value of the (standard) 'Type' field.
 
Whichever value the user enters/selects for the 'Subtype' field would then automatically set the value of the 'Type' field.
 
For example a value of 'Normal visit' in Subtype would set the value of Type to 'Visit'.
 
Generally speaking there would be several 'Subtype' values corresponding to each 'Type' value.
 
Ideally, the Type field would not be displayed on the Task Page at all, but if it can't be removed then as long as it's value was set automatically - possibly with invalid combinations of values being disallowed by a Validation Rule - then this would be ok. What has to be avoided if possible (users have already been promised they won't have to do this) is for the user to have to enter both values.
 
Can this be done?
 
Thanks and regards
 
John
  • April 02, 2007
  • Like
  • 0
In developing an S-Control I'm trying to do a combination of the following:
 
1) output certain Date values to the web page, formatting them according to the user's SF.com locale settings
 
2) fill in AND accept back Date values from editable Text Boxes (within HTML forms), again formatting these dates according to the user's SF.com locale settings
 
Questions are:
 
1) how can my S-Control (i.e. my javascript code) determine what the user's locale settings are?
 
2) having determined these, how can I convert date values to/from the user-visible format in a sensible way? i.e. is some kind of callable function available rather than just coding stuff like
 
if (locale == "English (United Kingdom)") {
  dateSeparator = "/";
  dateFormat = "dmy";
}
else if (locale == "English (United States)") {
  dateSeparator = "/";
  dateFormat = "mdy";
}
 
etc. etc.
 
Seems to me I'd be 'reinventing the wheel' if I did stuff like that - and it would also be a headache regarding testing and future maintainability.
 
Is there a better way to do this?
 
Regards
 
John Lewis
 
  • March 28, 2007
  • Like
  • 0

Hello,

I'm strying to get started using the salesforce.com API in Java to log on to our salesforce.com org, based on the sample code in the quickstartJava.zip file.

To do this I create a SoapBindingStub object by calling the getSoap() method of a SforceServiceLocator object, call its setTimeout() method to set the timeout to 60 seconds and then call its login() method, passing my salesforce.com user name and password as arguments.

The login() method fails with an exception:

java.net.UnknownHostException: www.salesforce.com

I think this is probably because it is trying to access www.salesforce.com directly rather than going through our proxy server. But how do I specify the proxy settings such as URL and port number? I can't find any documentation or example of doing this.

Any help appreciated.

Regards

John Lewis

  • March 20, 2007
  • Like
  • 0