another question came up that I haven't had luck w...
# suitescript
h
another question came up that I haven't had luck with yet. I'm trying to access the "schedule" tab on a sales order under billing that will show all future billing dates and billing amounts when billing schedules are used. I've looked through the schema and couldn't find anything with that specific information. does anyone know if it's available to access via suitescript or saved search?
m
The only way I've found to access this information is to use SuiteScript to access the
billingschedule
sublist on sales order .
h
I am able to access that to get certain information, but not future bill dates and amounts. I've had to calculate future bill date information in the script based on the billing schedule and wasn't sure if I was missing something somewhere
m
This code gives us the all payment dates and amounts for sales order billing schedules including future payments:
Copy code
var billingLineCount = salesOrder.getLineCount({
                sublistId: 'billingschedule'
            });

            for (var i = 0; i < billingLineCount; i++) {
                var billDate = salesOrder.getSublistValue({
                    sublistId: 'billingschedule',
                    fieldId: 'billdate',
                    line: i
                });

                var billAmount = salesOrder.getSublistValue({
                    sublistId: 'billingschedule',
                    fieldId: 'billamount',
                    line: i
                });

                billingSchedule.push({
                    date: billDate,
                    amount: parseFloat(billAmount) || 0
                });
            }
h
thank you - I'll take a look and give it a try!