0% found this document useful (0 votes)
2 views

⛔Stuck in the Integration Part_?

The document outlines various methods for integrating Salesforce with third-party systems, including using Bulk API for data synchronization and consuming SOAP web services. It provides solutions and common mistakes for each integration method, such as invoking AWS Lambda functions and securely authenticating API callouts. Additionally, it promotes Prominent Academy's interview preparation services for Salesforce roles.

Uploaded by

VIVEK PATEL
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

⛔Stuck in the Integration Part_?

The document outlines various methods for integrating Salesforce with third-party systems, including using Bulk API for data synchronization and consuming SOAP web services. It provides solutions and common mistakes for each integration method, such as invoking AWS Lambda functions and securely authenticating API callouts. Additionally, it promotes Prominent Academy's interview preparation services for Salesforce roles.

Uploaded by

VIVEK PATEL
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

salesforce

developer

www.prominentacademy.in
Question:

How would you integrate Salesforce with a third-party


middleware like Mulesoft or Dell Boomi for large-scale data
synchronization?

Expected Logic:
Middleware handles batch data synchronization between
Salesforce and other systems.
Use Bulk API for handling large data loads efficiently.

Solution (Using Bulk API for Data Sync)


Enable Bulk API for data insertion

apex

Database.DMLOptions dmlOpts = new Database.DMLOptions();


dmlOpts.optAllOrNone = false;

List<Account> accounts = new List<Account>();


for (Integer i = 0; i < 200; i++) {
Account acc = new Account(Name = 'Account ' + i);
acc.setOptions(dmlOpts);
accounts.add(acc);
}

Database.insert(accounts);

Common Mistakes:
Not using Bulk API for large data loads—using standard DML can
hit governor limits.
Not setting optAllOrNone properly—can cause complete failure
instead of partial inserts.
Not implementing proper logging to track failed records.

📞 Don’t wait—call us at +91 98604 38743 today


Your next opportunity is closer than you think. Let’s get you there!
Question:

How would you consume a SOAP Web Service from an external


system in Salesforce?

Expected Logic:
Generate an Apex class from a WSDL file.
Call the web service using the generated class.

Solution (SOAP API Call in Apex)


Generate Apex class using WSDL2Apex.
Call the SOAP service:

apex

public class SoapIntegration {


public static void callSoapService() {
MySoapService.Soap ws = new MySoapService.Soap();
ws.endpoint_x = 'https://api.external-service.com/soap';

String response = ws.getAccountDetails('12345');


System.debug('SOAP Response: ' + response);
}
}

Common Mistakes:
Not setting the correct SOAP endpoint—causing authentication
failures.
Ignoring governor limits on callouts—SOAP calls count towards
limits.
Not handling timeouts—leading to failures on slow networks.

📞 Don’t wait—call us at +91 98604 38743 today


Your next opportunity is closer than you think. Let’s get you there!
Question:

How do you test Apex callouts without calling an actual external


API?

Expected Answer:
Use HttpCalloutMock to mock API responses.
Use Test.startTest() and Test.stopTest() in test classes.

Solution (Mocking API Response in Apex Test Class):

apex

@isTest
global class MockHttpResponseGenerator implements HttpCalloutMock {
global HttpResponse respond(HttpRequest req) {
HttpResponse res = new HttpResponse();
res.setHeader('Content-Type', 'application/json');
res.setBody('{"status":"success","data":[{"id":"1","name":"John"}]}');
res.setStatusCode(200);
return res;
}
}

@isTest
private class APITest {
@isTest
static void testAPIService() {
Test.setMock(HttpCalloutMock.class, new MockHttpResponseGenerator());
Test.startTest();
APIService.fetchAllRecords();
Test.stopTest();
}
}

Common Mistakes:
Not using Test.setMock() → Test will call real API instead.
Forgetting Test.startTest() and Test.stopTest() → Governor
limits may be exceeded.
Not handling different HTTP response scenarios (e.g., errors,
timeouts).

