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
  • 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
    241,637 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,228 Super User 2026 Season 2 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,228 Super User 2026 Season 2 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 217

#3
Subra Profile Picture

Subra 200 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans