Skip to main content
Dynamics 365 Community / Forums / Finance forum / passing the values to ...
Finance forum
Suggested answer

passing the values to caller form

editSubscribe (0) ShareShare
ReportReport
Posted on by 1,292
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
Attachments
  • Waed Ayyad Profile Picture
    Waed Ayyad 2,003 on at
    passing the values to caller form
    Hi DineshKarlekar,
     
    Is your issue resolved?
     
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 2,003 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 222,689 Super User 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,292 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

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,130 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,689 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans