I'm growing increasingly frustrated with 2.0. I have a user-event before load where I use the form object in before load to add a sublist dynamically (call it 'custpage_sublist'). It works fine. When I'm in the record UI, I see the list, I add line items, etc. I have a before-submit event where I want to read what was added in the lines. If I stringify the newRecord object in the ScriptContext, I can see the property "sublists" and I see my dynamic sublist and the lines and values. But I can't for the life of me figure out how to read this.
When I try and get a line count (newRecord.getLineCount({sublistId: 'custpage_sublist')) it always returns -1 which means there is no such list. If I attempt to call getSublistValue on one of the line columns I know is there, it returns undefined. But I can see the data when I stringify the record object. What the heck am I not doing right here? Am I missing something or is 2.0 just simply nowhere near ready for prime time and waste of time to move our code to? Frustrated...