Move It On Over

Lets begin by copying everything we had in our app directory from the ForceJS app to the app directory of our static resource. Now we will need to add references for each of these on our page. Lets add those references now:

Remove ForceJs References

Since we are not using ForceJS we should remove all references to if from our app or we will get an Uncaught ReferenceError: force is not defined. In our app/services/sf.service.js we might as well delete everything inside the body of our anonymous function:

Empty sfService

let sfService = (() => {
})()

Now lets start adding things back. We will need to start with 2 functions once named getContacts the other getContact and expose these in a return object.

Updated Markup

That should be enough to load the app and see our header, sub-header and buttons.

App Loads

Conclusion

The buttons don’t work and it looks ugly but we know it loads. Now we just need to build out the calls to Salesforce. I was thinking of using RemoteActions, do you have a sugestion? Let me know by leaving a comment below or emailing brett@wipdeveloper.com.