• JustinC
  • NEWBIE
  • 50 Points
  • Member since 2008

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

Hey

Periodically when running my batch process from a VisualForce page I get a "Read Timed Out" error.

 

I am not calling out to any external systems in my batch.

 

I have gotten this message from code that worked both before and after the problem batch, with no changes to the code in between.

 

Any explanation for this would be highly appreciated!

 

Thanks

Dave

  • November 10, 2009
  • Like
  • 0

I am getting the below error on the myMethod line below.  for the life of me I cannot figure out why....obviously the semi-colon is there.

 

Any help from another pair of eyes would be great!

 

Thanks,


Save error: expecting a semi-colon, found '' SiteLeaseCumCostUpdate/src/classes SiteLeaseFncTblClass.cls line 182

 

 

if (j > 100)

{

myMethod(List<String> ListLeaseID, List<Date> ListDate, List<Decimal> ListCumDefRent, List<Decimal> ListRent, List<Integer> ListTerm);

}

else if (j <= 100)

{

insert followuprecords;

}

else

{

}

I am trying to insert/update a null value into a date field using the Apex Data Loader using the Bulk API mode.

 

The documentation for Bulk API says that blanks are skipped in the CSV file, so you must insert a #N/A into the field if you want to null that field.

 

This works fine for most fields, except when using #N/A on a date field, the Apex Data Loader fails to update any rows that use #N/A for date fields and the error log reports:

Error converting value to correct data type: Date Conversion FAILED

 

Has anyone encountered this issue? Is there a workaround for it?

Is there any way to trap / report errors from failed Asynchronous Apex Jobs? I believe that my method is hitting the 10,000 row query governor limit, or a DML update limit, despite putting limitations on the SOQL query (using LIMIT) and batching updates using the recommended batching methods.

If I set the SOQL LIMIT to 4000-5000 records it seems to complete successfully, but if it tries to handle between 5000 and <10,000 rows it fails. As well, the job actually appears to be successful, it updates all the data it was expected to up to the LIMIT, and yet I don't get any email or error as to why the job failed but it says Status=Failed in the Apex Jobs view.

Any thoughts on how I can get the error that's causing the Apex job to fail?

Thanks!


Message Edited by JustinC on 11-20-2008 01:33 PM

I have been working with a script that pulls some product information for use in our external website.  There is a chron job that replicates the product object each night to get the latest edits for varrious product descriptions.  While I can get the data over easily enough, I am loosing formatting on some of our textarea datatypes.

 

Example:

product

--> ID (primary key)

--> Name (text)

--> Description (textarea)

 

Inside the Description field you might have data like:

Feature #1

Feature #2

Feature #3

 

What seems to come over when I call $response = $connection->query(($query), $queryOptions) is:

Feature #1Feature #2Feature #3

 

Here is the output of the SOAP call on a particular record, I have highlighted in red where there should be newline indications of some sort.  

[1] => SObject Object
(
[type] => Product2
[fields] => stdClass Object
(
[Name] => Managing Information Technology (IT) Projects
[ProductCode] => BU405
[Description] =>
[IsActive] => false
[CreatedDate] => 2010-01-29T04:16:01.000Z
[CreatedById] => 005A0000000WzSdIAK
[LastModifiedDate] => 2010-01-29T04:52:33.000Z
[LastModifiedById] => 005A0000000WzSdIAK
[SystemModstamp] => 2010-01-29T04:52:33.000Z
[Family] =>
[IsDeleted] => false
[Book_Cost__c] => 225.0
[Category__c] => Project Management
[Course_ID18__c] => 01tA0000000Tv0SIAS
[Description__c] => This 3-day course provides an overview of how project management concepts and principles are applied in an I.T. environment, using lecture, small group activities, and discussions. The course allows each team to follow an I.T. project from design to completion, emulating the project management life cycle.
[Display_On_Web__c] => true
[Duration__c] => 3.0
[End_Time__c] => 5:00
[Key_Topics__c] => The Project Management Framework - as described in PMI's current PMBOK guide The 9 Knowledge Areas, the 5 Process Groups, and the Iterative Process Model - processes involved in project management Key Stakeholders - their impact on, as well as their roles in, a typical project Types of Organizational Structures - their impact on managing projects Project Quality and Risk - how to account for project quality and risk as a part of the project plan Integrating Project Management with I.T. Methodology - how to incorporate I.T. application development methodologies with proven project management techniques to create practical procedures for a project management process Conducting Requirements Gathering and Analysis - how to gather and prioritize user requirements to develop an effective technology solution
[Max_Students__c] => 12.0
[Notes__c] => This course is worth 21 PDU's.
[Objectives__c] => The knowledge of how to define the role of the project manager while balancing the expectations of the different project stakeholders The ability to apply different project life cycles to manage the project based on degree of project complexity, team structure, and risk requirements The use of an integrated case study to create each of the following project deliverables: Project charter, scope statement, work breakdown structure, project network diagram, time-driven schedule, and technical requirements The ability to design and conduct a requirements gathering and analysis process, engaging key stakeholders, to determine the key success factors for the I.T. project
[On_Site_Rate__c] => 4000.0
[Public_Fee__c] => 1495.0
[Required_Skills_Experience__c] =>
[Start_Time__c] => 9:00
[Status__c] => Tentative
[Sub_category__c] =>
[Suggested_Next_Courses__c] =>
[Target_Audience__c] => The course is primarily designed for people who have or will be assigned project management responsibilities for information technology projects; for project managers, team leaders, anyone performing in those roles or soon to be performing in those roles
[VantiveID__c] => 1283.0
)

[Id] => 01tA0000000Tv0SIAS
)

I would happily make a nl2br() call once the records got too me, but the PHP tookkit seems to be stripping the newline information out before I get it.

 

Is there a way to make an API call using the PHPToolkit that preserves newline information for textarea datatypes?

 

Here is the code I am using, it's pretty much straight from the samples area...

 

<?php // SOAP_CLIENT_BASEDIR - folder that contains the PHP Toolkit and your WSDL // $USERNAME - variable that contains your Salesforce.com username (must be in the form of an email) // $PASSWORD - variable that contains your Salesforce.com password define("SOAP_CLIENT_BASEDIR", "../includes/soapclient"); require_once (SOAP_CLIENT_BASEDIR.'/SforcePartnerClient.php'); require_once ('../userAuth.php'); try { $mySforceConnection = new SforcePartnerClient(); $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml'); $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD); $query = 'Select ID,NAME,PRODUCTCODE,DESCRIPTION,ISACTIVE,CREATEDDATE,CREATEDBYID,LASTMODIFIEDDATE,

LASTMODIFIEDBYID,SYSTEMMODSTAMP,FAMILY,ISDELETED,BOOK_COST__C,CATEGORY__C,COURSE_ID18__C,

DESCRIPTION__C,DISPLAY_ON_WEB__C,DURATION__C,END_TIME__C,KEY_TOPICS__C,MAX_STUDENTS__C,

NOTES__C,OBJECTIVES__C,ON_SITE_RATE__C,PUBLIC_FEE__C,REQUIRED_SKILLS_EXPERIENCE__C,

START_TIME__C,STATUS__C,SUB_CATEGORY__C,SUGGESTED_NEXT_COURSES__C,TARGET_AUDIENCE__C,

VANTIVEID__C FROM product2 where Display_On_Web__C=true';

 

$response = $mySforceConnection->query(($query)); foreach ($response->records as $record) { echo '<pre>' . print_r($response, true) . '</pre>'; } } catch (Exception $e) { echo $e->faultstring; } ?>

 

 

 

Message Edited by bstripp on 03-27-2010 08:26 PM

Hi,

 

I have created some batch apex code alongwith other triggers and class/controller codes. 

 

When I run individual test methods on them, I am able to get test success result alongwith nice code coverage %. However when I run all tests together, I get following test failure errors:-

 

1)System.AsyncException: Database.executeBatch cannot be called from a batch or future method.

2)System.AsyncException: Future method cannot be called from a future method: changeOwners(String, String)

3)System.AsyncException: Future method cannot be called from a future method: getLead_Rollup_Amount(Id)

4)System.AsyncException: Future method cannot be called from a future method: changeOwners(String, String)

 

Please note again that the exceptions dont come when tested individually.

 

Please advise on same.

 

 

Thanks,

 

Vimal 

Hey

Periodically when running my batch process from a VisualForce page I get a "Read Timed Out" error.

 

I am not calling out to any external systems in my batch.

 

I have gotten this message from code that worked both before and after the problem batch, with no changes to the code in between.

 

Any explanation for this would be highly appreciated!

 

Thanks

Dave

  • November 10, 2009
  • Like
  • 0

Hi everbody,

I'm currently developing a synchronisation script with the PHP Toolkit 13.0 do have all major data from Salesforce available in our local Oracle Database.

So far everything works, however today I've tried to sync the "LeadHistory" object from Salesforce. This object contains two fields "oldvalue" and "newvalue", both are defined as "xs:anyType" in the WDSL file.

 

As long as there is no content in these fields the PHP API returns them as empty fields, which is correct behavour.

 

However as soon as there is any content available in these fields, the "$queryResult->records as $record" call did not contain these fields anymore? I was not able to find them in the result set returned from the API. The dataloader 15 exports these fields without problems.

 

I've checked the record where the oldvalue/newvalue fields are missing, and in the Dataloader output it is clearly shown that there is content in these fields.

 

Here is the code snippet to retrieve the data:

 

$response = $sforce->query("SELECT Id,IsDeleted,LeadId,CreatedById,CreatedDate,Field,OldValue,NewValue FROM LEADHISTORY");
$queryResult = new QueryResult($response);
if ($queryResult->size > 0) {

  foreach($queryResult->records as $record) {

      // Here the code extracts the data from $record->fields. And here are also the fields missing as soon as they contain data

   } 

}

 

If anyone has any idea how to solve this I would be glad to hear from you. For now I have to skip the LeadHistory object as the necessary informations are not available anyway. IMO the oldvalue/newvalue fields are used in the Leadhistory object whenever a Lead status change is performed, and these infos are of course necessary to have a real history available.

 

 

 

I am getting 'Too many script statements: 10201'

 Governor Limit error when submitting ~100 or more updates at a time via the list view. 

 

When using the list view,  does it update in batch?  If so, according to the docs in the case of 100 records I should have 10,000 + (100*200) = 30,000 script statements allowed not 10200.  

 

If it's not updating in batch then why doesn't it happen when doing 1-50 updates?

 

Additional Details:

 All the updates performed were not data changes,  just a hit to have the trigger executed

 This is not an issue when doing a single update via the edit.

 or  less then 50 via the list view.

 or 200 via the API.

I Also updated all record (+250k) via the API wo/ any gov limit errors, This proves its not caused by a differences in the records data causing difference logic to be applied.

 


Tom

 

 


 

 

 

 

 

 


 

Hi,

 

I'm trying to develop a very simple trigger that essentially creates a contact and a few contact share records when a User record is created.  

 

In my dev environment the trigger and all of the unit tests work flawlessly, when I transfer to production the trigger doesn't even fire and as a result my unit tests fail. 

When I run the tests I get no indication that the Trigger even attempted to run, let alone some error to tell me why it might be failing.  Also, System.Debug within the Trigger doesn't show in my test output.

 

The trigger itself is below.  I can post the support class code if needed but it doesn't seem to be getting that far so I don't know if it will help.

 

Any help is greatly appreciated.

 

Thanks

Jon

 

 

 

trigger User_Create_ContactSharing_Trigger on User (after insert)

{

 

// User Create ContactShareing Trigger

 

 

 

 

System.Debug('Inside Insert Trigger');

 

//get the user data and pass to the function in our support class

User[] theUsers = [select id,name,firstname,lastname,companyname, email, phone, defaultcurrencyisocode from User where id in :trigger.new];

 

 

//loop through all new users

 for(User newUser :theUsers)

{

 

User_Contact_Trigger_Class.User_Create_Trigger(newUser);

 

}

 

 

}

I am getting the below error on the myMethod line below.  for the life of me I cannot figure out why....obviously the semi-colon is there.

 

Any help from another pair of eyes would be great!

 

Thanks,


Save error: expecting a semi-colon, found '' SiteLeaseCumCostUpdate/src/classes SiteLeaseFncTblClass.cls line 182

 

 

if (j > 100)

{

myMethod(List<String> ListLeaseID, List<Date> ListDate, List<Decimal> ListCumDefRent, List<Decimal> ListRent, List<Integer> ListTerm);

}

else if (j <= 100)

{

insert followuprecords;

}

else

{

}