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

Add vault extension method: VaultPropertyDefOperations.GetOwnerPropertyDefID #6

Closed
CraigHawker opened this issue Sep 9, 2020 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@CraigHawker
Copy link
Collaborator

Would be a shorthand for this sort of code.

            // Get the owner Mandant propertyDef
            ObjType owningObjType = env.Vault.ObjectTypeOperations.GetObjectType(Configuration.Identifier.ObjectType.Mandant);
            int besitzerMandant = owningObjType.OwnerPropertyDef;

Should take a single integer parameter for the object type ID.

@CraigHawker CraigHawker added enhancement New feature or request good first issue Good for newcomers labels Sep 9, 2020
@CraigHawker
Copy link
Collaborator Author

As this could be used from the COM API (without the VAF), I have moved this across to the COM API extensions library: M-Files/COMAPI.Extensions.Community#4

@falk-huth-ewerk
Copy link
Contributor

falk-huth-ewerk commented Sep 9, 2020 via email

@CraigHawker
Copy link
Collaborator Author

I have closed this issue and opened it against the COM API. Please reply there.

That said, a few comments:

  • I think this should go against VaultPropertyDefOperations, rather than VaultObjectTypeOperations personally (as it should return the property definition ID).
  • The UI has that limitation for owner property definitions, you're correct, but you can add an alias to the parent or child object type and retrieve the data from that using MFIdentifiers. That's better than pushing the alias in using the API.
  • If this extension method is added to the COM API then it cannot use MFIdentifier as that is a VAF construct. Also: there is an implicit operator from MFIdentifier to int, so int is the preferred way of expressing this as you can still continue to provide an MFIdentifier if you would like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants