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
Preeti Khanna 10Preeti Khanna 10 

I have created an object A and it has multiple record types.I want to store the seclected record tyoe name in object A when user creates a new record without visualforce page.Can it be done using trigger while creating a record or in some other way.

I have created an object A and it has multiple record types
.I want to store the seclected record type name in object A when user creates a new record .Can it be done using trigger while creating a record or in some other way.I dont want to use visualforce page here.Kindly help on the same.
I want it as we are creating a single master for different things instead of creating separate objects and we are handling through record types so we need record type name for each record to identify this particular record belongs to which object.
Onesh ReddyOnesh Reddy
Hi Preeti,

1) Create a Formula field for the Object A.(Return value of formula field should be TEXT)
2) Place the value RecordType.Name in the syntax box of formula field.
3) Check for any syntax errors and Save.
4) Add the field for every page layout so that it is available for every record type.

Please mark this answer as solved if it helps you.

Best Regards,
Onesh.K
Preeti Khanna 10Preeti Khanna 10
Hi Onesh,

Above solution is not working.I am getting error-
Error: Field RecordType does not exist. Check spelling.

Regards,
Preeti
Onesh ReddyOnesh Reddy
If Object A has many RecordTypes, RecordType.Name will work for the Formula field or Try the button InsertField and select Recordtype name for the specific object. The formula field should look like the pic below.User-added image

Let us know if you still have error.

Regards,
Onesh.K

 
Preeti Khanna 10Preeti Khanna 10
Hi Onesh,

Thanks for your help!
Record Type is a standard field that will be created once we create recordtype.So I have drag and drop the field on page layout and it is working.
so new field creation is not required.
As I am new to Salesforce so I was facing issue.

Thanks alot for your help and time!