Creating Keyword/Tag System in FileMaker 14 -
i have filemaker 14 database of events. want able tag each event keywords. therefore, have created 3 tables, structured such:
events ---< tags >--- keywords
now, in order add keywords tags event, want make sure keyword has not been added , exists in tables of keywords. if doesn't exist, should created , added tag.
in order implement this, thought have global field user enters keyword want. script following:
enter keyword in global field set variable $eventid wtih id of current event set variable $keyword value global field check if $keyword present in keywords table if yes id of $keyword , put in variable $keywordid check if $keywordid tagged event if yes display message, "this keyword has been added event" if no create new record in tags table $keywordid , $eventid clear global field exit script if no create new record in keywords table $keyword value in keyword field set variable $keywordid value of id field create new record in tags table $keywordid , $eventid clear global field exit script
this step-by-step script attempting write. however, stuck @ how check if $keyword present in keywords table , how id of $keyword keywords table.
please let me know if have suggestions or if there easier way tackle issue.
there many ways handle - example, have relationship linking global field (in table) keyword field in keywords table. know instantly if related record exists , id.
alternatively, perform find in keywords table. or script attempt create new record , watch error caused validation of keyword unique failing.
btw, possible keyword require global change? if not, why need keywordid? use keyword itself, , validate unique. (yes, know you've been told it's bad practice. is. usually. when there reason.)
Comments
Post a Comment