June 4, 200421 yr Hello, My question is quite simple: I have a script in the Client database that create a new memo in another database. So, this script calls a sub-script from the Memo database. How can I pass the ClientID from the first script to the second one? Thanks in advance (and sorry for my poor English), Pierre
June 4, 200421 yr You can set a global in either the Client db or the Memo one, and reference it in the sub-script either by its name (if it lives in the Memo file) or any relationship to the Client file (if it lives in the Client one).
June 4, 200421 yr To accomplish this I've created a generic relationship between the Memo file and the client by defining a calculation: c=1 in both files. Then you can create the relationship from the Memo file back to the Client a grab the global Client ID create a new record, and populate the foreign key in the new Memo record with the Client ID. Probably many ways to do this but this works for me. Best. K
June 4, 200421 yr You can use any relationship to the Client file; it need not even be valid at the time of use. You can also use a technique like this one to avoid setting a global to hold the data altogether.
June 10, 200421 yr Author Thanks for your help. So, I managed to do it with the following script... and after having marked "Allow creation of related records" in the relationship between the client table and the memo table: WriteNewMemo Go to Field [Memo::Memo_Date] # There is a portal listing the memos in the client layout: Go to Portal Memo [Last, Select entire contents] Set Field [Memo::Memo_Date, Today] Go to Related Record [Memo] Perform Script [Filename:"Memo.fp5", "NewMemo"] [sub-scripts] Best regards, Pierre
Create an account or sign in to comment