Developing Salesforce Lightning Web Components

In mid-2020 we started a project to build small Salesforce components that could be added to any application or even a registration page. That project has grown to include twelve components currently in production and many more on the way. We publish the components on the AppExchange for free so any Salesforce administrator can install them into their org to try them out. Our team builds components that are utilities that can help us on a daily basis, or complement our other work in some way.

Developing Salesforce Lightning Web Components

Lightning Web Components

There are a few approaches we could take to build components like these, but we wanted to take advantage of the newer Lightning web component architecture. It uses JavaScript, HTML, CSS, and the Lightning Design System. When we need to access custom and standard object definitions or build and call REST APIs, we use the Salesforce Apex programming language.

Lightning web components are a powerful tool because they present data to the client in a dynamic and reactive way. Most components are designed to directly support the Salesforce users who will be interacting with them. This approach allows our team to build for desktop and mobile with very few differences in the code structure. And the Lightning Design System is crucial for designing and developing a UI that is consistent with the rest of the Salesforce experience and is easy for the end-user to understand.

Even though all the components are “components”, some of them could be classified as “sub-components”, meaning that one could be nested and work inside another. This allows the team to distribute tasks better and work more efficiently. It also allows the components to be scalable and to add more features to a single component. It also has the advantage of making the work neater: the code is more organized as each component has its own functionality. 

 

Customer-centered Logic

When creating a component that runs in a complex environment like Salesforce, we want to be sure to minimize the number of interactions with the server. Customer-centered logic helps us reduce response time and to create elements that interact with the client faster. This approach lets the server delegate many of its responsibilities to the browser. Since it acts as a controller, all the user’s logic is handled by the browser.

Developing in this way requires a disposable cache that stores data locally, reducing the response time. The approach is called a “View-Controller-Controller-Model” because it has both a server-side and a client-side controller. Other frameworks such as Visualforce do not interact as quickly with the customer because they continuously consult the backend and request information and/or approvals. They depend 100% on the server. The server has to handle all the user’s requests and analyze what the user needs, then access the database, answer the question, and then render the page for the user. Not very efficient.

 

Component Ideas

The process of building a Lightning Web Component starts with a brainstorming session. Once all the ideas have been discussed, the team does a reality-check and chooses the most Lightning web component-friendly options. Then a team is designated to research available APIs on the market and determine which libraries they need. It’s only at that stage that we determine if it is feasible to develop that new component. If it is, a designer then creates a sketch with the layout, titles, logo, and color palette, and the development team starts building the components and Apex classes. 

We currently have three Lightning web components published on the AppExchange, including Oktana Calendar and Oktana Youtube, with more components already in the security review process. It takes time for the Salesforce security team to complete their review and approve any app or component, and that review process has become even more rigorous recently. We’re excited to share with you our new components as they’re approved and published on the AppExchange. Keep an eye on this blog or check our Salesforce AppExchange listings page.

 

Why Become a Certified MuleSoft Developer

 

Interested in obtaining your first MuleSoft certification, but still have some questions about it? Ana, a developer in our Ecuador office has some answers:

WHY BECOME A CERTIFIED MULESOFT DEVELOPER

What is the advantage of learning MuleSoft?

The most important advantage that MuleSoft has against other platforms is that it allows you to develop and manage APIs easily. You can even drag and drop components and integrate systems. With MuleSoft Anypoint™ Exchange you can add your APIs to a marketplace to reach a broader audience. That same marketplace gives you connectors that can make your life easier. For example, MuleSoft allows you to use a Facebook or a Salesforce package to integrate systems more easily.

 

Do you have to be a programmer?

Knowing how to code, or at least understanding how to do it, is useful because it helps you better understand certain topics in the MuleSoft training. For example, DataWeave, try-catch blocks for error handling, and other concepts like that are things you will need to know to be successful.

 

Do I have to know a specific programming language to learn MuleSoft?

You don’t need to know any specific programming language. But you just have to know how to code; that should be all you need.

 

How does MuleSoft help companies to grow?

When a company needs to integrate systems, MuleSoft gives them an advantage. With pre-built connectors, MuleSoft makes it easier to connect those systems without having to write a large amount of custom code. Also, if a company wants to produce its own APIs and possibly sell them, the MuleSoft Anypoint Platform makes that easier. They can even use Anypoint API Community Manager to create a Salesforce Experience Cloud community for API developers, which can help quickly grow adoption for the APIs.

 

Are there any prerequisites before someone takes the MuleSoft developer certification Level I certification? 

It’s important to understand programming and knows a bit about APIs, like what they are, how they’re used, and why you’d use them. MuleSoft certification is not very difficult as long as you know your basics. 

 

It is possible to achieve the MuleSoft developer certification by myself?

Of course, it’s possible. And it’s a great opportunity since the course is free. To start, go to the training page and sign up. If you pass the training, then the exam is free.  You should take advantage of this opportunity! Just remember, you need some experience with coding to know the terms and to understand DataWeave. It shouldn’t be too challenging for you.

 

What is the best API?

Which API is best depends on the project you’re working on. So maybe, if you want to incorporate a map in your system, consuming the Google Maps API would be the best solution for you (if it complies with all the requirements you need to meet).

 

What is the next step after you earn the MuleSoft developer certification Level I – Mule 4?

After you achieve your certification, your next step could be to go for the  Integration Architect certification. In my case, I want to gain more experience with MuleSoft projects before I become a certified Integration Architect. For that certification, MuleSoft has training that can help you, but it is not free. 

 

How long does it take to get MuleSoft developer certified?

That’s a great question, but it really depends on you. You could finish this course in five days if you are 100% committed, but you can also use other kinds of resources. Just to be sure you are ready before you take the exam. So it could take, five days, one week, or two weeks, it all depends on you and the time and effort you put into it.

Here are some great resources that helped me: 

 

In which kind of projects can I use MuleSoft?

You will use MuleSoft only for projects that require integrating systems. For example, if in your project you integrate a database and then you want to use that data in another system, you can use a specific API for that. But it really depends on the project and your requirements.

 

As a front-end developer, do you think it is useful? or is it only used in the back-end?

I think that as a front-end or a back-end developer it could be very useful to have a full understanding of what MuleSoft can do. So it’s worth getting this certification to give yourself a better understanding. As I said, this is a huge opportunity and the exam is free,  so you must take it!

If you want to know more, watch the webinar about MuleSoft certification and Ana’s experience.

Interested in learning more? Check out some of our latest MuleSoft articles:

Why Connect your Apps to Salesforce

Founded in 2014, our focus here at Oktana is to help customers integrate their systems with Salesforce, whether through custom development or integration with third-party services. Our onshore and nearshore Salesforce experts have certifications across a wide range of products in addition to Salesforce, like Informatica (Informatica Specialist Certification) and MuleSoft (MuleSoft Certified Developer – Level 1, Mule 4 Certification).

We have helped our customers integrate their Salesforce ecosystem with almost everything. Our experience ranges from complex data migrations to building personalized user experiences, enabling companies to connect and leverage data of any kind to create a 360-degree view of their business. Across multiple industries, we have helped our customers integrate with technologies like Facebook, Amazon Web Services, Microsoft, Bevy, Instagram, Twitter, Google News, LinkedIn, Webex, Gotomeeting, MuleSoft, and many more. Read more about Oktana’s Salesforce Integrations stories.

The idea of integrating with Salesforce is to make your Salesforce CRM experience even better. Uniting information into personalized views helps users and managers make better decisions. In other words, connecting Salesforce with apps and tools that you already use helps you run your business more efficiently and provides much greater operational visibility.

For a Salesforce integration process to go smoothly it is important to understand your business goals, create a fool-proof plan, and provide training for your team to make the most out of your Salesforce integration services. 

 

What are the different types of Salesforce integrations?

1. App-Based Salesforce Integration

