When I create an custom object I also creating custom fields for this custom object, the custom field is created empty without any data or value just an empty custom field. I need help with how can I add data to the custom field in time of creation the custom field? what is the correct apex code to do such a thing I tried a lot of stuff but not working.
-
1did you look at the default value option on the custom field definition; this would let you default a value to a constant or to a formula based on contextual values such as properties of a running usercropredy– cropredy2021-12-13 00:39:11 +00:00Commented Dec 13, 2021 at 0:39
Add a comment
|
1 Answer
Salesforce does not provide a feature to populate a new custom field on existing records.
The exceptions are formula fields (which are re-calculated every time the field is accessed via the UI or query) and possibly roll-up summary fields.
The most appropriate tool to populate new fields on existing records is likely something like the Salesforce-provided DataLoader or dataloader.io (which can handle millions of records)