Hi All,
There are a lot of requests to pull the bill credit details from a created related bill payment transaction.
An enhancement was created for this functionality in Netsuite: "Enhancement 213645: Search to show all Bills and Bill Credits associated to a Bill Payment".
Showing the information of the Bill Payment's Credits Applied Sublist in a Saved Search is currently a limitation of NetSuite and the following related Enhancement Request has been filed for this:
Enhancement 213645: Saved Transaction Search > Type is Bill Payment > Ability to Pull Up One Line of Bill Payment per Bill by enabling the Bill Payment's Applied To Sublist.
We cannot create a Saved Search for Bill Payments and show the applied Credits as there is no available field we can use in a Search. On the normal suite scripts side also there are some limitations.
Reporting Workaround
We can make use of a transaction workbook to pull this data and it can be used for reporting.
There will be a join called Credits Applied to pull this data.
Customization Workaround
If this is to be used in the Customization side. We can go with SuiteQL query to pull this data. The sample Query I used is shown below.
We can fetch the bill credit from a bill payment transaction using suite QL.
function getBillPaymentCredits(billPaymentId) {
var queryResults = query.runSuiteQL({
query: `
SELECT
Applied.nextdoc as billCreditId
FROM
AppliedCreditTransactionLineLink as Applied
WHERE
Applied.paymenttransaction = ${billPaymentId}
`
});
var results = queryResults.asMappedResults();
return results;
}
Please note this is just a reference. You can modify and adjust based on your requirements.
Hope this is useful for the NetSuite Users.