The vast majority of organizations use Salesforce to manage data, develop leads, and provide effective customer service. Numerous third-party apps are integrated with Salesforce to streamline the CRM by providing business applications and reducing data duplication. This includes integrating apps from the Salesforce AppExchange. At Oktana, we’ve built and managed several Salesforce AppExchange apps including one of our own, Tok for real-time communication with Chatter.

 

Tok - For real time communications

 

Also, we have worked on implementing MuleSoft solutions since it was first acquired by Salesforce and we are experts at customizing and integrating the new Anypoint Platform™.

 

2. Code-based Salesforce Integration

Salesforce integration can also be done using programming languages. Apex is the default Salesforce programming language that has Java-like syntax. There are numerous advantages of using Apex, the most common ones are that it is easy to use and test, it is hosted on the Lightning Platform, and offers built-in support.

At Oktana, some of our senior staff have more than 15 years of experience programming with Apex.  We’ve worked on projects that required using APEX to make API calls to external systems, allowing access to information that they needed in their Salesforce org. Integrating this way can sometimes be the only option, but it can be more work to maintain than leveraging an app-based integration.

 

What are the possible ways to integrate with Salesforce?

Integration typically occurs within 3 different areas: user interface (UI), business logic, and data to provide a greater level of operational efficiency, standards, and consistency to users.

 

1. User Interface Integration

A great way to permit users to enter multiple apps from a single platform. One such example is the Facebook or Twitter apps. Publish tweets, send messages, and follow others on Twitter automatically. Sync contact data, manage deal flow, and automate your sales pipeline in Salesforce.

 

2. Business Logic Integration

Use Apex to handle business logic across multiple applications. It helps extend the business logic present in Force.com with outside platforms. Apex web services are used for inbound logic integration, to write logic and express it as a web service for external applications. It provides developers with the ability to apply project-specific business logic and the flexibility to add custom logic. 

 

3. Data Integration

Handle data synchronization needs by using SOAP and REST APIs to allow a single application in an enterprise to act as the primary source of a specific business object. 

 

Salesforce Integration Checklist

 

Salesforce Integration Checklist

 

1. Planning & Documentation

Planning and documentation of the assigned project are required to find additional insight into business needs and technical requirements for the project. It should include:

  • Write down the business goals
  • Identify data ownership
  • Understand integration standards & best practices

 
2. The Apps

The application is the most important part of any integration scheme and is vital for the successful accomplishment of the work. It is crucial to understand the apps and how they integrate. It must include:

  • Prepare the data 
  • Understand the dependencies for each application 
  • Enable APIs
  • Consider API limits


3. The Processes

Processes establish the flow of data from one endpoint to another, which helps in staging and modifying data before transmission to other applications. 

  • Identify the endpoints
  • Provision of effective connection for custom integration & 3rd party integration tool
  • Determine data delivery performance for applications
  • Limit and control access to trusted users


At Oktana this is just one of the services that we provide to our customers. If you are looking to boost your business success and profitability request a quote from our Salesforce integration services page. If you would like to be part of our team of Salesforce experts, check our careers page and apply for the job that best fits your skills. 

Top Salesforce Developer Certifications for 2021

Salesforce is one of the most powerful business technologies on the market, which makes Salesforce certifications a great way to gain expertise and enhance your career as a developer. At Oktana we are committed to the professional growth of everyone on our team. That’s why we have a specialized training team that guides and prepares our entire squad to tackle new challenges and to help them build expertise across the Salesforce ecosystem and across a range of languages, frameworks, and platforms. 

TOP SALESFORCE DEVELOPER CERTIFICATIONS

During recent months we have published many articles about Salesforce certifications.  They are compiled here to help you figure out which option is the best to boost your career:

 

1. Salesforce Certified Administrator

Overview: 

  • Exam Duration: 105 minutes
  • Questions: 60 multiple-choice questions + 5 non-scored 


The Salesforce administrator certification helps you better understand Salesforce CRM fundamentals and demonstrates your expertise and abilities in the platform. You should be able to maintain a Salesforce org,  support common business requirements and inquiries, and last but not least, execute Salesforce administrative tasks. 
Not sure what Salesforce admins do? Start with this Trailhead module: Salesforce Admin: Quick Look. (10 min)

 

