vLookup add children different content types

Forums vLooup for SharePoint vLookup add children different content types

This topic contains 2 replies, has 2 voices, and was last updated by  Kim West 1 month ago.

  • Author
    Posts
  • #16266

    Kim West
    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 West
    Participant

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

You must be logged in to reply to this topic.