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
developer_forcedeveloper_force 

help needed in writing a trigger

Hi,

 

Help needed in writing a trigger for the following logic.Org is using Person Accounts

 

if RecordType= personaccount some 'test' field should be populated to 'firstname+lastname+middlename '

 

Thanks

TrimbleAgTrimbleAg

You shouldnt even need a trigger for this, formula would work just fine.

 

First + Last + Middle

 

Or are you looking for other automation that I am missing?

 

PB

New_DeveloperNew_Developer

Inorder to auto populate a formula field(say some 'abc' field) we created this 'test' field which is a lookup to contact.

 

This 'test' field should be created on Account level in person Accounts and we have two record types here 

PersonAccount and Business account.

 

so inorder for the 'abc' field to be generated , this 'test' field should be auto populated to Account name i.e,

if its person Account then the 'test ' field should be populated to firstname+lastname+middlename and if its businessAccount it should be populated to just Name.

so i need to write a trigger on Ac ount to populate this 'test' field and the logic for the trigger should be

 

if(RecordType= personaccount) test field shoud be firstname+lastname+middlename else Name

 

hope this is clear