jdevans

stumped on getting pk ID of selected field

Discussion created by jdevans on Apr 12, 2016
Latest reply on Apr 12, 2016 by keywords

getIDhelp.PNG

On the above layout, you're looking at a list view of accounts, based on a table called Accounts. The individual fields out to the right of each account are Hours records. But each field under, say Monday, has its field tied to a query relationship that only shows hours when it's on the correct date (in this case Monday), and the account matches, and the week matches, and the Employee matches (not shown, but its a drop down of employee names). So, Monday's entry fields are Mon_Hours::hours_entered, Tuesday's entry fields are Tue_Hours::hours_entered, etc.


This gives the user a way to enter in time for each day they work. Every time you enter some hours on an account (row), on a day (column), then a record is created in the Hours table.

 

What I want to do , is to create a change log for every record created, so if the user changes their time for an account/day combo, I can see when it was changed, what it was before the change, and what it is now. I have a relationship set up to do this.

 

However, I am having trouble making the update log happen against the correct record. I am trying to, onSave trigger, capture this info, and store it in the change Log table, but I can't seem to figure out how to get the pk_id of that record selected. Any suggestions?

 

In general the relationship is like this,

Accounts------<Hours---------<changeLog

But, as far as the above layout is concerned, if I select the field on Vacation for Monday the relationship is:

Accounts------<Mon_Hours

relationships.PNG

I tried using all sorts of combinations of get functions, but no luck.

 

My goal is to get the pk_hours_id of the selected field, then go to a layout based on Hours, which has a portal to the change log. Then add change log records if a change is made. But on entering each field on the above layout, I have yet to accurately have a variable or some other means "grab" the pk_id of the field, if one exists.

Outcomes