2. Salesforce Certified Platform Developer I

Overview: 

  • Exam Duration: 110 minutes  
  • Questions: Content: 60 multiple-choice questions + 5 non-scored 


Salesforce Certified Platform Developer I is probably one of the most important and complete certifications that Salesforce offers. Additionally, it is a prerequisite for many other certifications such as the Salesforce Certified Platform Developer II and it is the first step to becoming a system architect. It is an excellent way to demonstrate to your peers and customers that you have the required skills to complete a successful development project.

 

3. Salesforce Certified Platform Developer II

Overview: 

  • Exam Duration: 120 minutes  
  • Questions: Content: 60 multiple-choice questions 


The Salesforce Platform Developer II certification exam may seem daunting at first, but with some studying and determination, you’ll have that certification under your belt in no time.

It’s important to mention that to achieve this certification you must have already obtained the Salesforce Platform Developer I certification. During your preparation for this certification, you will learn how to leverage the advanced programmatic capabilities of the Salesforce platform and data modeling to include more complex business logic and UIs in applications.

 

4. Salesforce Nonprofit Cloud Consultant

Overview: 

  • Exam Duration: 90 minutes  
  • Questions: Content: 60 multiple-choice questions 


This certification enables you to design and implement solutions that are maintainable, scalable, and meet nonprofit business requirements. During your preparation for this certification, you will build a solid understanding of data management and database concepts, understanding of internet technologies and cloud computing, and more. If you are interested in earning this certification, you must first become a Salesforce Certified Administrator.

 

5. Salesforce JavaScript Developer I

Overview: 

  • Exam Duration: 105 minutes  
  • Questions: Content: 60 multiple-choice questions 


The Salesforce JavaScript Developer I certification, introduced in 2020, is an excellent way to demonstrate experience developing with one of the most popular web programming languages. JavaScript developers work with front-end and back-end development and even related technologies like Salesforce’s Lightning web components. This credential is a great way to further your development career.

 

6. MuleSoft Certified Developer – Level 1 (Mule 4)

Overview: 

  • Exam Duration: 120 minutes 
  • Questions: Content: 60 multiple-choice questions 


MuleSoft streamlines the process of integrating various systems, like new APIs, Salesforce, ERP, or legacy applications. It is a unique technology that makes it easier to integrate systems and manage the entire lifecycle of your APIs, including building, testing, deploying, and managing.

Even though there are no prerequisites for this certification, our team recommends having background knowledge of REST API services, the basics of web concepts, HTTP requests, and knowing how these work from a server perspective.

 

7. Tableau Desktop Specialist Certification

 

Overview: 

  • Exam Duration: 1 hour 
  • Questions: 30 multiple-choice questions 


Tableau is a visual platform that transforms the way we use data to solve problems. It empowers people and organizations to make the most out of their data. In 2019, Tableau was acquired by Salesforce, but its mission remains the same: to help people see and understand their data. 

Our team highly recommends this certification. Companies like Amazon, Experian, and Unilever trust Tableau business intelligence (BI) and analytics software to explore, visualize and securely share data in the form of workbooks and dashboards. Tableau is very user-friendly with drag-and-drop functionality. Tableau Desktop Specialist allows you to quickly clean, analyze, and visualize your data.

8. Informatica Specialist 

 

Overview: 

  • Duration: 90 minutes 
  • Questions: 70 multiple-choice questions 


Okay, it’s not an official Salesforce certification, it’s more like a complementary certification. Informatica enables you to migrate data from different data sources and transform the data according to business requirements.

Informatica certification is in heavy demand by enterprise companies that have large databases they would like to connect to Salesforce. If you work with Salesforce, this certification will expand on the methods you know to integrate Salesforce plus enable you to provide additional value to your internal teams or clients. 

Interested in working on Salesforce projects? We are now hiring! Check out our open positions on our careers page.

Salesforce Direct Message API: the new way to communicate

