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

Community site session details

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

Menu item parameter properties

(0) ShareShare
ReportReport
Posted on by 1,215

Hi all,

I have a four status and in the HRMCoursetable i wrote a jumpref.

filter according to the HRMCourseTable Description.

and i have a custom form and custom menu item only one.

below my code once set menu item properties "parameter"

Ex: register its working now, how i can set remaining status i have an one menuitem only.

below my code.

[ExtensionOf(tableStr(HRMCourseTable))]
final class HRMCourseTableSDS_Extension
{
    static void peformJumpRef(HrmCourseId _CourseId)
    {
        HRMCourseTable coursetable;
        HRMCourseAttendee courseAttendee;
        MenuFunction    menuFunction;
        Args            args = new Args();

        if (_CourseId)
        {
            coursetable = HRMCourseTable::find(_CourseId);
            //courseAttendee = HRMCourseAttendee::find(_CourseId, coursetable.CourseInstructor);
            select firstonly courseAttendee
            where courseAttendee.hrmCourseId == coursetable.hrmCourseId;

        }
        args.record(coursetable);
        args.lookupRecord(coursetable);
       
        if(coursetable.status == HrmCourseTableStatus::Open)
        {
            args.parm('Open');
        }           
        else if(courseAttendee.status == HrmCourseAttendeeStatus::Registered)
        {
            args.parm('Registered');
        }
        else if(courseAttendee.status == HrmCourseAttendeeStatus::DropOut)
        {
            args.parm('RegistrationCanceled');
        }
        else if(courseAttendee.status == HrmCourseAttendeeStatus::WaitingList)
        {
            args.parm('WaitingList');
        }
        else if(courseAttendee.status == HrmCourseAttendeeStatus::Confirmation)
        {
            args.parm('Confirmation');
        }
        menuFunction = new MenuFunction(menuitemDisplayStr(SDSOpenCourseListPage), MenuItemType::Display);
       
        menuFunction.run(args);
    }
    }

and i mapped above method in my custom form description,

public class SDSMyConfirmedCourses extends FormRun
{



    [DataSource]
    class HRMCourseTable
    {
        [DataField]
        class description 
        {
            /// 
            ///
            /// 
            public void jumpRef()
            {
                //super();
                HRMCourseTable::peformJumpRef(HRMCourseTable.hrmCourseId);
            }

        }

    }

Thanks  

I have the same question (0)
  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at
    RE: Menu item parameter properties in D365FO

    Hi Riyas,

    1. I would use parmEnum and parmEnumType methods instead of parm

    args.parmEnumType(enumNum(HrmCourseAttendeeStatus));
    args.parmEnum(HrmCourseAttendeeStatus::Confirmation);
    

    2. In the form behind SDSOpenCourseListPage menu item you need to read this information from element.args() and add a needed filter to query accordingly

  • Riyas ahamed F Profile Picture
    1,215 on at
    RE: Menu item parameter properties in D365FO

    Thanks for your replay sir,

    1.  I understood first point.

    2. could you please elaborate and give me example sir?  

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at
    RE: Menu item parameter properties in D365FO

    Hi Riays,

    Looks like that you are using ListPage form and you should have the interaction class attached to the form. In this class, you should override method initializeQuery and enumeration information can be fetched from this.listPage().listPageArgs().

    As an example check EcoResProductListPageInteraction class.

  • Riyas ahamed F Profile Picture
    1,215 on at
    RE: Menu item parameter properties in D365FO

    Thanks for you response sir,

    That form not used an interaction class and there is no EcoResProductListPageInteraction in dex box

    PU24 my version.

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at
    RE: Menu item parameter properties in D365FO

    Hi Riyas,

    In this case, I recommend you create a new interaction class inherited from SysListPageInteractionBase and set it for your form. Then you can override intiailizeQuery method to apply additional ranges based on enum parameter.

    public void initializeQuery(Query _query)
    {
        super(_query);
        
        if (this.listPage().listPageArgs() &&
            this.listPage().listPageArgs().enumTypeParameter() == enumNum(HrmCourseAttendeeStatus))
        {
            HrmCourseAttendeeStatus hrmCourseAttendeeStatus = this.listPage().listPageArgs().enumerationParameter();
            
            QueryBuildDataSource qbds = _query.dataSourceTable(tableNum(table_to_be_filtered));
            
            switch (hrmCourseAttendeeStatus)
            {
                case HrmCourseAttendeeStatus::Registered
                    //Add ranges for registed case
                    break;
                case HrmCourseAttendeeStatus::DropOut
                    //Add ranges for drop out case
                    break;
            }
            
            
        }
    }

  • Riyas ahamed F Profile Picture
    1,215 on at
    RE: Menu item parameter properties

    Thank you very much sir. It's worked.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,004

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 857 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 548 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans