Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Passing list of values from listpage form to RDP class

Posted on by 5

I'm attempting to modify a previously created SSRS report to allow selecting multiple sales orders and process the data for each sales order. I'm using the RDP/Controller/Contract pattern for this. It's successful when selecting a single sales order, but for some reason, getting the list of selected values is always showing as a null object in my RDP Class.

1. In my controller class below, I can see the salesIds list parameter contains the list of orders I selected. First parameter, salesId, is the original parameter that works today. I'm just setting it to the last selected salesId for now. It's not in the screenshot, but I use the MultiSelectionHelper class to iterate through the selected salesids and add them to the recordSet list variable.

controller-_2D00_-Copy.jpg

2. In my RDP class, the salesIds parameter comes across as null. SalesId parameter retains it's value though. 

 RDP-_2D00_-Copy.jpg

Below is my code for my data contract. Am I doing something wrong in terms of the list parameter? I have refreshed the dataset in the report itself as well, so the parameter does show in the report.

[DataContractAttribute]
public class cdiSalesConfirmContract
{
    SalesId salesId;
    List salesIds;
 
    [ DataMemberAttribute('SalesId') ]
    public SalesID paramsalesid(SalesId _salesid = salesid)
    {
        salesId = _salesid;
        return salesid;
    }

    [
        DataMemberAttribute('SalesIds'),
        AifCollectionTypeAttribute("SalesIds",Types::String)
    ]
    public List parmSalesIds(List _salesIds = salesIds)
    {
        salesIds = _salesIds;
        return salesIds;
    }

}

  • Suggested answer
    Pedro Tornich Profile Picture
    Pedro Tornich 955 on at
    RE: Passing list of values from listpage form to RDP class

    As Crispin said you can try a container instead of a List to check if it works.

    But if it doesn't, you may convert the sales id list into a comma separated string, then on the DP you can convert it into a container using str2con().

  • Suggested answer
    Crispin John Augustine Profile Picture
    Crispin John Augustine 37,081 on at
    RE: Passing list of values from listpage form to RDP class

    Instead of list, try using a container. (I'm not sure of this, though)

    But the best option is to make/use a contract query, and set it's range with all the salesIds in the controller.prePromptModifyContract().

    In your DP class, try to manage the remaining functions with an outer loop on this query.

  • KLin559 Profile Picture
    KLin559 5 on at
    RE: Passing list of values from listpage form to RDP class

    Was never able to find a solution to this. Oh well.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans