You need to sign in to do that
Don't have an account?
Mark Dakyns 1
Populate 'Record Name' field in custom object with fields from same custom object
I would like to populate the system Record Name field (Name) with a concatenation of two fields in the same custom object.
I have successfully written the following trigger as follows to do this:-
Is there a way that I can suppress the 'Name' field or alternatively do something smart to solve this requirement?
I have successfully written the following trigger as follows to do this:-
trigger MarkTest on Mark_Test__c (before insert) { for (Mark_Test__c obj: trigger.new){ obj.Name = obj.Surname__c + ',' + obj.Forename__c; } }The only problem is I need to populate system field 'Name' with something before pressing [Save] as it is a required field.
Is there a way that I can suppress the 'Name' field or alternatively do something smart to solve this requirement?
https://success.salesforce.com/ideaView?id=08730000000Brs9AAC
The workaround your problem is need to update records once record is saved into database but you need to put some values into the Name field.
For updating the name you do not need to write any you can create a worflow which will update the name field.
OR
If you do not want to put some value in the name field then you can create a VF page and override the new button of that Object with that VF pag.
If I was asked to complete the above task I must have been gone with the WFR.
Let me know where you find this solution.
Thanks!
Amit Singh
What would the advantage of using a workflow rather than a trigger be?