-
Notifications
You must be signed in to change notification settings - Fork 56
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
Extend FieldDefinition property "AddFieldOptions" to array #1091
Comments
Would you create an array or rather a list to contain those multiple options? |
List might be a way forward. We've got both arrays and lists here and there. Array and collection usage seem to be a legacy thing left out there for a backward compatibility. List looks ok as far as it can be serialized without issues. |
@vladivanovrf @andreasblueher getting back on this feature. There are a few related tickets and PR:
Here is how it all works:
Here is how it can be done, and below some tests: var fieldDef = ModelGeneratorService.GetRandomDefinition<FieldDefinition>(def =>
{
def.Hidden = false;
def.ShowInDisplayForm = true;
def.ShowInEditForm = true;
def.ShowInListSettings = true;
def.ShowInNewForm = true;
def.ShowInViewForms = true;
def.AddFieldOptions = BuiltInAddFieldOptions.AddToAllContentTypes
| BuiltInAddFieldOptions.AddFieldInternalNameHint;
}); Full test:
With all this, the whole ticket and related PR done by @andreasblueher aren't necessary. @vladivanovrf @andreasblueher could you please review this investigation and confirm outcomes? |
Folks, @vladivanovrf @andreasblueher, we'd appreciate if you could have a close look on this ticket and related PR #1099 By looking into current functionality, the current ticket and corresponding PR don't have to be moved forward. Looking for your confirmation aiming to close them this week. |
Hey guys, I was sick for almost 2 weeks straight and visiting a SharePoint conference the week after so it took some time to get back here. I just tested the possibility to combine BuiltInAddFieldOptions using "|" and i can confirm that it is working as expected. I combined 3 different options and it worked. If you change those options afterwards it's not updating the field accordingly, but this seems very far fetched to expect this kind of behavior so imho you can close this issue and delete the PR. |
I can confirm using "|" to combine those options works fine. |
Hello,
Sometimes it's necessary to use more than one AddFieldOptions property in FieldDefinition (for example: BuiltInAddFieldOptions.AddToAllContentTypes and BuiltInAddFieldOptions.AddFieldInternalNameHint), but right now it's impossible.
So it will be good to create another property with an array type.
Reference to parent issue: #1073
The text was updated successfully, but these errors were encountered: