Auto-set a field on Add Page of another table when redirected

Radsystems 6.0.8; PHPRadClassic (Laravel + Bootstrap)

I am currently working on a Test Project, “Invoice Maker” and I need expert help from the experts of this group.

I have Clients - View Page on which I’ve added a button “Create Invoice”. The purpose of this button is to create invoice for that specific Client.

I have set the button link to Add page for Invoices.

Now, here I want the Client field of “Add Invoice” page to be auto-filled with the name of the Client from where the User got redirected to the “Add Invoice” page.

How to achieve this?

In usual scenario, I would have passed the Client ID in URL and then read that Client ID on “Add Invoice” page, and then auto-set the Client field with the ID passed in the URL as parameter.

I’m not sure how to do this in Radsystems.

Please help me with this…

Please set the user ID field on that table to none, then set the default for the field to the user ID option available depending on your project type.

“setting user ID to hidden and then setting the default value of that field” – this is exactly I’m trying to do on “Add Invoice” page.

However, how to pass the user ID (in the context of my project, it’s Client_ID) from “Client View” page to “Invoices - Add Invoice” page?

Note that I don’t want to use the Add Invoice as Subpage on Client View. Let it be a separate page and let the application redirect the User to the “Add Invoice” page.

The challenge for me here is to pass the Client ID of the client from Client View page to Add Invoice page.

If I solve this challenge, I have a plan to read the Client ID on Add Invoice page and then, as you also suggested, set the client_id field of “Invoices” table to hidden, then set the default value to the Client ID passed by the Client View page to Add Invoice page.

I hope the scenario is clear. Please let me know if you need any further information from me.

Your best option would be to use the Page Events > Action After Add to insert the id into the record that was added.

Steps:

  1. In action after add, you get the ID of the client from the other table using a query, there are query snippets on the right panel.
  2. You make another query to update the record that was just inserted with the client’s ID.