Skip to content
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

Suggestions shane:object:field #18

Open
JodieM opened this issue Feb 7, 2019 · 11 comments
Open

Suggestions shane:object:field #18

JodieM opened this issue Feb 7, 2019 · 11 comments

Comments

@JodieM
Copy link

JodieM commented Feb 7, 2019

I LOVE this command. I have always used an XML generator to generate bulk fields so this is really nice too.

Can you please add the following to shane:object:field

  • Auto give permission to logged in user
  • --permset add a Permset Name and add the field to that permset automatically
  • --permission something to set Read or Edit
  • --deploy Deploy on save, using the new Deploy on save feature

Of course handling other field types and formulas would be fab, but I bet there is a reason that you can't do that.

@mshanemc
Copy link
Owner

mshanemc commented Feb 7, 2019

Cool, thank you for using and feedback!

  1. Auto give permission to logged in user
    How? Like permanently modifying the admin profile, or creating a one-off perm set and assigning it to the user but not pulling locally? Those would be very different approaches depending on whether you're building sandbox or scratch org/package. You'd eventually want that in source somewhere, right, so you're just needing temporary access for dev purposes?
  1. --permset add a Permset Name and add the field to that permset automatically
    I've tried to keep local source editing separate from push/deploy...there is a command for doing a permset from local source (like an object, or a field, or everything, etc). Are you more often doing one field...mine have tended to be more "object at a time" where I do some fields and then perm the whole thing at once (but it only does edit). There's also the situation where you don't have the permset locally already and need to pull it down so that we're not overwriting a real permset with a version that only has one field.
  2. --permission something to set Read or Edit yep. To go with the permset?
  3. --deploy Deploy on save, using the new Deploy on save feature I have not played with that one at all. I'll look into how it works. For that use case I've been using the nodemon approach so it has been less of a need for me.

Another approach to this would be to spit out some useful text, kinda like object:create does where it gives you the start of a command for creating the fields. What if (spitballing) the results gave you something to cut and paste (like the perms commands for your new field) when your field gets created?

other field types: what would you want? Picklists are probably the main thing I have to go in and mess with now that I think a cli would do well.

I thought about doing formulas, but the formula builder UI is pretty good (validate, etc) that I feel like it would be harder to type one exactly correct using the cli then just opening the org and doing it the normal way.

@JodieM
Copy link
Author

JodieM commented Feb 8, 2019

OK, yes, remove the idea to auto give the permission, that sounds dangerous.

Yes the --permission flag would be to go with the Permset you would need to state which permset and whether the new field is read only or read-write in that permset.

Ooh yes, having the text generated that will add the field to the profile or Perm Set would be great. Also Report Type please! (Why oh why isn't there a UI button to add to Perm Sets and Report Types when creating fields!!!)

Yeah, I still have not wrapped my head around Perm Set wrangling in metadata due to the high likelihood of completely stuffing up a profile if deploying it from a Sandbox. I don't like touching them, so it's easier to do it all manually via the UI.

Yeah, I don't know much about the deploy on save feature yet, and if it's ready for prime time, but it would be a nice option to include if you think it could work.

@JodieM
Copy link
Author

JodieM commented Feb 8, 2019

I thought about doing formulas, but the formula builder UI is pretty good (validate, etc) that I feel like it would be harder to type one exactly correct using the cli then just opening the org and doing it the normal way.

Yes, I fully agree - but even creating a base formula with True or 0 or "Text" or something would be handy just to get going. It's really handy to create fields this way when you are bulk creating fields, so even if there was a placeholder formula it would still be a nice way to bulk create the fields.

Eg, fields I do regularly are creating a heap of fields to store DLRS rollup results, then do a formula to use those results - eg Sum of Opportunities Won Product X, Sum of Opportunities Won Product Y, then Has Product X (Sum of Opportunities Won Product X > 0), Has Product Y (Sum or Opportunities Won Product Y > 0) - all of these helper formulas to help with reporting and visualising things on the page. Eg I might do an Indicator field with a logo of the product on the Account record so you can see at a glance that this Account has purchased Product X.

mshanemc added a commit that referenced this issue Feb 13, 2019
@mshanemc
Copy link
Owner

@JodieM for item 2/3

It's still always doing R/W on the fields, but at least it's a start . :)
screen shot 2019-02-18 at 4 19 13 pm

@JodieM
Copy link
Author

JodieM commented Feb 18, 2019

Oh nice one, thanks Shane!

@hcabnettek
Copy link

Is there a reason you didn't add currency for type? I often have to add currency fields to objects and I don't see how I can achieve that with the plugin. I can use number and then go an manually change them. Anyways currency would also be nice. Thanks.

@mshanemc
Copy link
Owner

mshanemc commented Dec 4, 2019

@hcabnettek no reason, other than, "hadn't needed it yet, myself."

@mshanemc
Copy link
Owner

mshanemc commented Dec 5, 2019

@hcabnettek currency added in 4.12.0

@hcabnettek
Copy link

hcabnettek commented Dec 5, 2019 via email

@mshanemc
Copy link
Owner

mshanemc commented Dec 5, 2019

go for it.

@mshanemc
Copy link
Owner

picklists are in, finally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants