Passing parameters to listbuilder lookupinfo simpledatalist

I am trying to pass the page context into the simpledatalist lookupinfo for a field in a listbuilder. I am able to hardcode a guid as the Value, but when I try to pass the same value from the page context I get an error saying to select a valid record. I am using the following syntax:

<OutputField Name="CAMPAIGNPRIORITYSUBPRIORITY" Caption="Campaign priority - subpriority" DataType="String">

<LookupInfo>

<SimpleDataList SimpleDataListID="e3e9e22a-85f2-4a77-ba74-25b391252dab" >

<c:Params>

<c:Param ID="CAMPAIGNID">

<c:Value>3f5dc520-f5f7-4c0c-892d-0fae6b81ede7</c:Value>

</c:Param>

</c:Params>

</SimpleDataList>

</LookupInfo>

</OutputField>

Comments

  • You included a hard-coded example; could you include the page context example too?

    You should be able to replace your hard-coded guid with either

    Form!ContextID

    or possibly one of these (I will update my answer if I find a working example, this is off the top of my head):

    Page.Fields!CONTEXTRECORDID
    Page.Fields!RECORDID
    Page.Fields!ID

  • The syntax that works in other places, eg. captions, is =Globals.CurrentRecordID, but it errors out in the simpledatalist parameter.

  • @Harry Frank I know this is an old thread, but did you ever figure this out? I'm trying to do something similar and I keep getting “Unable to load simple data list. Error converting data type nvarchar to uniqueidentifier.” Like you, if I hard code a GUID, it works fine. I've tried feeding it every variation on Form!ContextID to no avail.

    <OutputField Name="REGISTRATIONOPTION" Caption="Registration option" DataType="String" >
    <LookupInfo>
    <SimpleDataList SimpleDataListID="1f496a58-7e9d-4dc8-a420-f1aaa26a643b" >
    <c:Params>
    <c:Param ID="EVENTID">
    <c:Value>FORM!CONTEXTID</c:Value>
    </c:Param>
    </c:Params>
    </SimpleDataList>
    </LookupInfo>
    </OutputField>

  • @Mitchell Gibbs nope, never figured it out. Sorry I can't help more :(

  • @Harry Frank Thanks. I'm wondering if it's a bug or a listbuilder limitation. Using a parameterized Simple Data List as a lookup for a Form field seems to work fine, but in an Output Field of a listbuilder, it seems to always feed the literal value.

Categories