March 21, 200817 yr Does anyone see anything bluntly wrong with this script? The two tables are related via a Constant. If [ IsEmpty ( ddd_online::zContact_ID ) ] Insert Calculated Result [ ddd_online::zContact_ID; GetNextSerialValue ( "trip_d" ; Contacts::Contact_ID) ] [ Select ] End If I've trying to use this when importing records from another files. Is this not how you use the GetNextSerialValue? I've also tried this as the script. If [ IsEmpty ( ddd_online::zContact_ID ) ] Set Next Serial Value [ ddd_online::zContact_ID; Contacts::Contact_ID ] End If TIA.
March 21, 200817 yr Insert Calculated Result [ ddd_online::zContact_ID; GetNextSerialValue ( "trip_d" ; Contacts::Contact_ID) ] Try: Insert Calculated Result [ ddd_online::zContact_ID; GetNextSerialValue ( "trip_d" ; "Contacts::Contact_ID") ] The GetNextSerialValue() is an odd function, in the Design section, because it wants the field name in quotes. The reason for this (I think) is that it often would be used to get the value from a file which would did not have any kind of relationship from where you are; which you wouldn't if you were doing an automated update, which is what the function was designed for. It would be nice if it would also accept unquoted values, because it's so easy to overlook. But that's really a very different thing.
March 22, 200817 yr I've trying to use this when importing records from another files. Is this not how you use the GetNextSerialValue? I don't think so. If you're unable to auto-enter the serial numbers during import, you should use Replace Field Contents [serial numbers] to number the imported records. You can use Set Next Serial Value[] to preset the numbers either before or after the import, but in most situations you wouldn't need to.
Create an account or sign in to comment