+ Start a Discussion

How to show an object page layour if a specific condition is met

I'm pretty new in SF development and I would like to perform the following : when an opportunity is changing the status to closed won, I would like to show the page layout of a custom object.  I've written the following Apex code (for my test I imagine that my custom object is Account object), it seems that my condition is good but the account page doesn't display.  Could you please help me ?


Here is my code

trigger Action_on_Closed_Won on Opportunity (after update)
    Opportunity ops_new = Trigger.new[0];
    Opportunity ops_old = Trigger.old[0];
    if ( ops_new.IsWon && !ops_old.IsWon )
        System.debug( 'Before Account' );
        Account a = new Account();
        System.debug( 'After Account' );
        System.debug( 'Else' );
Eli Flores, SFDC DevEli Flores, SFDC Dev
Search for 'saveURL' here and you'll get heaps of information about how to do this. :)