---
title: Apex Generator
slug: netsuite/apex-generator
description: Learn how to effortlessly generate Apex classes and test classes for the Breadwinner Global API with the Apex Generator tool. This comprehensive guide offers easy-to-follow steps on selecting the object and function, running the apex class, and choosing s
docTags: 
createdAt: 2021-11-05T06:26:56.000Z
---

# Generating Apex for Global API automatically

Apex is used for direct interaction with the Breadwinner Global API. Generally the domain of Salesforce Developers, apex can be daunting.&#x20;
Using the Apex Generator however, you can take a declarative approach to generating apex classes and test classes. These are considered the worker classes, which extend API functionality as invokable and exposes them to Salesforce Flows. The concept is to utilize Flow to automate your complex business logic, and apex with Global API will process the desired requests.

Apex Generator can be found on the Breadwinner for Netsuite setup page.

::Image[]{src="https://api.archbee.com/api/optimize/amOMwpmEgToJSqhaSTxXr/YSGFDToj9bs6raqL7HHzg_2023-05-1513-03-48.png" size="32" width="596" height="718" position="center" showCaption="false"}

Choose which object and what function you'd like to call

![](https://api.archbee.com/api/optimize/amOMwpmEgToJSqhaSTxXr/aU7AZFi65nG8wme2J5U7b_2023-05-1513-31-36.png)

Choose How you will run the apex class

![](https://api.archbee.com/api/optimize/amOMwpmEgToJSqhaSTxXr/7n6ZCWk9GDy_-BkucFDyc_2023-05-1513-33-15.png)

Select the fields you would like to support

![](https://api.archbee.com/api/optimize/amOMwpmEgToJSqhaSTxXr/qlIOwmJfa0PtriDP7EHvt_2023-05-1513-34-55.png)

Click Generate Apex.. and your class and test classes are built.&#x20;

![](https://api.archbee.com/api/optimize/amOMwpmEgToJSqhaSTxXr/bXRyxrVDmD6he0lpX2Rq1_2023-05-1513-36-11.png)

You are now able to copy the Class code and create the class in Salesforce (sandbox). Create the Test Class and you should be able to then deploy the Class code to Salesforce production.

With the generate code, you now have a great starting point from which to create further Apex automation. With invokable class methods, you are also able to utilize them in Salesforce Flow, giving you the ability to tackle even deeper integration between Salesforce and NetSuite.
