vLookup add children different content types

Home Forums vLooup for SharePoint vLookup add children different content types

  • This topic has 2 replies, 2 voices, and was last updated 7 years ago by Kim.
Viewing 2 reply threads
  • Author
    Posts
    • #16266
      Kim
      Participant

        Hello, is it possible to use one vLookup to add different content types to the same “child” list? The add New Item uses the default content type and I would like to be able to select which content type to add. Thank you!

      • #16281
        Alexander Bautz
        Keymaster

          Hi,
          Sorry for the late reply. You can do this by using the developer tools to inspect the “New child” button. Look at the “spjs.vLookup.addChild” function call. Copy it and create a custom button in a HTML section like this – see how I have appended the ContentTypeId to the URL:

          <input type="button" value="New child item with CT" onclick="spjs.vLookup.addChild('/DFFS/Lists/DFFS_ContentTypes/NewForm.aspx','parentListGuid={c5c44b98-34f1-4ade-87d3-ed292eee0d84}&parentForm=/DFFS/Lists/DFFS_TestList/DispForm.aspx&parentItemId={ID}&baseUrl=/DFFS&getFromParent=Title|Title|false&ContentTypeId=0x011100414D8791294AE9428E4C2DEE31828919','vLookup_dummy',false,false);return false;">

          Please note that I have used {ID} in the “parentItemId” parameter in the function call to pull the current items ID.

          You can create multiple buttons like this to add different content types.

          Let me know how this works out.

          Alexander

        • #18247
          Kim
          Participant

            Hi Alexander, I thought I had replied and couldn’t find it. Yes, this worked like a charm, thank you very much!

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.