Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6161 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Dear Forum!

Okay I have a REAL Goodie question that I would love the forum to tear its hair out over. :

I have the following need.

In my FM File I have 5 Text fields.

They are used to print a report. The report is given to the boss 5-10 hours later, and if all is okay on the report, the boss signs it.

The report MUST remain editable during this time because there may be changes and the report may need to be reprinted.

When the report is finally signed and all done, the secretary must "seal" the report and "generate a PDF from it" (that part is easy).

Problem: I must guarantee, that "what is sealed by the secretary" is still ****exactly*** what the boss signed, ie what was printed out for him 10 hours before.

My idea: Generate a hash number when the report is printed that uses all the letters in all the 5 text fields to be generated.

This number will be printed on the bottom of the report that the boss signs.

When the secretary "seals" the report and "makes the pdf", she first types the number from the report back into the system.

The system compares what she typed to the number it calculates and IF they match she can seal the report.

If not, someone fiddled with the report, secretary gets an alert and it must be reprinted for approval.

To do this I need a hash funtion that can generate me a unique number based on 5 text fields (about 3 pages A4) of text. The hash function must be precise enough to immediately give a different number (ie scream "alert") when even only 2 letters are interchanged, ie if ANYTHING was changed in the text.

This is for a medical application so precision is crucial.

Any ideas as to what hash function I could use folks? Anyone have one?

With love!

the Spongebob

Posted

Correction: I think Im looking for a checksum algorythm for text fields, not a hash function.

Posted

I'd rather add a separate table to keep multiple revisions of these text fields. Each revision would have a serial number to print on the report. After printing the revision would get locked in such a way that ordinary users cannot change it. If it's necessary to edit the report, the system would add a new revision (duplicate the last one) with a new number.

Posted

I think Im looking for a checksum algorythm for text fields, not a hash function.

Checksum or hash - it's practically the same thing. Very difficult to implement in Filemaker. I would consider using a plugin, if necessary. But do you really need this? You could simply tag the printout with a timestamp, and have an audit-log field monitoring the 5 fields.

Posted

It's a little tricky because FM recognizes a modification of the field to the same data as it had, as a modification, so you could be requiring signatures when they're unnecessary unless you put in a catch.

I'd say a you'd need two fields. One to capture the 5 fields by script and one to generate the timestamp.

Stored Data is a text field set by script when printing to Field1 & Field2 & Field3 & Field4 & Field5

Mod Timestamp is a calc field

= Case(Field1 & Field2 & Field3 & Field4 & Field5 =/= TestData; Get(CurrentTimestamp); Mod Timestamp)

Posted

True, if someone modified a field, then changed it back to the original, my method would still raise the alarm. But it might be preferable to err on the safe side. If someone moved the ending paragraph of Field1 to the beginning of Field2, your method would not notice it - though the meaning might have changed considerably.

Posted

Wow wow wow all great suggestions thank you, I knew this was the right braintank to tap.

I like the idea of the "keeping revisions of the fields". I think Ill do this:

- when the user prints (and I can force him to print via a script hooray), a completely seperate copy of the 5 text fields is kept with a running number in another table/file. That number is printed at the bottom of the report in light gray, small.

- boss signs report

- secretary now "seals" the report but when she does that she types in the number thats written on the report.

Then I can check, is the text data that was "saved under that number", still exactly the same as in the 5 fields, ie did someone modify the data in the meantime or not?

I would use the EXACT function to compare the text fields.

This way, I think I dont need a hash or checksum at all.

Can anyone find flaws with this approach?

Big Hugs

from spongebob

Posted

Actually, ANY delimiter would do.

I don't think so, not in the case you brought up.

Take this example:

Fields are changed from:

1

2

3,

4

5

to

1

2

3

,4

5

If the delimiter is a ",", both produce the same result (1,2,3,,4,5), even though the contents have changed.

Posted

There already is a great Audit Trail solution floating around FMForumns look for it you may be able to use it here.

what about using Permissions?

When the scty prints the report in the morning, it sets the status field to 'Pending' or something like that. When the boss approves it, she can change it to 'Approved'

If the status is Pending or Approved do not allow editing.

Script the status field so only the scty can update it.

If she needs to make any changes she would change the status to blank, make the changes, then Approve it (w the TS)

Jerry

Posted

Yes a good suggestion, unfortunately what you couldnt know, spoiled by the reality that the "re-editing" part, if there are changes to be made, are made by several people, hence this wont help us much...unfortunately and it spoils the nice suggestion.

In my version, if changes are made (and its possible to make them) in the end, the scty must print out the report again anyways, where it gets a new number...and the whole shebang comes together quite nicely in the end.

Also a nice discussion about delimeters. I was going to make my delimeter this $*+###+*$. Unlikely someone would use that in the text...unless they are swearing? LOL

Thanks everyone! On yes and what exactly is that great Audit Trail solution floating around FMForumns?

Much love and hugs from Spongebob

Posted

BTW: you can look at the function:

GF_Hash(text {; algorithm = "SHA512" (or, in order of diminishing security: "SHA256", "SHA1", "MD5", "TR1") }{; encoding = "base32" ("handwrite", "hex") } )

of the Gap_Filler plug-in here:

www.dracoventions.com/products/gap_filler

This topic is 6161 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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