[4.2] - System Batch Job Option?

Posted by IramK on 07-Nov-2016 04:34

Hello,

I was trying to create a system batch job that doesn't need to run on every record of an object and is instead just a batch job that is going to create/update records on another object based on a fetch of results returned from an external API call that runs every 5 minutes. So, currently, I have created a batch job on the object where I am trying to create/update records. The major issue with this is that after the first create is completed (let's say 50 records), the next time it runs. it creates those 50 records for each of those newly created records and this keeps growing exponentially.

So, the question really is:

1) Is there a way we can perform a system batch job?

2) If there isn't a way, what is the best way that Rollbase would suggest I do in the scenario explained above?

PS: There might be many more of these in the future.

Cheers.

Iram

All Replies

Posted by Rajkumar Mateti on 07-Nov-2016 05:21

Hi IramK,

Can you explain exactly which type of Batch job and which type of trigger you want to run?

FYI: I have some idea to filter the batch job not run for all records.

1) let say i have object A with 2 records having text field vales "ä" and "b".

2) Creating a batch job of type "Data Maintenance" which will create records based on condition sample as follows. The below code create number records that matches with the condition

var x = new Array();

x["lastName"]="FromBJ";

if("{!lastName}"=="a")

 {

rbv_api.createRecord("objtocreaterec", x);

}

Hope this helps.

Thanks,

Rajkumar

Posted by IramK on 07-Nov-2016 05:31

Hello [mention:7a3777c14de749d7b0cd7c5edeadbadb:e9ed411860ed4f2ba0265705b8793d05] ,

Well, currently I am using the Data Maintenance batch job that has the option of providing the object script. The filter option you suggested is good, but it will still try to execute the batch job for all the records. Is there no other way to do this as a system option rather than comparing a field value?

Cheers.

Iram

Posted by Srinivas Panyala on 07-Nov-2016 06:00

Hi IramK,

I faced the similar situation. I created a dummy object with one record. I created a data maintenance batch job for this object. As this object has only one record the batch job executes only once. Using Server Side API, I have created/updated the records in actual object. This might not be an optimal solution but it worked in my case.

Thanks

Srinivas

Posted by IramK on 07-Nov-2016 06:22
Hello Srinivas,
 
That’s probably what I’m going to do as well.
 
Cheers,
Iram
 
Posted by IramK on 09-Nov-2016 03:41

Guys,

Thanks for suggesting the workaround for it but could this be added as an enhancement in a future release please?

Cheers.

Iram

Posted by smartsysISV on 09-Nov-2016 03:43

It should have been possible to use "Condition Formulas" in batch job.

This thread is closed