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, ...
Answered

Recruitment Application Form not Showing Data When Opening from Custom Button

(4) ShareShare
ReportReport
Posted on by 1,013
Hello community !
 
I have a custom form that lists the recruitment applications from the HR module.
PATH: D365FO > Human Resource > Recruitment > Applications > Applications.
 
I have a custom button on the form named "Open". This button should take the user to the original form for the highlighted application record once clicked.
The custom code in the clicked method on the button is as follows:
 
 
Nothing complex, but the issue is that the HRMApplication form does open with empty fields.
I have applied the same concept on other forms and it works fine, but I'm facing this issue on the HRMApplication form only...
 
Screenshot of the HRMApplication form after clicking on the button:
 
As shown on the screenshot, all fields are empty.. while the original record is populated with data.
Does anyone know what am I missing?
 
Any advice is appreciated !
 
Thanks in advance !
 
I have the same question (0)
  • Momochi Profile Picture
    1,013 on at
    Recruitment Application Form not Showing Data When Opening from Custom Button
    Thanks alot for the help.
     
    It turned out that there is an extension of the form on the init method that is adding false range to the form data source !
  • Verified answer
    Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    Recruitment Application Form not Showing Data When Opening from Custom Button
    Yes, using the Form information form is the easiest way. Unlike looking just at filter values, here you can see all the things like joins, dynamic links, grouping etc.
  • Momochi Profile Picture
    1,013 on at
    Recruitment Application Form not Showing Data When Opening from Custom Button
     
    I'm not sure if you mean by checking the whole query is to check this query statement in the form information as follows:
     
    Or by debugging the executeQuery of the called form?
  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    Recruitment Application Form not Showing Data When Opening from Custom Button
    Are you saying that the problem isn't actually related to the scenario of opening from the other form but that it never shows any data unless you remove the filter? That's an important finding. You should debug the code to see where it's added.
     
    But do you know how to check the whole query? It helps with form development/debugging very often; this is your opportunity to learn that.
  • Momochi Profile Picture
    1,013 on at
    Recruitment Application Form not Showing Data When Opening from Custom Button
    What I'm noticing is that the whenver I open the HRMApplication form (wether using the custom button or by going through the normal path D365 > Human Resource > Recruitment > Applications > Application) is that there is always a filter applied. a value of "-1" in the Application field.
    Here is a screenshot:
     
    I believe this is what causing the problem for this particular form.
    I'm not sure why it's always there, even if I opened the form normally by going through the original path...
  • Momochi Profile Picture
    1,013 on at
    Recruitment Application Form not Showing Data When Opening from Custom Button
     
    Can you elaborate on using a table relation?
    The custom form has its own datasource which combines different records from multiple modules (By that I mean, the custom form contains recruitment application records and other types of requests). That's why I'm using a custom button to determine the type of record on click and call the appropriate menu item for the selected record.
  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    Recruitment Application Form not Showing Data When Opening from Custom Button
    As I mentioned, a better approach would be defining a table relation (if doesn't already exist), use a menu item button and throw your code away. The target menu item should be identified by the menu item button, so the permissions of the menu item applies correctly. Your code also doesn't populate all other properties of Args that the standard logic does, namely caller. Therefore it looks like extra work to get something worse.
     
    Anyway, the key part point is that you'll need to look at the query.
     
  • Momochi Profile Picture
    1,013 on at
    Recruitment Application Form not Showing Data When Opening from Custom Button
    Hi
     
    Here is the code snipped:
    openRequest(Common _common,str _menuItem)
            {
                var args = new Args();
                args.record(_common);
    
                var menuFunction = new MenuFunction(_menuItem,MenuItemType::Display);
                menuFunction.run(args);
            }
    The custom form does list other records from other forms and using the above code, I am able to go to original forms and showing the referenced record passed through "args".
     
    The value for _menuItem is "HRMApplication" display menu item.
    The value for _common is common value returned from the following find method: HRMApplication::find(this.hrmApplicationId)
  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    Recruitment Application Form not Showing Data When Opening from Custom Button
    I don't see your code - please posted again.
     
    Don't look just at the UI. You're actually debugging the query fetching data for the form, therefore you should look at what query it uses. Let us know if you don't know how. It's possible that you'll see an unexpected range there, possibly one added for an automatically created dynamic link.
     
    Actually, using a dynamic link automatically created from a table relation is the usual approach in these cases. You shouldn't need any code at all. Maybe your code actually breaks what would otherwise worked just fine.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 745 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 597 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans