• J&A-Dev
  • NEWBIE
  • 125 Points
  • Member since 2008

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 35
    Replies

Hi all,

 

I'm reading page 206 on the Apex reference doc and it states that one Apex transaction can make 10 callouts to an HTTP request. If I need to make more than 10 callouts, what are all my options other than using the @future notation? I'm calling a geocoding webservice, and the app will be making closer to 200 callouts/day.

 

Any suggestions will be appreciated.

 

Thanks in advance.

Hi,

 

I wrote a batch Apex job that updates contact records (200 records/batch) by doing a lookup to another table. For the most part, all looks good until a DML Exception occurs. When this happens, none of the records on that batch get updated as expected. My question is: what's the best way to handle this? Can I have a try and catch statement and when the DML Exception is caught, reprocesses all the records within that batch minus the record/records that caused the DML Exception?

 

Any pointers will be appreciated.

 

Thanks in advance.

Hi,

 

I have 2 Batch Apex classes that update contact records. Now, I'm trying to write the test method for both, and it seems that when I attempt to simulate the batch job for either job, the other batch job runs as well and I get a runtime error. If I comment out one of the jobs, then other job runs fine and I get 100% coverage (on that particular batch apex job).

 

Is there anything in particular that I need to do to be able to test multiple Apex jobs?

 

Thanks in advance.

Hi,

 

I have one SOQL which will retrieve nearly 50k records. Can anyone please tell me how to handle this scenario.

As SOQL is able to retrieve at most 10,000 records, somehow I need to pass the start index to SOQL to retrieve set of next 10,000 recs..etc.

 

Is it possible at all? How will Batch apex help in this?

 

Thanks ain advance,

Suvra

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

Hi all,

 

I wrote an s-control that makes a GET call to an external server, gets the response back, parses it and it stores parts of the response into the DB. Once I parse the response from the server, I populate a custom field with the parsed response. Currently, I do this by passing the field value via query string but the field must be present on the layout for this to work. Is there a way to hide the field from the layout and still be able to pass the field value via query string client-side?

 

Thanks in advance.

 

How do I create a string and run this simple soql query that populates it. 

 

 

Example 

String uRoleName = [Select u.Name From UserRole u Where u.id = : UserInfo.getUserRoleId() Limit 1]; 

 

Above doesnt work because it wants an SObject but UserRole is not an accessible sObject and I dont want an instance of it anyways I just want the one field returned into a string. 

Hi all,

 

I'm working with the remoteFunction() to make a GET call to an external webservice. The service returns an XML back and I was wondering if the Ajax toolkit contains any functions to parse the XML response. This is how I'm making the GET call:

 

 

sforce.connection.remoteFunction({
url : "my_http_request_link_w_querystring",
requestHeaders: {
"Content-Type": "text/xml",
"SOAPAction":},
mimeType: "text/xml",
method: "GET",
onSuccess : function(response) {
alert(response);
},
onFailure : function(response) {
alert("Problem with REST call w/ response = " +
response);
}

);

 

 Thanks in advance.

 

 

Message Edited by J&A-Dev on 07-29-2009 07:30 AM
Hi,

Using SOQL query in Trigger i am able to query 1000 records at a time. Since list is having the capacity of 100 records updation at a time, we are updating 1000 records using 10 different list (Dividing 100 records per list). At the time of updating it is accumulating the each list updates and giving error like 'Too Many DML Rows : 200 '. Why it is accumulating the all updates even after dividing into 10 different lists.
How to rectify this is error. Please do the needful ASAP.

Hi all,

 

I have to implement a batch process and I was thinking about building the application on the Force.com platform. I'd like to hear what your suggestions are, as I'm not sure if this is something I can do using Apex classes and triggers.

 

The goal is to provide sales summary data at the Account (object) level. The sales data is stored under contact records. Here's an example to help illustrate what I'm trying to achieve:

- Account "A" has 4 contacts with sales figures. The aggregated sales data (from all contacts belonging to Account A) will be written at the Account level.

-Ideally, this sales data present at the Account object should update when: a) the sales figure on any of its contact records change, or b) A new contat record is associated with Account A and has a sales figure > 0.

 

I wanted to build a trigger on the Contact object that will fire after inserts and after updates when the criteria is met. This should work for most users when creating/updating single records, but we also have a nightly job that updates the sales figures on a large number of contact records. This number varies from 500 to over 30K contact records. What would you suggest that I do? I know that Apex allows to retrieve up to 10K records from a single SOQL query.

 

Thanks in advance.

Hi,

I'm using the describeSObject call to retrieve the field names of an object (contact in this case). Once I get the field names, is there a way to dynamically retrieve their values from merge fields? I'm trying to avoid hardcoding the merge fields essentially. Here's what I do:

- Make describeSObject call to retrieve all field values that I'm looking for and store them in a data structure. Let's say I store the field names in an array called fieldNames.

- Merge fields are retrieved by using this syntax: "{!Contact.Phone}". Instead of hardcoding the field name, is there a way to retrieve the value by passing the field name stored in fieldNames?

 

Or if there is another way to achieve what I'm after, I'd like to hear suggestions.

 

Thanks in advance. 

Hi,

 

I am trying to set the RecordType in a before insert trigger for web to case input. The trigger code is:      

trigger CaseSetupTrigger on Case (before insert){
for (Case c: Trigger.new) {
c.RecordType = [select Id from RecordType where Name = 'Canada' and SobjectType = 'Case'];
}
}

I know the code above works as I can see the correct RecordTypeID in the debug log for some workflow rules that use the RecordType. The problem is that when the case is finally saved the RecordType has been overwritten with the default RecordType for unassigned cases. There are no workflow rules that set the RecordType. The workflow rules also use $RecordType.Name which is the name of the default recordType and not Canada as would be expected.

 

I have tried changing the case setting for "Choose the desired behavior to use when applying assignment rules to manually created records:" to "Keep existing Record Type" but this has no effect. 

 

I'm guessing that this has something to do with the order that triggers web to case and workflow rules fire but I can't seem to pin it down.

 

Any suggestions on how to get the record type set in a before insert trigger to actually stick for a web to case and not get changed?

 

Thanks

 

Hi all,

 

Is it possible to add an outputLink as a column within a table? If so, how can this be achieved?

Thanks in advance.