Box Developer Blog
Published in

Box Developer Blog

Getting started with Box for Salesforce development: Part 2

Box for Salesforce

Solution Description

Create Folder button

Edit APEX Class

Part 1 RecordFolderHandler class
New Record Folder Handler class

Add APEX Triggers

sfdx force:apex:trigger:create -n AccountTrigger -s Account -e 'after insert,after update' -d <PATH TO YOUR TRIGGERS FOLDER>
sfdx force:apex:trigger:create -n OpportunityTrigger -s Opportunity -e 'after insert,after update' -d <PATH TO YOUR TRIGGERS FOLDER>
SFDX CLI trigger creation commands
Account trigger
Opportunity trigger

Test Classes

sfdx force:apex:class:create -n FRUPTriggerTest -d <PATH TO YOUR CLASSES FOLDER>
FRUP trigger test class
sfdx force:apex:class:create -n AccountTriggerTest -d <PATH TO YOUR CLASSES FOLDER>
Account trigger test class
sfdx force:apex:class:create -n OpportunityTriggerTest -d <PATH TO YOUR CLASSES FOLDER>
Opportunity trigger test class
sfdx force:apex:class:create -n RecordFolderHandlerTest -d <PATH TO YOUR CLASSES FOLDER>
Record folder handler class

Deploy

sfdx force:source:deploy -m ApexClass,ApexTrigger
Deploy Successful
sfdx force:apex:test:run --testlevel RunLocalTests
sfdx force:apex:test:report -i <TEST ID> -u <YOUR USER>
Run tests in Visual Studio Code
Automatically created account folder

Additional Resources

Black’s Beach in San Diego

--

--

News and stories for working with the Box APIs

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alex Novotny

I’m a Box Developer Advocate, helping others learn how to maximize their investment through Box Platform.