When you open up the widget, there is a form for you to fill out. After you fill out the form, you have to hit the "Create Job" button. When you hit that, it triggers the execution of a certain function and inside that function is where I am putting this code in.
P.S. - I do have the dependencies ("esri/request", "esri/config", esriRequest, esriConfig) included in my code.