I don't think I understand what you are asking. You can use SYSTEM.CURSOR_RECORD to retrieve the record number for the record where the cursor is currently located.
If you want to identify the record while INSERTing, UPDATEing, DELETEing, you can still use what you have already tried. For example, in a PRE-UPDATE trigger add the following:
if :system.trigger_record = '1' then
This code would prevent you from updating record 1
Similar could be done for PRE-INSERT and so on.
No, it's not about that ... imagine a tabular block, with ten records shown and a scroll bar. I want a control item showing me the record number of each record.
I execute query, and in the post-query I assign the system.trigger_record to the item. At this time, right after query, the block is ok. I see ten records, each one with its control item showing values from one to ten. I can scroll and my control item works ok.
BUT, now, if I delete the fifth record, my control item will show values from 1 to 11, leaping over record 5.
What I want is this item to recalculate itself, to show values from 1 to 10 even if I delete record #5.
What value will you or your user get from displaying some sequential number like this? I've had this conversation with users/customers before and in the end the answer was always the same - they just wanted to see the items with a sequential number. The number meant nothing and the number was not stored in the database so depending on how you query your data for display, the number could change each time. I strongly recommend you talk to whoever has given you this requirement and ask why they need this. Also, let them know that doing this could cause your application to slow down when a re-numbering event occurs. Looping through each record in the datablock consumes cycles and depending on the number of rows read into the datablock - this could take a lot of time.
Just my thoughts on the topic.
Well, it's a list of tasks for a work order, they just want to see the steps numbered in real-time edit mode.
Of course, I don't think it does worth the work of programatically renumber every time they add or delete a task. They'll have to wait until commit or query. But this is the kind of think that seems easy for the end user who doesn't know a damn thing about forms.
Still thinking ... maybe with another block, detail control block based somehow in the topmost record number of the main block ... but I'm not spending more time on this. Thanks for you time anyway.