Topic Started
This user has not created any forum posts.
Replies Created
Reply to: Salesforce Test Class Error
Monday, January 8, 2024 at 01:42amReply to: Salesforce Test Class Error
Tuesday, January 23, 2024 at 06:12amHi Duo
Thank you for the response the trick solved the insert issue.
Also, for an apex code test class which delete the package from the onespan but keep its salesforce record and then changes the status of the transaction in salesforce, I am getting a script exception as below. Can you please help me with this ?
EXCEPTION_THROWN [36]|System.DmlException: Update failed. First exception on row 0 with id aBeDE000000qt8d0AA; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ESL.PackageTrigger: execution of BeforeUpdate
Subscriptions
Topics | Replies | Freshness | Views | Users |
---|---|---|---|---|
We are working on creating Onespan transactions in Salesforce and have written out some Apex Trigger code to assist with the process. |
7 | 2 months 2 weeks ago | 265 |
Subscriptions Release Notes
This user is not subscribed to any release notes.
Hi Duo,
This is the code for a test class, we are simply trying to create a transaction record and we are again getting the error " Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You need to open the record before you can edit it." on the "insert testPackage".
Test.startTest();
Deal_State__c testDealState = new Deal_State__c();
testDealState.Docusign_Envelope_Status__c = 'Sent';
insert testDealState;
ESL__Package__c testPackage = new ESL__Package__c();
testPackage.Name = 'Test Package';
testPackage.Deal_State__c = testDealState.Id;
testPackage.ESL__Status__c = 'Sent';
insert testPackage;
Test.stopTest();