jumpRef method to open one form to another form in d365 fo x++

Steps:  

Create a method in Table and take the specific id to the parameter

 public static void jumpRefId(ContractID _ContractID)

    {

        Args            args = new Args();

        MenuFunction    menuFunction;

        PersonContracts PersonContracts;

        select * from PersonContracts

        where PersonContracts.PersonId == _ContractID;

        args.record(PersonContracts);

        args.lookupRecord(PersonContracts);


        menuFunction = new MenuFunction(menuitemDisplayStr("Menuitemname"), MenuItemType::Display);

        menuFunction.run(args);

    }

step 2:

call this method in form field method jumpref()

 [Control("String")]

    class DSPPersonContracts_PersonId

    {

        /// <summary>

        ///

        /// </summary>

        public void jumpRef()

        {

            PersonContracts::jumpRefId(this.valueStr());

        }


    } 

Comments

Popular posts from this blog

Get Current Worker data in d365 fo x++

Table Level Event Handler in d365 fo x++