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

Announcements

No record found.

News and Announcements icon
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
       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
    238,734 Most Valuable Professional on at
    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,061 Super User 2026 Season 1 on at
    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,061 Super User 2026 Season 1 on at
    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 311

#3
Diego Mancassola Profile Picture

Diego Mancassola 271

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans