November 10, 200520 yr I have a script that basically creates a new related record in a table, but before it does that it checks to see if there is not already a "new" record (really incomplete data entry) ... all this works fine however one I go to the layout and create a new record the primary key identifier data is reset to empty and the paste just pastes anything I have in my clipboard... This all worked fine until yesterday... and I can't see why but it goes bad at line 11 1 Set Field [ Participants::Participant_RecordID ] 2 If [ Determinations Incomplete::Determination_Status_FK = "0" ] 3 Show Custom Dialog [ Title: "Invalid Choice"; Message: "An unfinshed determination already exists."; Buttons: “OK” ] 4 Go to Related Record [ From table: “Determinations Incomplete”; Using layout: “Add Determination” (Determinations) ] 5 Exit Script [ ] 6 Else 7 Copy [ Participants::Participant_RecordID ] [ Select ] 8 Show Custom Dialog [ Title: "Determination Type"; Message: "Select the determination type"; Buttons: “Cancel”, “Full”, “Declined” ] 9 If [ Get ( LastMessageChoice ) = 2 ] 10 Go to Layout [ “Add Determination” (Determinations) ] 11 New Record/Request 12 Paste [ Determinations::Client ID ] [ Select; No style ] 13 Go to Next Field Enter Browse Mode Else If [ Get ( LastMessageChoice )= 3 ] Go to Layout [ “Determination_Decline_no_Show” (Determinations) ] New Record/Request Paste [ Determinations::Client ID ] [ Select; No style ] Insert Text [ Determinations::Determination_Status_FK; “2” ] [ Select ] Go to Next Field Else Go to Layout [ original layout ] End If Adjust Window [ Resize to Fit ] Enter Browse Mode End If Maybe there is a better way to do this anyways, but I'm drawing a blank.... Thanks
November 10, 200520 yr I don't think you have given enough information for us to help - although there may be somebody who has had preciely the same problem and will step in with a solution. In the meantime two questions. Exactly how does the script go bad at line 11? and the obvious What did you do yesterday that might have an effect on this?
November 10, 200520 yr I'm not sure what is happening, but since you are using FM8, I'd rather you use Get (Scriptparameter) and script variables ($ for local and $$ for global) istead of copy and paste. That way, your clipboard stays "clean".
November 10, 200520 yr There is more flaws in the reasoning, in line 1 ..."To what" might be a urgent question the answered, Set Field[ requires a reciever field as well as an argument!!! Then isn't it particular precise when you writes: checks to see if there is not already What is this?? detection of uniqeness; or....?? --sd
Create an account or sign in to comment