Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency of schema generate field command with core platform #3066

Closed
k-capehart opened this issue Oct 17, 2024 · 7 comments
Closed

Inconsistency of schema generate field command with core platform #3066

k-capehart opened this issue Oct 17, 2024 · 7 comments
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@k-capehart
Copy link

k-capehart commented Oct 17, 2024

Summary

There is inconsistency when creating new fields in Salesforce via the CLI and via the UI.

In the UI, the default API name autopopulates after entering the label. Spaces are replaced with underscores. (i.e. Test_Field__c)

image

In the CLI, spaces are removed in the default value. (i.e. TestField__c)

Screenshot 2024-10-17 at 12 40 17 PM

When I run this command, I want to be consistent with my naming conventions without having to manually write the API name each time.

Steps To Reproduce

  1. run sf schema generate field -l "Test Field" -o force-app/main/default/objects/Acount/
  2. notice that the spaces are removed by default
  3. in the UI, create a new field via Object Manager
  4. notice that the spaces are replaced by underscores by default

Expected result

The default API name for a new field created via schema generate field should be consistent (replace spaces with underscores).

Actual result

The default behavior removes spaces.

Additional information

PR created: salesforcecli/plugin-sobject#752

However, I am open to discussion on this. I almost prefer no spaces, but I like consistency better.

System Information

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.62.6",
  "nodeVersion": "node-v20.18.0",
  "osVersion": "Darwin 23.6.0",
  "rootPath": "/Users/kylecapehart/.nvm/versions/node/v20.18.0/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.5 (core)",
    "@oclif/plugin-commands 4.1.3 (core)",
    "@oclif/plugin-help 6.2.14 (core)",
    "@oclif/plugin-not-found 3.2.22 (core)",
    "@oclif/plugin-plugins 5.4.14 (core)",
    "@oclif/plugin-search 1.2.11 (core)",
    "@oclif/plugin-update 4.6.3 (core)",
    "@oclif/plugin-version 2.2.14 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.18 (core)",
    "@oclif/plugin-which 3.2.15 (core)",
    "@salesforce/cli 2.62.6 (core)",
    "apex 3.5.1 (core)",
    "api 1.3.1 (core)",
    "auth 3.6.65 (core)",
    "custom-metadata 3.3.33 (user) published 25 days ago (Sat Sep 21 2024) (latest is 3.3.35)",
    "data 3.7.0 (core)",
    "deploy-retrieve 3.12.17 (core)",
    "info 3.4.9 (core)",
    "limits 3.3.32 (core)",
    "marketplace 1.2.26 (core)",
    "org 4.6.0 (core)",
    "packaging 2.8.11 (core)",
    "schema 3.3.34 (core)",
    "settings 2.3.23 (core)",
    "sobject 1.4.42 (link) /Users/kylecapehart/Documents/repos/personal/plugin-sobject",
    "source 3.5.21 (core)",
    "telemetry 3.6.15 (core)",
    "templates 56.3.22 (core)",
    "trust 3.7.33 (core)",
    "user 3.5.32 (core)",
    "kc-sf-plugin 1.4.11 (user) published 12 days ago (Fri Oct 04 2024)",
    "lightning-flow-scanner 2.34.0 (user) published 53 days ago (Sat Aug 24 2024)"
  ]
}
Copy link

Hello @k-capehart 👋 None of the versions of sf you shared match the latest release.

Shared: 2.61.8
Latest: 2.62.6

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue.
You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Oct 17, 2024
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@github-actions github-actions bot added investigating We're actively investigating this issue validated Version information for this issue has been validated and removed more information required Issue requires more information or a response from the customer labels Oct 17, 2024
@iowillhoit
Copy link
Contributor

Thanks for the PR @k-capehart! I'll run this by the team and get back to you

@VivekMChawla
Copy link

@k-capehart - Thanks for engaging with us and sharing your perspective.

I see your point about consistency. I also agree that "no spaces" should be the standard in the UX.

Unfortunately, the monthly usage of schema generate commands is too low to prioritize changing the CLI.

I'm going to close this for now, but will revisit it if usage increases. Thanks!

@VivekMChawla VivekMChawla closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
@k-capehart
Copy link
Author

@VivekMChawla Thanks for the response. Does the fact that I've already submitted a PR change your perspective on priority? It would just need approval, and it's small.

Either way, I appreciate it!

@VivekMChawla
Copy link

@k-capehart - The problem isn't just the engineering work. We'd want to confirm with the broader community that we're not breaking anyone by this change in behavior, then be on the lookout for complaints if we do.

Even though the number of users is small, the due diligence on our part is enough that I can't justify the change given other priorities. I'm sorry.

@k-capehart
Copy link
Author

No worries, thanks for the added context!

@forcedotcom forcedotcom locked and limited conversation to collaborators Oct 17, 2024
@VivekMChawla VivekMChawla converted this issue into discussion #3067 Oct 17, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

3 participants