📞 Don’t wait—call us at +91 98604 38743 today


Your next opportunity is closer than you think. Let’s get you there!
Question:

How would you invoke an AWS Lambda function from


Salesforce?

Expected Answer:
Use Named Credentials for authentication.
Use Apex HTTP Callouts to trigger the Lambda function.

Solution (Triggering AWS Lambda from Apex):

apex

public class LambdaService {


public static void invokeLambda() {
HttpRequest req = new HttpRequest();
req.setEndpoint('https://your-lambda-url.amazonaws.com/dev/function-
name');
req.setMethod('POST');
req.setHeader('Authorization', 'Bearer YOUR_AWS_TOKEN');
req.setHeader('Content-Type', 'application/json');
req.setBody('{"param1": "value1", "param2": "value2"}');

Http http = new Http();


HttpResponse res = http.send(req);
System.debug(res.getBody());
}
}

Common Mistakes:

Not handling AWS Lambda cold starts → First request may take
longer.
Using hardcoded API keys → Always use Named Credentials.
Not handling network failures → Always add retry logic.

📞 Don’t wait—call us at +91 98604 38743 today


Your next opportunity is closer than you think. Let’s get you there!
Question:

How would you insert, update, or delete large volumes of data


using Bulk API?

Expected Answer:
Use Bulk API 2.0 for large data operations.
Submit batch requests asynchronously.

Solution (Bulk API Upsert Request Using Apex):

apex

public class BulkAPIService {


public static void insertBulkRecords() {
HttpRequest req = new HttpRequest();

req.setEndpoint('https://yourInstance.salesforce.com/services/data/v58.0/jobs/in
gest');
req.setMethod('POST');
req.setHeader('Authorization', 'Bearer YOUR_ACCESS_TOKEN');
req.setHeader('Content-Type', 'application/json');
req.setBody('{"object":"Account", "operation":"insert",
"lineEnding":"LF"}');

Http http = new Http();


HttpResponse res = http.send(req);
System.debug(res.getBody());
}
}

Common Mistakes:

Using REST API instead of Bulk API → Causes governor limits to


hit quickly.
Not handling batch failures → Always check failedResults in the
job status.
Not using parallel processing → Slows down large imports.

📞 Don’t wait—call us at +91 98604 38743 today


Your next opportunity is closer than you think. Let’s get you there!
Question:

How can you securely authenticate API callouts from Salesforce?

Expected Answer:
Use Named Credentials instead of hardcoding API keys.
Store authentication details securely.

Solution (Bulk API Upsert Request Using Apex):

apex

HttpRequest req = new HttpRequest();


req.setEndpoint('callout:Your_Named_Credential/endpoint');
req.setMethod('GET');

Http http = new Http();


HttpResponse res = http.send(req);
System.debug(res.getBody());

Common Mistakes:

Hardcoding API keys → Security risk.


Not updating Named Credentials when tokens expire.
Using basic authentication instead of OAuth.

📞 Don’t wait—call us at +91 98604 38743 today


Your next opportunity is closer than you think. Let’s get you there!
Think your skills are enough?
Think again—these salesforce
questions could cost you your
Salesforce job.
Looking to crack your Salesforce interviews and land your
dream job? 💼 We've got you covered! At Prominent
Academy, we specialize in providing end-to-end interview
preparation that ensures you're not just ready—but
confident! 💪
💡 What We Cover:
✅ Mock Interviews tailored to Salesforce roles
✅ Real-world scenario-based questions for Admin,
Developer, CPQ, and Architect tracks
✅ Guidance on resume building and LinkedIn
optimization
✅ In-depth coverage of Salesforce core concepts,
integrations, and projects
✅ Latest Salesforce certification tips and tricks
✅ Unlimited interview calls with top companies
🎯 Whether you're a fresher or an experienced professional
transitioning to Salesforce, we provide personalized guidance
to help you shine in interviews and stand out in the competitive
market

📞call us at +91 98604 38743 to learn more.

You might also like