web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Contract class-Multi Select Option (List Type)

(0) ShareShare
ReportReport
Posted on by 2

Hi ,

   I am trying to Multi Select the Item Group , I can able to multi select too .  When I tried degugging I can able to see the List of Group ID inside the contract class(List return type parm method) untill I press the ok Button in the Dialog Form . When I press the ok button  and while clalling the parm method(List Reurn Type) from the DP class I am able to sore only the first value in the varaible .

Here is my code .

Contract class

[
    DataContractAttribute,
    SysOperationContractProcessingAttribute(classStr(ItemSummaryUIBuilder), SysOperationDataContractProcessingMode::CreateUIBuilderForRootContractOnly)
    ]
class ItemSummaryContract implements SysOperationValidatable
{
    List                                    itemGroupId;
    [
        DataMemberAttribute('ItemGroup'),
        SysOperationLabelAttribute(literalStr("Item Group")),
        AifCollectionTypeAttribute("Item Group", Types::String),
        SysOperationDisplayOrderAttribute("3")
            ]
        public List parmItemGroup(List _itemGroupId = itemGroupId)
    {
        itemGroupId =_itemGroupId;
        return itemGroupId;
    }
}

UI Builder class

public class ItemSummaryUIBuilder extends SrsReportDataContractUIBuilder
{
    ItemSummaryContract     contract;
    DialogField             itemGroupID;
    List                    itemGroupIDList;

 

    public void postBuild()
    {
        contract = this.dataContractObject() as ItemSummaryContract;
        itemGroupID= this.bindInfo().getDialogField(contract, methodStr(ItemSummaryContract, parmItemGroup));
        itemGroupID.registerOverrideMethod(methodStr(FormStringControl,lookup),methodStr(ItemSummaryUIBuilder,ItemGroupLookup),this);
        
    }

    public void postRun()
    {
        // this.GroupID();
    }

    private void ItemGroupLookup(FormStringControl _control)
    {
        ListEnumerator                 enum;
        Query                          query = new query();
        QueryBuildDataSource           queryBuildDataSource;
        queryBuildDataSource = query.addDataSource(tableNum(InventItemGroup));
        queryBuildDataSource.fields().dynamic(false);
        queryBuildDataSource.fields().clearFieldList();
        queryBuildDataSource.addSelectionField(fieldNum(InventItemGroup, ItemGroupId));

        SysLookupMultiSelectGrid::lookup(query,_control, _control, _control, conNull());
    }

}

DP class

[SRSReportParameterAttribute(classStr(ItemSummaryContract))]
class ItemSummaryDpClass extends SRSReportDataProviderBase
{
    ItemSummaryTemptbl itemwiseTmp;

    ListEnumerator                          itemGroupIdIterator;
    // List                                    _itemGroupId;
    List                                    _itemGroupId = new List(Types::String);

    ItemSummaryContract                 contract;

    TransDate                               fromDate;
    TransDate                               toDate;
     
    InventLocationId                        inventLocationId;
    InventSiteId                            inventSiteId;
    WMSLocationId                           locationId;
    ItemGroupId                             itemGroupId;
    ItemId                                  itemId;


    [SrsReportDataSetAttribute(tableStr(ItemSummaryTemptbl))]
    public ItemSummaryTemptbl getPurchaseOrderTmp()
    {
        select itemwiseTmp;
        return itemwiseTmp;
    }



public void processReport()
{


    InventTable                             inventTable;
    InventTrans                             inventTrans;
    InventDim                               inventDim;
    InventTransOrigin                       inventTransorigin;
    InventTransferTable                     inventTransferTable;
    InventTransferJour                      inventTransferJour;
    InventItemGroupItem                     inventItemGroupItem;
    CompanyInfo                             companyinfo;
    real                                    openingPurchQty,openingSoldQty,openingPurchvalue,openingSoldValue;


        

    contract = this.parmDataContract() as ABS_ItemSummaryContract;

    //Assigning contract values to Parameters

    fromDate          = contract.parmFromDate();
    toDate            = contract.parmToDate();
    inventLocationId  = contract.parminventLocationId();
    inventSiteId      = contract.parminventSiteId();
    //itemGroupId       = contract.parmItemGroup();
    _itemGroupId      = contract.parmItemGroup();

    locationId        = contract.parmloationId();


    select * from companyinfo
        where companyinfo.DataArea == curext();
    itemwiseTmp.CompanyName     =  companyinfo.Name;


    if (_itemGroupId != null)
    {
        itemGroupIdIterator = _itemGroupId.getEnumerator();
        while (itemGroupIdIterator.moveNext())
        {
            itemGroupId = itemGroupIdIterator.current();
            while select inventItemGroupItem where inventItemGroupItem.ItemGroupId == itemGroupId
        join inventTable where inventTable.ItemId == inventItemGroupItem.ItemId
            {
                itemwiseTmp.ItemId          =  inventTable.ItemId;
                itemwiseTmp.ItemGroupId     = inventItemGroupItem.ItemGroupId;
                itemwiseTmp.Description     =  InventTable::find(inventTable.ItemId).itemName();
                itemwiseTmp.UOM             =  InventTableModule::find(inventTable.ItemId,ModuleInventPurchSales::Invent).UnitId;
                itemwiseTmp.insert();
       
            }
        }
    }
}

I have not mentioned the controller class here .

While debugging the DP class I can able to fetch only one record inside this _itemGroupId (List  type variable)

 the following line inside the DP class ..Since I am getting only one value There is no use of iterating . I dont know where I am commiting the mistake ? Can someone please help me in this ?

_itemGroupId      = contract.parmItemGroup();

I have the same question (0)
  • NoobGamer Profile Picture
    2 on at

    Is there is any issue in my code ?

  • NoobGamer Profile Picture
    2 on at

    When I try to call the parm method from controller class (For Testing)!!  I can fetch the List of item Groups .

    pastedimage1660844816819v1.png

    But When I try to call it from DP class I get only the first value in that List 

    pastedimage1660849045871v2.png

  • Verified answer
    huijij Profile Picture
    19,813 on at

    Hi NoobGamer,

    Did you get your solution yet?

  • Verified answer
    Alex VN Profile Picture
    1,994 on at

    Hi,

    Have you tried to restart SQLReporting service and also restore dataset for the report and check?

    Regards,

  • NoobGamer Profile Picture
    2 on at

    Thanks for replying Judy and Alex . Restoring Dataset helped me to solve this But May I know why  I am unable to allow Null values for the Multi-Select parameter . I have checked few posts regarding that . But I cannot get the answer for this.

  • Suggested answer
    Komi Siabi Profile Picture
    13,229 Most Valuable Professional on at

    You want the report to run even if the parameter is blank. You can set that on the report parameter property.

    Report -> Parameters -> Your parameter

    Allow blank and Nullable

    Report-parameter.JPG

  • NoobGamer Profile Picture
    2 on at

    Hi Komi ,

          For Normal Parameters these two properties work . But for Multi Level Parameter it doesnt allow the Nullable property . I have referred the following post but there is no solution

    community.dynamics.com/.../ssrs-the-report-parameter-dataset1_xxxx-is-a-multi-value-parameter-and-accept-null-value-this-is-not-allowed

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 658 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 632 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 570

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans