• Abhik Saha
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
If you look at the general approach to write a batch, it asks to implement the Batchable interface. The sample code is like this -
global class Accountupdate implements Database.Batchable<sObject> 
{ 
:
:
Here, one thing is absurd - what is the use of datatype sObject in the interface name? Can we write an interface like this?
Also, Salesforce doc says you need to implement start method -
global (Database.QueryLocator | Iterable<sObject>) start(Database.BatchableContext bc) {}
But in an interface how can you define a method with 2 return types? Again, when you actually implement this, you are implementing with just any one of these return types - Database.QueryLocator or Iterable<sObject>. How does this work?

In a nutshell, how has salesforce written the Batchable interface?
 
Salesforce provides Limits.getHeapSize() to check the heap memory usage within a batch. But I want a way (that can be a complex way, no issue) to track this from outside of the batch. You can consider this as an admin process which is trying to monitor the running batch over a time period. We get job Id etc for the running batches. can we use that? I saw the REST API call for Limits is not useful for this scenario, as it returns a general/overall metrics.​
Hi, I am thinking to host my application in Heroku using work dynos. My application would call a number of API calls, that might cross the API call limit per user in Heroku. Moreover the communicated request and response data may also cross the cache limit. As I can develop both heroku app and the API, I need to know system information of a dyno, at the level of API calls. In other words, I need to know when an API is called, how long does it take to return, how much memory is used during sending a request and getting a response. How can I know all these informations? What are the commands? And is there any limitation to know these in demo version?
If you look at the general approach to write a batch, it asks to implement the Batchable interface. The sample code is like this -
global class Accountupdate implements Database.Batchable<sObject> 
{ 
:
:
Here, one thing is absurd - what is the use of datatype sObject in the interface name? Can we write an interface like this?
Also, Salesforce doc says you need to implement start method -
global (Database.QueryLocator | Iterable<sObject>) start(Database.BatchableContext bc) {}
But in an interface how can you define a method with 2 return types? Again, when you actually implement this, you are implementing with just any one of these return types - Database.QueryLocator or Iterable<sObject>. How does this work?

In a nutshell, how has salesforce written the Batchable interface?
 
Hello Helper

I wowuld like  to create  an  attchment  in an apex  code

I have a List<String>   variable  n my apex  and I want  somehow  to save the strings  in a file  and attach it  to a custom object

I  know the attachment  object  and I know  I can  link this  object  with another custom object

what I do not know  is how  to add my  data  to the attachment object

I sew the field  Body  of  the Attachment  object  but I do not know  how  to  pass my  string list data  to the body



any advice is appreciated

Best  Regards
Csaba


  • January 30, 2014
  • Like
  • 0

Hi All,

 

Is there any possibility of setting Apex Batch Size in Batch Apex. If so where would I have to specify that and is it possible to increase the batch size to more than 200. 

 

Thanks in Advance, 

 

 

Cheers,

Prasad

  • September 08, 2010
  • Like
  • 0