The application screen looks like as below. Now the task is very first when the application is launched CANCEL button should be invisible and once EDIT button is clicked then only CANCEL button would be visible.

Go to the application controller class. Open the OVERRIDE_EVENT_OVP method.

put the below code.

Now test the application again. Now the CANCEL button is hidden now. once Edit button is clicked, the CANCEL button again appears.