The root cause of this error is when we copy like for like fields from a related object such as Contact to another object, for example Payment Txn, the system is copying the Last Modified Date, but is not copying the Created Date.
For most organisations, this SHOULD NEVER happen as audit fields like CreatedDate, LastModifiedDate are read only.
Audit fields should only be set to editable during data migrations and then turn back off after that.
From the setup:
- Search "User Interface"
- Locate the "User Interface" Menu option (not the top level expandable menu option)
- Make sure "Enable "Set Audit Fields upon Record Creation" and "Update Records with Inactive Owners" User Permissions" is NOT selected
- SAVE
1. Disabling Audit fields
- From Setup, enter User in Quick Find box and select User Interface.
- De-select the checkbox to disable: Enable "Set Audit Fields upon Record Creation" and "Update Records with Inactive Owners" User Permissions
- Click Save
2. The Error Log has "Program/Area: recurringPaymentsProcessor.makePayment"
This validation stopped the recurring payment processor from running. This error needs to be addressed today before the next Recurring Payment Run as the card hold may get charged again tomorrow as the system has no record of todays run happening.
From the Error Log, you need to copy the record details from and including the first "{" to and including the last “}”
Copy this to notepad or similar and paste.
Then remove the Last modified date, including the comma prior. Delete as shown in the highlight example.
Before Delete:
After Delete:
Click on the setup cog > then Developer Console
Then select Debug > Open Execute Anonymous Window
Copy the code below and paste into the window
string j = '';
AAkPay__Payment_Txn__c p = (AAkPay__Payment_Txn__c) json.deserialize(j, SObject.class);
insert p;
Select and highlight the notepad copy of the record and paste that between the single quotes in the "string j ='';"
For example the below
Press the Execute button.
This will create a new Payment Txn record. You should be able to see this under the Payment Txn Tab.
3. The Error Log has "Program/Area: paymentMatchingUtil.createContacts" or "Program/Area: paymentUtil.chargeCardAndUpdate"
The error log should be linked to the Payment Txn. Click into the Payment Txn, then check the "Banked Payment" field. If this has YES, then change the "Status" field to "Receipting Complete" and SAVE.