APIs (application programming interfaces) make our professional life, as developers, much simpler. This feeling is more remarkable when it comes to IT messaging apps. APIs were always good allies. Today, we will share how the Salesforce Direct message API is helping us improve communication for our customers.

APIs: What are they for? 

Firstly, we want you to picture this: developers are normally running huge projects and need to create brilliant solutions in a short period of time. Therefore, we need to build bridges between different systems that, often, have never been related. In these situations, we need to be strategic and creative to meet our customer’s expectations and enhance the user experience. 

This is when APIs become our best friends. They are able to make two or more systems interact with one another. Oxford defines an API as: 

“A set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other services.”

This might sound difficult but the fact is, APIs are everywhere. Every time you use your phone, check your social media apps, share data within your company, or chat with your teammates, there are APIs working behind the scenes. 

Direct Message API, a whole new messaging experience in Salesforce

Chatter, the Salesforce enterprise collaboration tool, is no exception. Since Chatter is part of Salesforce, there are several Message APIs that make it possible to integrate this product with other solutions. 

For those who are not familiar with Chatter, we are talking about the product Salesforce built to provide a collaborative communication platform. All Salesforce employees, partners, and most customers interact, collaborate, and share information from within Salesforce using Chatter. Everything is available to your teammates and securely archived.

We started testing the new Direct Message API, and let us tell you, the experience is becoming way more flexible and enjoyable. 


Salesforce Direct Message API

How to Integrate Salesforce with Python

Today’s post is about, you guessed it, using Python and Salesforce together. Salesforce offers a few different REST API endpoints that allow us to interact with our org. They also offer a SOAP API, but we’re not going to use it today. In fact, we don’t need to worry about the endpoints at all. Thanks to a Python library called Simple-Salesforce.

Casinos are integrating salesforce with python to automate their sales processes. They see the benefits of being able to more effectively manage and track customer data, as well as improve the overall customer experience, which you can read more about at Olympia Casino review. Salesforce provides a wealth of capabilities for automating sales processes, and casinos see great potential in using this technology to improve efficiency and drive better results. By incorporating Python into their sales process, casinos can better analyze customer data and respond to customer inquiries more quickly. Additionally, the use of Salesforce automation tools allows casinos to more effectively manage customer relationships. Casinos are using Python because it is a fast, versatile programming language that can be used for automation and data analysis. Salesforce offers a variety of integrations with other software systems, so casinos can quickly build out custom applications. The integration enables casino operators to better track customer activity, optimize sales processes, and provide superior customer service.

 

We could do this all by hand with the built-in requests library. You would have to handle sessions, OAuth process and save tokens, deal with request headers, encoding and decoding JSON, creating configs to handle all the different endpoints, etc…

Elden Ring game developers integrate Salesforce with Python in order to increase efficiency and data analysis. The integration between the two platforms allows for quick and easy access to all of the game’s data such as caelid colosseum elden ring. This increased efficiency has helped the developers make better decisions about how to improve the game, which has resulted in a more immersive experience for players. Salesforce is an essential tool for managing customer data, and Python is a powerful programming language that can be used to automate complex tasks. By integrating Salesforce with Python, game developers are able to streamline their processes and improve efficiency. The integration allows the developers to manage tasks, profiles, leads, and more using Python programming. This integration also allows for data synchronization between Salesforce and the Elden Ring game’s database.

Simple-Salesforce Python Library

This is where the wonderful world of open source software comes to the rescue. A man named Nick Catalano created a library called simple-salesforce. From what I understand, he isn’t actively developing it anymore, but due to open source, the community has picked up adding features. It has about 50 contributors as of July 8, 2020. The lib is being actively developed, with new features added like bulk API support and formatted SOQL queries!

 

 

With a bit of the background out of the way, let’s start digging into the library and see what we can do with it. First, no better way to explain what simple-salesforce is than to quote the README itself:

 

Simple Salesforce is a basic Salesforce.com REST API client built for Python 3.3, 3.4, 3.5, and 3.6. The goal is to provide a very low-level interface to the REST Resource and APEX API, returning a dictionary of the API JSON response.

