none
PickerEntity and SPClaim RRS feed

  • Question

  • I want to develop a custom field type(I call it SPFieldObjectLookup). Basically, it contains the Type of a problem domain object, and Id to instantiate the object.

    I started with a custom field type inheriting SPFieldUser, but I get the as described here https://social.msdn.microsoft.com/Forums/office/en-US/0c80213c-9d4b-47f8-be3b-757250d36064/how-to-exclude-custom-claim-provider-from-outofthebox-spfielduser-field?forum=sharepointdevelopment#3193cbe5-cff7-4892-919e-0d3e0640ec26

    Now I am trying to start from inheriting SPFieldMultiColumn, EntityEditorWithPicker, and I found that the PickerEntity class has a SPClaim property. Does it mean that PickerEntity is suggested to work with SPClaim, event SPFieldUser and SPUser is not involved?

    Actually, I'd like to reuse the SPClaim related class, since I can reuse my existing custom claim providers.

    And, is it possible to use PeopleEditor without UserField, SPFieldUser, SPUser? That will save me a lot of effort then starting with EntityEditorWithPicker.

    The problem of SPFieldUser for me, as described in the link above, is: if I set the IsUsedByDefault to true, custom claims appear in all user fields, it I set it to false, SPWeb.Enuser does not work with my custom claim.


    • Edited by GuYuming Friday, July 26, 2019 1:25 AM
    Friday, July 26, 2019 1:21 AM

Answers

  • My SPFieldObjectLookup now inherits SPFieldText, instead of SPFieldUser, and in custom rendering control for it, I use PeopleEditor, which interact with SPClaimProvider.

    That is to say, so far, I don't have to start with EntityEditorWithPicker. I can choose SPClaims from my custom providers without persisting into hidden user information list. No show stopper issue found yet. I would report if I find later.

    I would soon deploy a demo version onto my sharepoint site, you can get access to it by following my WeChat public account (scanning my QR logo with WeChat).  If you cannot open the site directly in WeChat, you can use the Url in PC browser with the username password received from WeChat public account.

    I don't post the Url here since its a free one which may subject to change(I had not purchased a paid DNS), less stable than the WeChat public account I think.


    Monday, July 29, 2019 9:13 AM
  • Hi,

    Thanks for sharing the information. And please remember to hide the privacy info in the capture if need to upload.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Marked as answer by GuYuming Wednesday, July 31, 2019 9:48 AM
    Wednesday, July 31, 2019 8:50 AM

All replies

  • Hi,

    Question: Does it mean that PickerEntity is suggested to work with SPClaim, event SPFieldUser and SPUser is not involved:

    Yes, PickerEntity is used with SPClaim value, but need User/Group is involved.

    Writing a Custom Claims Provider for SharePoint 2010 – Part 3: Searching Claims

    Qustion: is it possible to use PeopleEditor without UserField, SPFieldUser, SPUser? That will save me a lot of effort then starting with EntityEditorWithPicker:

    Answer: PeopleEditor is a control class for user to select and fill in user, it needs to be used in SharePoint Person field:

    PeopleEditor Control

    Question: SPWeb.Enuser does not work with my custom claim:

    SPWeb.EnsureUser method will need the user/claim existed in the hidden UserInformation List, if not existed, then this method will throw exception, you can remove a specific user from the UserInformation List for a try, then this method will throw "User not existed" similiar exception:

    SharePoint's hidden user-list - User Information List

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, July 29, 2019 7:43 AM
  • My SPFieldObjectLookup now inherits SPFieldText, instead of SPFieldUser, and in custom rendering control for it, I use PeopleEditor, which interact with SPClaimProvider.

    That is to say, so far, I don't have to start with EntityEditorWithPicker. I can choose SPClaims from my custom providers without persisting into hidden user information list. No show stopper issue found yet. I would report if I find later.

    I would soon deploy a demo version onto my sharepoint site, you can get access to it by following my WeChat public account (scanning my QR logo with WeChat).  If you cannot open the site directly in WeChat, you can use the Url in PC browser with the username password received from WeChat public account.

    I don't post the Url here since its a free one which may subject to change(I had not purchased a paid DNS), less stable than the WeChat public account I think.


    Monday, July 29, 2019 9:13 AM
  • Hi,

    Thanks for sharing the information. And please remember to hide the privacy info in the capture if need to upload.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Marked as answer by GuYuming Wednesday, July 31, 2019 9:48 AM
    Wednesday, July 31, 2019 8:50 AM
  • Thanks, the system has not been polished yet, such as displaying url instead of displayname in the hierarchy is not user friendly, and I will add the Url into the right panel to facilitate selection later.


    • Edited by GuYuming Wednesday, July 31, 2019 9:49 AM
    Wednesday, July 31, 2019 9:47 AM