Error: The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores.
It seems that you have got that error message while Creating Custom Fields. Right? It's the rule of naming custom fields.
Salesforce populates Field Name using the field label. This name can contain only underscores and alphanumeric characters, and must be unique in your organization. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. Use the field name for merge fields in custom links, custom s-controls, and when referencing the field from the API.
The field name is automatically populated once you enter the label for a custom field. If you are still finding the error, then kindly replace the spaces with '_' (underscore) in your name field. As the Name field should contain only underscores and alphanumeric characters, and must be unique in your organization. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
This fixes the problem the challenges such as the below require the user to enter fields with a double underscore. Given that instruction, the challenge can never be won nor points earned. Try the below. Because of this validation within SFDC, this challenge can never be completed correctly as the API values given in the instructions will not worl.
This challenge requires you to create a custom object with a few custom fields. This object will describe trail information for a park and hence will need to track name, distance and the last date it was inspected. Create a custom object with 'Trail' as the Label and Object Name. The resulting API name will need to be 'Trail__c'. The Name field for Trail must be a Text type (not Auto Number). Add a custom field to Trail of the 'Text Area (Long)' type, which has the field name and label 'Description' and a resulting API name of 'Description__c'. The field should have the default character length of 32,768. Add a custom field to Trail of the 'Number' type (length of 3 and 0 decimal places), which has the field name and label 'Distance' and a resulting API name of 'Distance__c'. Add a custom field to Trail of the 'Date' (not 'Date/Time') type, which has the field label 'Last Inspection Date' and name 'Last_Inspection_Date' and a resulting API name of 'Last_Inspection_Date__c'.
Error: The custom field name you provided Description__c on object Trail can only contain alphanumeric characters, must begin with a letter, cannot end with an underscore or contain two consecutive underscore characters, and must be unique across all Trail fields
I hope you must have resolved this issue by now. If not, the trick is you should not not add any underscore(_ _c) after the label (ex:- Description) it will automatically append the (_ _c) after saving you the custom field. I have just paased this challenge.
This TH problem still exists but I found a workaround to win the challenge. I went back and edited all my custom field names to remove the _c and noted the API name showed as __c whereas previously is showed as _c_c.
The error message above would've been helpful. Unfortunately that is not the error displayed when trying name a custom field
Here is the error I get:
Error: The custom field name you provided Business Unit on object Lead can only contain alphanumeric characters, must begin with a letter, cannot end with an underscore or contain two consecutive underscore characters, and must be unique across all Lead fields
No mention of 'can't include spaces' . Please update the error messaging.
Could you please elaborate your problem?
Thanks,
Deepthi
It seems that you have got that error message while Creating Custom Fields. Right?
It's the rule of naming custom fields. Check this link:
https://help.salesforce.com/HTViewHelpDoc?id=adding_fields.htm
Best Regards,
Sourav.
The field name is automatically populated once you enter the label for a custom field. If you are still finding the error, then kindly replace the spaces with '_' (underscore) in your name field. As the Name field should contain only underscores and alphanumeric characters, and must be unique in your organization. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
Hope this helps you!
Best Regards,
Deepthi
This fixes the problem the challenges such as the below require the user to enter fields with a double underscore. Given that instruction, the challenge can never be won nor points earned. Try the below. Because of this validation within SFDC, this challenge can never be completed correctly as the API values given in the instructions will not worl.
https://developer.salesforce.com/trailhead/force_com_admin_beginner/data_modeling/creating_custom_objects_fields
This challenge requires you to create a custom object with a few custom fields. This object will describe trail information for a park and hence will need to track name, distance and the last date it was inspected.
Create a custom object with 'Trail' as the Label and Object Name. The resulting API name will need to be 'Trail__c'.
The Name field for Trail must be a Text type (not Auto Number).
Add a custom field to Trail of the 'Text Area (Long)' type, which has the field name and label 'Description' and a resulting API name of 'Description__c'. The field should have the default character length of 32,768.
Add a custom field to Trail of the 'Number' type (length of 3 and 0 decimal places), which has the field name and label 'Distance' and a resulting API name of 'Distance__c'.
Add a custom field to Trail of the 'Date' (not 'Date/Time') type, which has the field label 'Last Inspection Date' and name 'Last_Inspection_Date' and a resulting API name of 'Last_Inspection_Date__c'.
Error: The custom field name you provided Description__c on object Trail can only contain alphanumeric characters, must begin with a letter, cannot end with an underscore or contain two consecutive underscore characters, and must be unique across all Trail fields
I hope you must have resolved this issue by now. If not, the trick is you should not not add any underscore(_ _c) after the label (ex:- Description) it will automatically append the (_ _c) after saving you the custom field. I have just paased this challenge.
Cheers,
Kranthi
The error message above would've been helpful. Unfortunately that is not the error displayed when trying name a custom field
Here is the error I get:
Error: The custom field name you provided Business Unit on object Lead can only contain alphanumeric characters, must begin with a letter, cannot end with an underscore or contain two consecutive underscore characters, and must be unique across all Lead fields
No mention of 'can't include spaces' . Please update the error messaging.