How to create a search to show the overdue invoice information of all the customers till the previous month

let invoiceSearchObj = search.create({
                    type: "invoice",
                    filters:
                    [
                       ["mainline","is","T"], 
                       "AND", 
                       ["daysoverdue","greaterthan","0"], 
                       "AND", 
                       ["type","anyof","CustInvc"], 
                       "AND", 
                       ["trandate","before","startofthismonth"],
                       "AND", 
                        ["customer.email","isnotempty",""]
                    ],
                    columns:
                    [
                      
                       search.createColumn({
                          name: "email",
                          join: "customer",
                          label: "Email"
                       }),
                       search.createColumn({name: "entity", label: "Name"}),
                       search.createColumn({name: "tranid", label: "Document Number"}),
                       search.createColumn({name: "amount", label: "Amount"}),
                       search.createColumn({name: "daysoverdue", label: "Days Overdue"}),
                       search.createColumn({
                          name: "salesrep",
                          join: "customer",
                          label: "Sales Rep"
                       })
                    ]
                 });

Leave a comment

Your email address will not be published. Required fields are marked *