Simple Salesforce

 

In plain text this quote means Python 3.x is supported, REST requests are handled for us, and the data we want comes back as a native Python data type. Great! Just what we want.

 

Login Information

 

First up, we’ll need a few things from Salesforce. Three things to be exact. Our username (email), password, and security token. The username and password should be pretty easy to find in your profile settings in your Salesforce org, but where do we find the security token? We don’t really see it, rather we’ll need to reset it.

 

 

 

 

 

 

 

 

 

After clicking “Reset Security Token” , you should be sent an email containing your new token. Save this, we’ll need it in the next steps. That’s all we need from Salesforce to get up and running. Now that we have that, let’s start building our Python script and start playing with our org.

 

pip and pipenv

But first, a quick word about PIP. While working on this example, there was an update to simple-salesforce lib. Github has the current version and we need the format_soql method from it. But pip (PyPi) hasn’t been updated with the new version as of yet, July 2 2020. So, we’ll need to install it via it’s repo on Github.

 

pipenv install -e git+https://github.com/simple-salesforce/
simple-salesforce.git#egg=simple-salesforce

If you are using the demo repo I built, we won’t need to worry about the requirements or dependencies if using pipenv. The demo has a Pipfile that’s pulling from the repo already thanks to the magic of pipenv.

The code

Now, let’s write some code. First up, we’ll bring in the libs we’re going to use. The only one that is not part of the standard lib is simple-salesforce:

from simple_salesforce import Salesforce, format_soql

from pprint import pprint
import json

Simple enough, import simple-salesforce, pprint (pretty print), and json. pprint is only used to make the terminal output look better, so it’s not needed for the core examples. json is used to get the credentials from a .json file, which is what we’ll do next.

# open file holding our login information
# we have the login info in a separate file so we can
# add it to .gitignore to help prevent leaking the information
# environment variables could also work
with open("login.json", "r") as login_file:
    creds = json.load(login_file)

Keep credentials secret

If you were on a project working in a private repo and multiple people needed access to the login credentials, keeping login info in the script itself would be okay, not ideal but okay. The reason we’re doing it is because it’s good practice and it’s open to the public on Github. So hiding and not committing sensitive information is important. This goes for any language or code base.

With that disclaimer out of the way, I included an example login.json file called very creatively “EXAMPLE_login.json“. Let’s take a quick look at it.

{
    "login": {
        "username": "[email protected]",
        "password": "My-REALLY-amazing-password",
        "token": "kdjfghdgfFGJbDFgd36DFGHDfgh"
    }
}

Very simple json object only containing the three things we got from the last steps. You can just copy/paste the “EXAMPLE_login.json” and rename it to just “login.json“, then update it with your login information. You can do this in the file explorer or VSCode, but here’s a quick example to do it from the command line.

cp EXAMPLE_login.json login.json
vim login.json

Salesforce Object

With our new login information, we can create the salesforce object back in our python script.

sf = Salesforce(username=creds['login']['username'],
                password=creds['login']['password'],
                security_token=creds['login']['token'])

And that’s it! We now have an object that represents our org, and now we can start doing cool things like SOQL or DML. Next, since we have everything we need to start awesomeness, let’s try a simple SOQL query.

SOQL Query

# an example of running a simple SOQL query
SOQL = "SELECT Id, Email FROM Contact"
data = sf.query(SOQL)
for d in data['records']:
    pprint(f"{d['Id']} -- {d['Email']}")

We defined the query string to get the Id and Email from all the Contacts, called the query() method of our salesforce object, then looped through the returned records and display the results. A note to those new to Python, in the pprint() we use something called an f-string or format string. It makes it easier to embed variables in strings, much like the way Aura Components handle expressions with {!v.my_var}

SOQL is cool and all, but what about adding new data to our org? We can do that too, very easily. We’ll even try using the bulk api to insert 1,000 record. But first we need to create 1,000 records. This is going to be mock or fake data just for the sake of simplicity. We’ll also be testing on the Account object, so only thing required for new records is the Name field.

