Call FO Runnable classes with dynamic parameter from URL – D365FO

 We are already familiar with calling D365FO URL menu items or forms or Runnable class.

To recap, I am giving few samples below

To call Display menu item from URL,

https://D35FO/?cmp=EC&mi=SalesQuotationListPage
https://D365FO/?cmp=EC&mi=SalesTableListPage

To call a form from URL,

https://D365FO/?cmp=EC&f=VendTransOpen
https://D365FO/?cmp=EC&f=CustParameters

To browse the data from URL,

https://D365FO/?cmp=EC&mi=SysTableBrowser&TableName=Currency

To call the Runnable class,

https://D365FO/?cmp=EC&mi=SysClassRunner&cls=RunnableClassName

We use these methods often in our day to day FO work.

If the runnable class requires a parameter, it is also possible to pass the value of the parameter.

Given below my runnable class, which tries to open SalesCreateQuotation passing the customer value as it dynamic parameter

class AE_SalesQuotationCreate
{
    public static void main(Args _args)
    {
        AE_SalesQuotationCreate salesQuotationCreate = new AE_SalesQuotationCreate();
        MenuFunction             menuFunction;        
        CustTable                custTable          = CustTable::find('1001');        
        Object                   formRun;

        Args args = new Args();        
        args.record(custTable);        
        menuFunction = new MenuFunction(menuitemActionStr(SalesCreateQuotation),  MenuItemType::Action);
        menuFunction.run(args);     
        
    }

}

In order to call the runnable class with customer value in FO URL,

https://D365FO/?cmp=USMF&mi=SysClassRunner&cls=AE_SalesQuotationCreate&custAccount='1001'

You can use any name in the parameter for passing the customer value ,here I used custAccount as the parameter name.

https://D365FO/?cmp=USMF&mi=SysClassRunner&cls=AE_SalesQuotationCreate&p1='1001'
https://D365FO/?cmp=USMF&mi=SysClassRunner&cls=AE_SalesQuotationCreate&cc='1001'

Comments

Popular posts from this blog

Customization on Sales invoice Report in D365 F&O

75) COC - Create a coc of the table modified method

46) D365 FO: SHAREPOINT FILE UPLOAD USING X++