I am trying to extend the (wonderful) solution found here: https://community.skuid.com/t/setting-default-values-for-quick-data-entry
I want to use a handy little button to give my users a faster way to create an Assignment record from a Project detail page. Projects are the Parent to child Assignments.
It would be so easy (using the tutorial above) if I just needed to create the Assignment. Unfortunately, Assignments need to be connected via lookup to a Schedule record. All Assignments have a related Schedule record, and in normal Salesforce/FFPSA life, these two records are created at the same time (or almost nearly at the same time) on a clunky, ugly Visualforce page.
What I would like to do is create a Global Action on an Assignment Table that will create both a new Schedule record and a new Assignment record, and then pass the newly created Schedule Name/ID (whatever) into the newly created Assignment’s “Schedule__c” lookup field. And then do some adding of default values and so forth, per the tutorial above.
I just don’t know how to create two new rows (on separate objects) and then pass values from one to the other using Javascript.
Even though I asked nicely for zero arguments, (included var self = arguments[0];) the code is still arguing with me.
Question
Javascript Snippet to Create a Pair of Related Records and Add One to a Table
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
