Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

passing the values to caller form

(0) ShareShare
ReportReport
Posted on by 1,457
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
  • Waed Ayyad Profile Picture
    Waed Ayyad 6,695 Super User 2024 Season 2 on at
    passing the values to caller form
    Hi DineshKarlekar,
     
    Is your issue resolved?
     
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,695 Super User 2024 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
     
     
     
  • Martin Dráb Profile Picture
    Martin Dráb 230,540 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.
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 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

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,861 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,540 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans