Before save a record, i would like to find a MAX value in a specific field and increment it of one unit.
I found Page Events section and then reach Pages → → Add → BeforeAdd event.
For sure i know that the SQL query is " SELECT MAX(cod) FROM customer" but how to run the query and obtain the value that i will increment afterward and before save?
I need to work like in Visual Studio or i have direct access to field and to the query with some routines “ready to use”?
You have access to the variable. There are code snippets on the right side of the Page Event panel, double click on them and the code will be added, then you can edit it the way you want to. You can also write your C# code just like you do in visual studio.
Page Events | Documentation (radsystems.io)
The variable is passed to the page event function you see on the editor. And you event code should be written inside the function.
To run a query to an existing table using the postdata.field_name as value for where, is there a way to use the existing database connection? As example, a ready to use function or macro? Or i need to access to the db from scratch?
I see this on CodeSnippets to fetch a record but where is explained/detailed this way of access a record?