0
votes

The functionality I have written works, this is for a test method.

In apex test code, I create a StandardController then a controller extension and invoke a method on that controller extension which returns a PageReference to a custom object's standard edit page. I want to change field values on that edit page and invoke the Save method/button, is this possible and how?

In advance, thanks.

1
Please, add peaces of your code to the questionGleb

1 Answers

0
votes

No, you cannot change values in a standard edit screen from within a test method, nor do you need to. The correct way to test logic that is executed after saving on a standard edit screen is to construct an instance of a new record, populate the fields, and insert it into the database.