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, ...
Suggested Answer

passing the values to caller form

(0) ShareShare
ReportReport
Posted on by 1,836
hi ,
everyone 
i am getting the caller form in init method of my custom form but not getting the records , i have debugged the code but sales table is empty can i get the records which i selected on caller form , please uide me on this .
 
below is my code.
thanks ,
Regards,
Dinesh
I have the same question (0)
  • Dineshkarlekar Profile Picture
    1,836 on at
    passing the values to caller form
       public void init()
        {
            super();
    
            //FormControl sender;
            str        caller  = element.args().callerName();//FormControl(sender) childform
            Args       args   = new Args();
            ;
            //caller = sender.formRun().args().caller();
    
            if(caller == formStr(SalesCreateOrder))
            {
                if (element.args().dataset() == tableNum(SalesTable))
                {
                    SalesTable   salesTable  = element.args().record();
    
                }
            }
            else if(caller == formStr(SalesCreateQuotation))
            {
                if (element.args().dataset() == tableNum(SalesQuotationTable))
                {
                    SalesQuotationTable  salesQuotationTable  = element.args().record();
    
                }
            }
        }
    thanks,
    Regards,
    Dinesh
  • Martin Dráb Profile Picture
    237,668 Most Valuable Professional on at
    passing the values to caller form
    Instead o writing a lot of code, start with checking the basics. Does this.args().record() returns the record you want? If not, it's not sent by the caller and therefore you need to look for the problem in the caller form.
    Remember that I explained to you how to call a form and pass a data source record there. Use a menu item button and set its Data Source property.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,023 Super User 2025 Season 2 on at
    passing the values to caller form
    Hi DineshKarlekar,
     
    As Mark mentioned did you add DataSource property to the menu Item?
    Also try to use this code :
     
     public void init()
      {
         super();
    
         if(element.args())
        {
            if( element.args() && element.args().menuItemName() == menuItemDisplayStr(YourMenuItemName))
           {
              FormRun    formRun    = element.args().caller();
              SalesTable salesTable = formRun.dataSource(tableNum(SalesTable)).cursor();
           }
           else if(element.args().menuItemName() == menuItemDisplayStr(YourMenuItemName2)))
           {  
              FormRun    formRun    = element.args().caller();
              SalesQuotationTable  salesQuotationTable  = formRun.dataSource(tableNum(SalesQuotationTable)).cursor();
           }
    
        }
         
      }
    Thanks,
    Waed Ayyad
     
     
     
  • Waed Ayyad Profile Picture
    9,023 Super User 2025 Season 2 on at
    passing the values to caller form
    Hi DineshKarlekar,
     
    Is your issue resolved?
     

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans