Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8013 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am in the process of creating a script that will delete the current record using a custom dialog box. I have searched the list of filemaker error codes, but cannot locate the code for delete record. I am looking for the code to use with the "Status(CurrentError=??)" statement to activate the custom dialog box.

At this point, my script is laid out like this:

If( Status(CurrentError) = B))

Show Message("Are you sure you want to cancel this loan?") choices "Yes","No"

If (Status(CurrentMessageChoice = 1)

Delete Record/Request [No Dialog]

End If

Does anyone know what code I need to use??

Thanks in advance,

Posted

Status(CurrentError) <> 0

That is, you look for any error. 0 = no error.

Posted

I altered my script to the following:

Allow User Abort (Off)

Set Error Capture (On)

If ["Status(CurrentError <> 0)"]

Show Message ["Are you sure you want to cancel this loan?"] Choices of "Yes" and "No"

If ["Status(CurrentMessageChoice=1"]

Delete Record/Request [No Dialog]

End If

End If

It looks like it should work (doesn't most stuff look like that?) But no matter which button I choose on the dialog (which pops up correctly), it goes back to the current record w/o deleting it.

...i don't think i need the first If - with the CurrentError statement. I just need to set-up the outcome of the Show Message choice.

Can anyone see what I'm doing wrong?

Posted

I FOUND IT!!

I've been using the following:

If["Status(CurrentMessageChoice = 1)"]

INSTEAD OF:

If["Status(CurrentMessageChoice) = 1"]

After I put the "= 1" outside the parenthesis, it works!!

Posted

That'll do it every time!

I saw that in your original post and figured it was just a message typo.

This topic is 8013 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.