---
schema_version: "1"
id: 794624afc0da5715d131ac511b148db884cfe11a93a427e652c065fc132cb152
title: HandleUpsertError
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/financial_services_cloud_object_reference/apex_fsccashflow_handleupserterror.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.financial_services_cloud_object_reference.meta/financial_services_cloud_object_reference/apex_fsccashflow_handleupserterror.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4c3430bbb2e8cedded3227c44a09260e8970870fc29c4b2817e6da39c1c0c67b
description: Helper method that constructs the error response for upsert of a partyIncome or partyExpense record.
---
# HandleUpsertError

Helper method that constructs the error response for upsert of a partyIncome or partyExpense record.

## Signature

call(String action, Map<String, Object\> args

## Return Value

Returns a list of errors encountered while upserting the record in the database.

## Examples

Input and output JSON example of the action are as follows.

Input format:

\[
    {
        "Name": "PI-0000000003",
        "UsageType": "CashFlow",
        "IncomeFrequency": "Monthly",
        "IncomeType": "Salary",
        "Id": "2m3SG000007dkxxYAA",
        "IncomeAmount": 999.99,
        "PartyId": "001SG000004TCxxYAG",
        "IncomeStatus": "Active",
        "StartDate": "2024-01-29T08:00:00.000Z"
    }
\]

Output format:

\[ { "UpsertError“: "Invalid Id“ } \]