data = []
for i in range(0,1000):
    data.append({
        "Name": f"Bulk Test {i}"
    })

Now we have a list of dictionaries that represent our record data. Here we have a for loop filling a list with new items. We could also use list comprehension to replace these 5 lines of code with just one.

data = [{'Name': f"Bulk Test {i}"} for i in range(0, 1000)]

Bulk Insert

To bring these new records into Salesforce, we use the .insert() method for the object we want, coming from the salesforce object we created. Confused yet? Here’s the insert code, it should help make things more clear.

# insert the new account using the bulk api
x = sf.bulk.Account.insert(data, batch_size=10000, use_serial=True)
pprint(x)

Here, we’re telling our org we want to use the bulk api “sf.bulk“, then which record object we’re working with “.Account.“, and finally what we want to actually do “.insert()“. We could use any object too, doesn’t have to be just Account. Even custom objects work, so instead of where Account is, we can replace it with something like sf.bulk.MyCustomObj__c.insert(..... We can also specify the batch size, or to process in serial.

Bulk SOQL

If you visit your org and take a look at all Accounts, you should see 1,000 new accounts with names like “Bulk Test 42”. We can also try doing another SOQL query, this time we’ll use the bulk api for the query. We’ll also show how to use things such as “LIKE” in SOQL statements.

# now lets get those records so we can delete them
SOQL = format_soql("SELECT Id, Name FROM Account WHERE Name LIKE '{:like}%'", "Bulk Test")
the_accounts = sf.bulk.Account.query(SOQL)
pprint(the_accounts)

Simple-salesforce now comes with the handy little method called format_soql that allows us to do things such as LIKE. format_soql is also the reason we used the Github repo for pip instead of what’s on PyPi, the new method was just introduced in the last 2 weeks.

Now that we know we can insert and add new data and records to salesforce, let’s see about removing it. Looking at the README, seems like the delete() method needs a list of records containing the Id of the record to be deleted. The records need to be a key-value pairs or dictionary just like how the query was returned. We already have all the Id’s for our inserted record from the “bulk.query()

{'Id': '0013h00000EdP87AAF',
  'Name': 'Bulk Test 998',
  'attributes': {'type': 'Account',
                 'url': '/services/data/v42.0/sobjects/Account/0013h00000EdP87AAF'}}]

Looks like simple-salesforce also returns something called “attributes“. This just tells use which object we’re working with and which api endpoint we got the information from. For our example, and for the .delete() method, we only need the Ids. So let’s clean up and make a new list with only what we want.

account_ids = []
for a in the_accounts:
    account_ids.append({"Id": a["Id"]})
pprint(account_ids)

Here is another opportunity to practice list comprehension! See if you can get that for loop down to one line.

Bulk Delete

So now we have the list of Id’s, now we just simply call the delete() method and go refresh our org’s Account list.

data = sf.bulk.Account.delete(account_ids, batch_size=10000, use_serial=True)
pprint(data)

All the records we inserted are now gone!

Final Thoughts

In conclusion, let’s recap what we’ve learned. For one, Python is awesome. Second, integrating Salesforce in a Python project is very very simple. With only three pieces of information, we can create a native Python object representing our Salesforce org, do things with the object like SOQL and DML, and finally have access to multiple salesforce API such as bulk or search.

This is only scratching the surface. We can do much more and simple-salesforce also has methods for metadata and describe. From this basic example, we could bring in Salesforce data to Flask API’s we build or insert new data to Salesforce from a data scraping crawler we make in Python.

We can also harness the power of Python’s ecosystem of visualization and reporting such as Pandas or SciPy. Nothing stopping us from grabbing Salesforce data and running it through machine learning or neural networks using PyTorch or TensorFlow.

If you’ve made it this far, thanks for reading! Here I’ll link the demo repo containing all the code discussed in this post and a YouTube video of my presentation. Also, if you are interested in learning more about Python, you can check this article: How to do Time Series Analysis with Python & Pandas.

https://www.youtube.com/watch?v=rf1jx3jbL2M&feature=youtu.be

