Jump to content

Recommended Posts

Hello, 

I'd like to record when a user views a record, and then have a layout where the "Unviewed By Me" records become bold. This idea is similiar to "Unread" in most email programs, but it is generated from a shared set of records instead of only emails delivered to me. 

I know that I can create a subtable to create a record each time someone views a record. I don't need an audit trail of when or how many times they viewed it, just the LAST time, if they have viewed it at all- which makes me think I want this info in the record in question, not through a relationship. I only have 4 users, and I don't need this to scale up to more users. 

Would it be a bad idea to just add fields in the table for: Viewed_user1, Viewed_user2, etc. and then do a script where when a record is viewed, 

Get the user name
Set the field (that matches the username) to the Timestamp. 

I think this would work- but I'm not sure if it's the best way to tackle it. 

Any thoughts would be appreciated. 

Thanks

 

 

 

 

 

Link to post
Share on other sites
1 hour ago, Idahomail said:

Would it be a bad idea to just add fields in the table for: Viewed_user1, Viewed_user2, etc.

Yes, it would. You say you only have 4 users now - but users come and go. Adding/deleting a user should not require a change in the file's schema.

If you want to keep this simple, then use a single text field that stores a return-separated list of the users (or, preferably, account names) that have viewed the record. Then it's easy to apply conditional formatting using the expression =

IsEmpty ( FilterValues ( Get ( AccountName ) ; YourTable::ViewLog ) )

---
Note that keeping the view log within the record itself means that the record will be modified anytime someone views it for the first time. And also that the log cannot be added to if the record is locked by another user at the same time. These problems would not exist if the log was kept in a related table. And you could still create a related record only when someone views the parent record for the first time.

 

Edited by comment
  • Like 1
Link to post
Share on other sites

Thank you for a fast response. 

In your first solution, do I create a script to append to the YourTable::Viewlog field?
And, in theory, if I wanted an "Unview" button, I'd have to delete that account name from the list? 

I was avoiding a related table to reduce overhead- it seems like in a list view, there's going to be a lot of calculating happening in order to do the coniditional formatting for what could be 1000's of records and I thought it would be better to keep it in the same record. 

In the case of a related table, would it look like this:

[Main Table]
RecordID
RecordField1
RecordField2

[Log Table]
LogID
RecordID>FK
Account (that viewed it)
Timestamp

Script:
FIND related Values in LogTable
IF one of those records contains the Account - Do Conditional Formatting
IF the records DO NOT return one with the Account, Create A New Record (and possibly loop, because it now meets the FIND Criteria)

 

Thanks

 

 

Link to post
Share on other sites
36 minutes ago, Idahomail said:

In your first solution, do I create a script to append to the YourTable::Viewlog field?
And, in theory, if I wanted an "Unview" button, I'd have to delete that account name from the list? 

Yes, to both.

36 minutes ago, Idahomail said:

I was avoiding a related table to reduce overhead- it seems like in a list view, there's going to be a lot of calculating happening in order to do the coniditional formatting

Not really. The calculation is the same, except that instead of the text field you would use List ( ViewLog::Account ).

Alternatively, you could define the relationship as:

YourTable::ID = ViewLog::YourTableID
AND
YourTable::gAccountName = ViewLog::AccountName

Then it's just a matter of checking if a related record exists.

In either case there is no need for a script.

 

Edited by comment
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Similar Content

    • By milky
      Hi All,
      Just had a look at the new Add-ons in Fm19.
      Is there a way to make the timer work in reverse.
      i.e. Start from a field (Timer::TimeLength) that a user can input, so that the specified time of say 30:00 will run down to 0:00
      Any help would be appreciated.
      Regards
       
      Milton.
    • By BostonFM
      I am trying to script an import of three worksheets in the same Excel file. The 3 geographical regions worksheets are not structured the same, i.e. field name rows are not in the same place and are named differently.
      The script runs but stops to ask which worksheet to process.
      How do I create a variable/parameter in the script for it to proceed sequentially from worksheet 1-3 without stopping?
      Thanks
      DA
    • By SupportGuys89
      Hello Fellow FM'ers!
      We have been testing Linux and everything has been great, but we are having issues with the authentication via web direct using Windows Federated Services. We followed the steps in the available documentation "Addendum4_ADFS.pdf" and also used "ExtendOAuth_v1.pdf" to get the AD-FS rules configured as well as the necessary admin console requirements (Client Key, Shared Key etc...) We do see the following on attempting to login to our solution:

       
      And when we click on the AD FS Option we do receive a login prompt from our Federated Services:
       

       
      However, even with the correct credentials we still see the following error message:

       
      We have reviewed the logs within AD-FS and no errors are reported and the credentials are passed as expected. Within our solution and Active Directory, we also ensured the user is in the correct group to access our solution via webdirect. I will gladly provide more details into the configuration of AD-FS or FM Admin Console, but these all match the documentation provided by Claris. 
      We went a bit further and got an inhouse developer to take a look and test the flow and he was able to confirm the following:
      Our Endpoints are setup correctly and can be viewed internally @"https://INTERNALADFS/adfs/.well-known/openid-configuration" Initial request  was tested with "https://oidcdebugger.com/"  Postman was then used to test once we received a response. Decoding the jwt received with "https://jwt.ms/"
        The JWT had a unique_name, an email, and a groups array with one of the values in that group array being the group that is set up in the Filemaker solution.   With that said, we are not sure what the next step would be to test this as we appear to be seeing all the correct information in our testing yet we still are not being "authenticated" in our solution. I have also opened a ticket with FIleMaker and no luck as of yet. Any insight would be greatly appreciated!  
    • By Macastronomer
      Thank you in advance...
      We have a serialized field that has a value of FL2021-0001 and increments by +1. 
      I created a script that makes a duplicate record for reasons that don't matter here... but at this point I need to reset the serialized field to the next correct number. I do this with the Set Next Value function as such: 
      Set Next Serial Value [TableFL::SerializedField ; Max ( TableFL::SerializedField ) + 1 ]
      The problem is it sets the next value to 20210002 instead of FL2021-0002.
      Can I read this as a string and increment it or is the return always going to be a strict numeric value?
      Thanks again.
       
    • By Deepak Kumar
      Hello Everyone,
      I would like to check what are issues when FileMaker Pro and Server 19 are installed in Windows Server 2012 R2?
      Thanks.
       
       
       
       
       
  • Who Viewed the Topic

    1 member has viewed this topic:
    moriya0238 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.