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
mojeebahmedmojeebahmed 

How to Make the RecordTypeId field's value equal to null?

Is there a way to change the RecordTypeID field's value to be null. I know that we can change the recordtypeid fields values, but is there a way to remove the value or make it equal to null. forexample if i have 2 recordtypes set for the account object, the user can select any one of these two values. but what if a user has selected a value and then he wants to remove this value. i.e no recordtype.

Please let me know if there is a posibility that we can remove a recordtype value from a record. because right now if we set the record type in a record then there is no going back i.e. no way (i know) to change it to null.

Regards Mojeeb.
mojeebahmedmojeebahmed
Hi,

    I figured out a work around for this problem. To make the Record Type ID field of some records fo an Object equal to null one can do the following. Create a new temporary RecordType and assign this new Record Type to the records in which you want to make it null. once the record type in these records is set, just delete this temporary Recordtype and the system will make the value in the RecordType field equal to null where ever this deleted recordtype was referenced.

Regards
Mojeeb
SuperfellSuperfell
Or you could just use the fieldsToNull property to set the recordTypeId to null.
mojeebahmedmojeebahmed
Can you please explain this process, how and where to use this ToNull property of RecordTypeID field?

SuperfellSuperfell
See the docs on the SObject structure.