Heading to Dreamforce 2019

Members of our team have attended Dreamforce for years. We’re excited to host a booth once again at Dreamforce 2019.

This year, stop by the Trailhead Zone where the team will be ready to chat on Oktana and also answer technical questions about Salesforce integrations or building on the Heroku and Lightning platforms. 

MEET

You will have the opportunity to meet developers from our Montevideo, Uruguay and Asuncion, Paraguay offices:

  • Gaston Esmela
  • Giselle Ramirez
  • Iris Galeano
  • Jorge Sosa
  • Mathias Moller

When: Tuesday – Friday, 7.30 am – EOD

Where: Head to the back of the Trailhead Zone. We will be on the right in front of the Coastline Theater.

LEARN

We’ll also host a talk with Royal Caribbean International to share how, for luxury brand Celebrity Cruises, the team went from a manual collection of event leads to a custom app that enables them to make the most of events like Dreamforce. We’ll go over the business case, a quick demo and success metrics. 

Session: How Will Sales Manage All Those Dreamforce Leads? Case Study: Royal Caribbean
When: Thursday, November 21 at 11.15 am

Where: Trailhead Zone, Moscone West | Coastline Theater

Resourcing with Oktana

When you outsource development, nearshore or onshore, you probably wonder about resources and whether they’re going to work well with your internal team. At Oktana, we consider our team to be your development team. We take pride in working to get the right help for each project, whether it’s a designer, developer or a whole team. Many of our clients even choose to continue with the same team on multiple projects.

Let’s take a look at how resourcing works at Oktana.

Step 1. Gather data

First, we need a clear picture of your company and project. Your account manager will work with you to understand skill requirements, project scope and anything else you feel is essential. For example:

  • Will we work alongside your internal team? 
  • Will we need to integrate with existing systems? 
  • Are there preferred development platforms, frameworks or languages? 
  • Is business analysis, design or test automation part of the scope? 

We work with you to define “done” for the project. We are an Agile company, so this often means defining a minimum viable product, or MVP. These conversations help us determine a reasonable start and end date for the project.

Step 2. Select resources

Now that we have an idea of your needs, our resourcing team will build your development team. We want to ensure your team brings the skills to meet all of the technical requirements for your project. We also want to ensure they’re a good fit in terms of personality and experience.

Everyone should feel confident in their ability to work together.

Step 3. Review resources

As our resourcing team builds your development team, you have a few options depending on how involved you want to be in the process. You can let us handle the entire process, or you can be far more hands-on. 

If you want to be more hands-on, we’ll work with you to review a set of developer profiles. You can also conduct developer interviews to meet each team member before you sign-off on your development team.

What’s a developer profile?

Our resourcing team compiles a developer profile for each of our developers, which provides you with a good overview of their skillset, certifications and experience.

Step 4. Meet your development team

Our teams receive English tutoring and overlap with most of the US workday. Because of this, you are always able to chat or run planning sessions, review specs and do demos face-to-face by video. This is your development team. 

As your project grows, or requirements shift, your account manager will work with you and our resourcing team to adjust the team to meet those needs.

We hope all of this information helps you understand the resourcing process better and by extension how our teams work. Our team has worked with different organizations and their projects. We are Salesforce platform experts and offer custom development to help you build your platform and solve the right problems. If you want to know more about our work, go check out our latest success stories.

How we connected Salesforce and Slack

The Oktana team built a demo to share how Salesforce and Slack work together. Our team leader walks through how the team built a Node.js app on Heroku that connects to the Slack API and Sales Cloud. The app is capable of both reading and writing to Salesforce from Slack.

You can create and update Salesforce tasks without ever leaving Slack. If someone else updates or assigns a task to you in Salesforce you’ll get a notification alongside all your other Slack messages. Take a look and let us know if something like this might be a good fit for your company.

Hope you’ve found this full walkthrough useful and insightful. We are Salesforce platform experts and offer custom development to help you build your platform and solve the right problems. Our team has worked with different organizations and their projects. If you want to know more about our work, go check out our latest success stories.