function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Force.comForce.com 

How to verify that the recordType of the record is changed or not through UI?

Hello,

 

I have changed the RecordType of a record through Apex trigger code as :

 

 RecordType rtPost = [select Id from RecordType where Name = 'Post-acceptance' and SobjectType = 'Placement__c'];

placement.RecordTypeId = rtPost.id;

 

The above mentioned code lines are running successfully with no errors but while testing through UI, the look and feel of the record doesnt gets changed, instead the debug log shows that the changed value of recordtype is assigned to the RecordTypeId field.

 

I dont know how to verify that the recordType of the record is changed or not through UI.

 

Anyone can help me?

 

Thanks

 

SatgurSatgur

1. You can add the RecordType field on the Page Layout. If you do that it will be easier for you to see the result of trigger execution outcome.

 

2. Typically if you want to have different views based on record type, then you need to create Page Layouts (one for each record type) and then update PROFILE settings to associate Correct page layout to a given record type. As long as your page layouts look different for each record type, you would be able to visually see the look & feel of the page changing when record type is changed.

 

If you have not done step #2, then easiest thing to be able to confirm record type change would be to add the field on Page layout (standard page layout) and that will show you whether the record type got changed or not.

 

- Satgur