NetClose - Find bills with orphaned amortizations
Overview
An orphaned amortization is a NetClose Amortization record whose Source Transaction is a bill, but no line on that bill references it in the NetClose Amortization column. This happens when a user clears the amortization fields on a bill line or deletes the line after the amortization was created. NetClose doesn't delete the amortization when this happens. It stays on its current status and still names the bill as its source.
When you open a bill that has orphaned amortizations, NetClose shows this banner: "Orphaned Amortizations Detected - N amortization(s) are linked to this transaction but are not referenced on any transaction line." The banner only covers the bill you're viewing. To find every affected bill at once, use one of the methods below.
Prerequisites
- A role that can view bills and NetClose Amortization records.
- For Method 1, a role that can create saved searches.
- For Method 2, a SuiteQL query tool installed in your account.
Step-by-step process
Method 1 - Saved search (no SQL tool needed)
- Navigate to Reports > Saved Searches > All Saved Searches > New, and select NetClose Amortization.
- Enter a search title, for example "Orphaned amortizations on bills".
- On the Criteria tab, on the Standard subtab, add:
- Source Transaction is not empty
- Source Transaction Fields... : Type is Bill
- On the Criteria tab, click the Summary subtab and add:
- Summary Type: Sum
- Field: Formula (Numeric)
- Formula:
CASE WHEN {custrecord_nact_amortization_source.custcol_nact_amortization} = {name} THEN 1 ELSE 0 END - Value: equal to 0
- On the Results tab, click Remove all, then add these columns:
Field Summary type Source Transaction Name Group Formula (Numeric): CASE WHEN {custrecord_nact_amortization_source.custcol_nact_amortization} = {name} THEN 1 ELSE 0 ENDSum Any other desired fields Group - Click Save & Run.
Each row in the results is an orphaned amortization, and the Source Transaction column shows the bill it's linked to. The formula column shows 0 on every row by design: the summary criteria keeps only amortizations that no bill line references.
Every column needs a summary type
This is a summary search, so every column on the Results tab must have a summary type. Remove any default columns you don't need, or set a summary type on each one.
Method 2 - SuiteQL
If your account has a SuiteQL query tool, run the below query. If you have the Shared Transactions by Netgain SuiteApp, you can access the SuiteQL query tool via Netgain > Development > SuiteQL Editor.
SELECT
t.id AS bill_internalid,
t.tranid AS bill_reference_no,
a.id AS amortization_internalid,
a.name AS amortization_name
FROM customrecord_nact_amort a
JOIN transaction t ON t.id = a.custrecord_nact_amortization_source
LEFT JOIN transactionline tl ON tl.transaction = t.id AND tl.custcol_nact_amortization = a.id
WHERE t.type = 'VendBill' AND tl.id IS NULLEach row is one orphaned amortization and returns four columns:
| Column | Description |
|---|---|
| bill_internalid | The internal ID of the bill the amortization is linked to. Use it to open the bill. |
| bill_reference_no | The bill's Reference No. Blank if none was entered on the bill. |
| amortization_internalid | The internal ID of the orphaned amortization. |
| amortization_name | The amortization number, for example AMRT0507. |
To check every source transaction type, not just bills, remove t.type = 'VendBill' AND.
Clean up an orphaned amortization
- Open the amortization from the search results.
- Confirm it isn't needed. If it's still Pending, click Delete.
Limitations / callouts
Removing a bill line doesn't delete its amortization
Clearing the amortization on a bill line, or deleting the line, leaves the amortization in place and still linked to the bill. Delete the amortization from its own record.
