I'm using FileMaker Pro 6.
Any suggestions would be appreciated.
TS
> I'd like to write a script so that the user can abort out of the data
> entry layout without saving the data which is already entered.
Make global fields for the data entry. Send the user to a layout with
these global scripts and end it there.
Put two buttons on the layout: one for data entry and one to cancel. The
script behind the data entry button has to create a new record if
necessary and put the the data from the globals into the real fields.
--
http://clk.ch
Another way is to do the exact opposite - simply create records using
normal fields and have the Cancel button just delete the current record
(and return to another Layout if wanted).
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
In the current version of the database, I'm restricting users from
deleting records from the current database.
Given this restriction, can a script be written so that the operator
has the option of storing the data already entered or cancelling the
current entry?
Best regards,
ts
> Dear Harry,
>
> In the current version of the database, I'm restricting users from
> deleting records from the current database.
>
> Given this restriction, can a script be written so that the operator
> has the option of storing the data already entered or cancelling the
> current entry?
>
> Best regards,
It depends on how (and how well) you're "restricting" the users.
FileMaker's in-built password / priviledges system only works for
user's manually performing tasks. The scripts will still have full
access to every command and function since those are created by the
database's developer and not the user - this way you can control
exactly what a user does, although you often have to build your own
versions of FileMaker's functions (eg. your own Delete button rather
than the option in the menus).
Best regards,
ts
Helpful Harry wrote:
> How does one migrate the globals to the real fields?
The easiest way is for your "Submit" button script to create a new
record and then go through each field setting the content from the
Global field equivalent.
eg.
New Record / Request
Set Field [Name, g_Name]
Set Field [StreetAddress, g_StreetAddress]
Set Field [MainPhone, g_MainPhone]
etc.
You also need to clear the Global fields ready for the next data entry.
This could be done in the 'Submit' button's script or in the script
that sets up ready for the data entry, either way you simply set the
fields to "nothing" to clear them.
eg.
Set Field [g_Name, ""]
Set Field [g_StreetAddress, ""]
Set Field [g_MainPhone, ""]
etc.
For Number, Date and Time fields you may need to convert the "nothing"
to the appropriate format, although FileMaker is fairly forgiving.
eg.
Set Field [gNumberField, TextToNum("")]
Set Field [g_DateField, TextToDate("")]
Set Field [g_TimeField, TextToTime("")]
Container fields can simply be set to "nothing".
eg.
Set Field [g_ContainerField, ""]
Note: Before actually creating the new record, you may first want to
validate that the data in the Global fields is all there (where
necessary) and is correct.
eg.
If [IsEmpty(g_Name)]
Beep
Display Message["The Name field can't be empty."]
Exit Script
End If
I get a calculation screen which does not allow me to enter that text.
Help!
TS
> Everytime I try to edit the Set Field request using Script maker, I
> cannot type in the following: (Name,g_name)
>
> I get a calculation screen which does not allow me to enter that text.
No need to type anything. Set field (Name,g_name) is what the script
line looks like after you entered it.
When you choose the set field command, you first select the field you
want to set by clicking on it. After this, you get the calculation
screen where you enter the value for the field. This value is the
content of the field g_name. You select this field from the list above
or type g_name in the calculation screen.