Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Lakshan Weerasinghe <[email protected]>
Co-authored-by: Anupama Pathirage <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2023
1 parent c731306 commit 140aac4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ftp-edi-message-to-salesforce-opportunity/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ configurable string ftpProcessedQuotesPath = ?;
configurable sf:ConnectionConfig salesforceConfig = ?;
configurable string salesforcePriceBookId = ?;

ftp:Client fileServer = check new ftp:Client(ftpConfig);
sf:Client salesforce = check new (salesforceConfig);
final ftp:Client fileServer = check new (ftpConfig);
final sf:Client salesforce = check new (salesforceConfig);

public function main() returns error? {
ftp:FileInfo[] quoteList = check fileServer->list(ftpNewQuotesPath);
Expand Down
6 changes: 3 additions & 3 deletions servicenow-case-to-salesforce-case/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This sample fetches cases from ServiceNow for a given time period and adds those

## Use case

ServiceNow is a widely used platform for reporting customer issues, which are attended by the support staff of organizations. However, sales staff should also be aware of support issues reported by their customers, especially if there are high priority issues. Therefore, it is important have a view on support issues in Salesforce, which is main platform used by Salesforce.
ServiceNow is a widely used platform for reporting customer issues, which are attended by the support staff of organizations. However, sales staff should also be aware of support issues reported by their customers, especially if there are high priority issues. Therefore, it is important to have a view of support issues in Salesforce, which is the main platform used by Salesforce.

This sample can be executed periodically to fetch all unsynced support issues from ServiceNow and add high priority cases to Salesforce under the corresponding Salesforce account.

Expand All @@ -28,7 +28,7 @@ This sample can be executed periodically to fetch all unsynced support issues fr
4. Provide the client ID and client secret to obtain the refresh token and access token. For more information on obtaining OAuth2 credentials, go to [Salesforce documentation](https://help.salesforce.com/articleView?id=remoteaccess_authenticate_overview.htm).
5. Fill in details under the `Salesforce configuration` in the `Config.toml` with Salesforce access details.
6. Create a sample Account named `Avino` in Salesforce.
7. Create a new custom object in Salesforce named `Support Case`, and following fields to it.
7. Create a new custom object in Salesforce named `Support Case`, and the following fields to it.
* Support Case ID - Text(80)
* Account - Master-Detail(Account)
* Created on - Text(100)
Expand Down Expand Up @@ -72,7 +72,7 @@ refreshUrl = "<salesforce-refresh-url>"

## Testing

1. Create an account in ServiceNow and create few support cases under that account.
1. Create an account in ServiceNow and create a few support cases under that account.
2. Create an account with the same name in Salesforce.
3. Change the date in `resources/syncdata` file to some date before the creation of ServiceNow cases.
4. Run the sample using the `bal run` command.
Expand Down
6 changes: 3 additions & 3 deletions shopify-customer-to-salesforce-customer/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This sample listens for notifications from Shopify on customer updates and creat

## Use case

It is important to synchronize customer and sales data among ecommerce platforms and Salesforce. In Shopify, a popular ecommerce platform, customers can register by providing their email addresses. Then customers can update their details later at anytime. This sample listens for customer data updates in Shopify and create or update corresponding customer details in Salesforce.
It is important to synchronize customer and sales data among e-commerce platforms and Salesforce. In Shopify, a popular e-commerce platform, customers can register by providing their email addresses. Then, customers can update their details later at any time. This sample listens for customer data updates in Shopify and creates or updates corresponding customer details in Salesforce.

## Prerequisites
* Salesforce account
Expand Down Expand Up @@ -55,5 +55,5 @@ refreshUrl = "<salesforce-refresh-url>"
## Testing

1. Navigate to the online store view of the development store and register a new customer by providing an email address. Validate the confirmation email sent to the provided email address.
2. Login to Salesforce and check the Customers records. New customer record with the given email will be created.
3. In the Shopify store, change the customer's first name and last name. Customer name of the corresponding customer will be updated in Salesforce.
2. Login to Salesforce and check the Customer records. A new customer record with the given email will be created.
3. In the Shopify store, change the customer's first name and last name. The customer name of the corresponding customer will be updated in Salesforce.
2 changes: 1 addition & 1 deletion shopify-customer-to-salesforce-customer/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ service /salesforce_bridge on new http:Listener(9090) {
resource function post customers(@http:Payload ShopifyCustomer shopifyCustomer) returns error? {
SalesforceCustomer salesforceCustomer = transformCustomerData(shopifyCustomer);
error? e = updateSalesforce(salesforceCustomer);
if (e is error) {
if e is error {
log:printError("Error occurred while updating Salesforce for customer: " + salesforceCustomer.toJsonString(), e);
return e;
}
Expand Down

0 comments on commit 140aac4

Please sign in to comment.