function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Debse LimfDebse Limf 

Data processing with Salesforce

I'm new in Saleforce development and would like to ask for a direction. Salesforce provides good platofrm for fast creation of web applications. But what if I need to create a headless application. For example, I'd like to take records of Opportunities or any custom object, then to do some non-trivial manipulations and create new records for another object.
- Where shoudl I start?
- how to host such application: I'd like to avoid taking export data from Salesforce and put data into saleforce from outside (do not host custom developed solution on AWS)
Best Answer chosen by Debse Limf
Ricky Lowe 19Ricky Lowe 19

Hi Debse,

You have a variety of tools available in Salesforce for headless processing i.e. no UI/user input. 

In the example of taking a custom object, performing manipulations and then creating new records I would first start by asking yourself a few questions:
When should these manipulations occur? Is it in real-time when new records are created in Salesforce by integration from an external system? Or is it a bulk processing at scheduled points throughout the day e.g. every midnight.
How "non-trivial" is the processing? Salesforce has governor limits which limit the processing of records - https://www.sfdcpoint.com/salesforce/salesforce-governor-limits/

If you are looking for a scheduled job that requires significant processing then I would start looking at Batch Apex - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm

If you are looking for real-time processing then you should look into Apex Triggers. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers.htm. If you find that there is significant processing involved then you should look into combining the Triggers with asynchronous processing such as:
Future methods - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_invoking_future_methods.htm
Queueable jobs - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm

All of the above are part of the force.com/lightning platform, meaning that Salesforce runs all of the processing on their servers. 

Hope that helps,

Ricky

All Answers

ShirishaShirisha (Salesforce Developers) 
Hi Debse,

Greetings!

This can be done if the Object from which you are trying to copy the data and create records on Object are having relationship.

So that,you can write the trigger to copy the values from the parent record and then create the same or modifying some values on Child Object.

Reference for sample code:
https://developer.salesforce.com/forums/?id=906F0000000AhClIAK

You can achieve this by process builder as well.

https://www.youtube.com/watch?v=iZ2hE9nf69o

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Ricky Lowe 19Ricky Lowe 19

Hi Debse,

You have a variety of tools available in Salesforce for headless processing i.e. no UI/user input. 

In the example of taking a custom object, performing manipulations and then creating new records I would first start by asking yourself a few questions:
When should these manipulations occur? Is it in real-time when new records are created in Salesforce by integration from an external system? Or is it a bulk processing at scheduled points throughout the day e.g. every midnight.
How "non-trivial" is the processing? Salesforce has governor limits which limit the processing of records - https://www.sfdcpoint.com/salesforce/salesforce-governor-limits/

If you are looking for a scheduled job that requires significant processing then I would start looking at Batch Apex - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm

If you are looking for real-time processing then you should look into Apex Triggers. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers.htm. If you find that there is significant processing involved then you should look into combining the Triggers with asynchronous processing such as:
Future methods - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_invoking_future_methods.htm
Queueable jobs - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm

All of the above are part of the force.com/lightning platform, meaning that Salesforce runs all of the processing on their servers. 

Hope that helps,

Ricky
This was selected as the best answer