Sunday 31 July 2011

Overriding Record Type with Vfpage.

Hai Friends this time cam with important topic "Overriding RecordType with Vfpage".This is Very simple and impotant.We can't achieve this Customization, we need to write Script for this.
Step1:-
First Create a Recordtype on an object.
Goto-->Setup-->Appsetup-->Create-->Object--> Create Record Type.
 Suppose like 'Accountrecordtype',
Step2:-
Create Vfpage ,in that Vfpage Code include following code for overriding record type with Vfpage.
===============================
<script language="javascript">

    if('{!account.RecordType.name}' != 'Accountrecordtype'){
        window.location = '/{!account.id}?nooverride=1';
    }
</script>
================================
Now Override the View button with that page.
Now click on the record which is having  Accountrecordtype Record type.

Cheers,
Haribabu Amudalapalli


No comments:

Post a Comment