November 22, 200421 yr Newbies I am trying to make a script that will check for duplicate records by checking fields in a specific order. Sort of an IF then script for scheduling. The fields I am using are Date, Time of Day, and Venue. If there is a duplicate record than I would like a message box to pop up. Thanks for your help.
November 22, 200421 yr Create a concatenated calculation of DateToText(Date) & "_" & TimeToText(Time of Day) & "_" & Venue. Then make a self-relationship based on this calc and another calculation dupecalc of serial = selfrelationship::serial. When a duplicate is created, this field will result in 1. In your script, test If [dupecalc] Show Custom Dialog ["This date, time, and venue have already been scheduled."] Halt Script End If
November 23, 200421 yr Author Newbies Does this script look right? Or am I missing some language. Thanks for your help. DateToText(Date) & " " & TimeToText(Time of Event) & " " & Venue Dupecalc of Serial = Selfrelationship::Serial If [dupecalc] Show Custom Dialog ["This record already exists"] Halt script End If
November 23, 200421 yr Dupecalc should be serial = selfrelationship::serial. It tests whether the current serial matches that of the first related serial. It should return a zero, however, for dupes, so your test should be If [not Dupecalc]. I don't know what I was smoking yesterday.
Create an account or sign in to comment