Trigger After Open
I use this trigger:
if ninoxApp() = "iphone"then openTable("TableName", "PhoneView")
else if ninoxaApp() = "mac" then openTable("TableName, "MacView")
I want when the Table opens to go to last record (maximum Id).
I tried with popupRecord inside the trigger with no luck.
Can this be done?
Nick
11 replies
-
I could get it to work with openRecord() if I entered the Id # of the last record, but that isn't what you're looking for. It would be nice to be able to use last(Id) for the record #. Feature request!
Quite a contrast between the response you got and the response for this thread...
-
OK, I came up with this code:
***
if ninoxApp() = "mac" then
openTable("General Journal", "All")
else
if ninoxApp() = "iphone" then
openTable("General Journal", "Phone")
end
end;
let maxId := last(select 'General Journal').Id;
openRecord(record('General Journal',maxId))***
This action selects the last record in the table and popups the last record in the form but in the table view (what I see on screen) does not navigate to the bottom of the table.
Nick
-
Good work. I tried something similar, but didn't use the select command. It does navigate to the correct record in table view, but it doesn't update the view to show it.
-
Exactly! Thank you Sean for writing my text better...
Nick
-
I'm not trying to upstage the work you did here... You can also use the formula used for maxId directly in openRecord() if you want.
-
Thanks again!
-
Update:
It doesn't update the view to show the correct record when it runs from "Trigger after Open".
The same code works fine (updates the view) when assigned to a button e.g. on a Dashboard table.
-
Nick, I'm confused. Are you using it differently now than before? It still works for me.
-
Sean, I'm looking for a workaround to update the view to the last record. I thought I found a solution, but it's not working.
So, ignore my previous post... Sorry!
-
Correction:
... I'm looking for a workaround to update the view to the last record in table view.
-
No worries, I think that behavior might have to be fixed by the Ninox Team.
Content aside
-
1
Likes
- 5 yrs agoLast active
- 11Replies
- 5130Views