Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Creating an either/or for a New Record button


saltobello
 Share

Recommended Posts

I'm writing a script for a New Record button that will not permit a new record to be made unless certain criteria have been met in the current record.

 

I've successfully created the script so that when the criteria's been met, a new record will be created, AND when the criteria hasn't been met, a dialog will appear with a warning and an "OK" button.

 

Here's the rub: when I click that "OK" button, it STILL creates a new document. I want it to stay in the record that's already open.

 

Anyone have any suggestions?

 

Thanks!

Link to comment
Share on other sites

Hi, Bill. Thanks for the response. It kinda helps, but I'm still stumped. I'm wrestling with it now and might get lucky. However, if you can be more specific, it would help.

 

Thanks!

Link to comment
Share on other sites

Awright, I'm going around in circles here. This is what I've done so far, and needless to say it's not working:

 

Loop

If [isEmpty ( Picture # )

Show Custom Dialog [“Invalid entry!...”]

End If

Exit Loop If [isValid ( Picture # )

End Loop

If [isValid ( Picture # )

New Record/Request

End If

 

I feel like I'm stuck in a loop myself!

Link to comment
Share on other sites

I'm writing a script for a New Record button that will not permit a new record to be made unless certain criteria have been met in the current record.

 

What criteria?

 

When the user decides to create a new record are they in a form? A table? Can they navigate away somewhere else?

 

Perhaps it would be easier to NOT allow the creation of the first record until all criteria are met rather than allowing the creation the record but preventing another record...

Link to comment
Share on other sites

What criteria?

A number has to be entered into a specific field, a field that some co-workers tend to fill in, which causes problems down the road.

 

When the user decides to create a new record are they in a form? A table? Can they navigate away somewhere else?

 

Perhaps it would be easier to NOT allow the creation of the first record until all criteria are met rather than allowing the creation the record but preventing another record...

 

So you're saying they shouldn't be able to go to any other fields/layouts/etc. outside of that record until they've entered that number? Is it possible to do that? Wouldn't I need to add a similar script to all the possible exit routes?

Link to comment
Share on other sites

make the field mandatory

 

manage database -> go to the field u need 2 have data -> options-> 2 nd tab -> not empthy

 

or whatever it's called (i've got the dutch version of FM)

 

so on creation of the record the user has 2 fill in that field and stays on the record

 

and maybe u can change the the error msg 2 a custom 1

 

and for the loop u can't choose a picture from a custom dialog, maybe thats why it doesn't work

 

My 2 cents

Link to comment
Share on other sites

A number has to be entered into a specific field, a field that some co-workers tend to fill in, which causes problems down the road.

 

So you're saying they shouldn't be able to go to any other fields/layouts/etc. outside of that record until they've entered that number? Is it possible to do that? Wouldn't I need to add a similar script to all the possible exit routes?

 

Suppose you are in a Widget inventory table and you want to add a Widget to the table.

 

I use a scripted button that takes me to a form with global fields that are named exactly the same as the critical widget fields. The user only has two options: 1) Return to the Widget table WITHOUT adding the new record (I use an "Abort" button that clears the global fields and then returns to the correct layout) or 2) Fill-in the fields and press the "Save new record" button.

 

The "Save new record" button checks to see that all fields are filled in, and if not, displays an error message and goes to the first empty field. If all the fields are filled in then the script goes to the Widget layout, creates a new record, Fills in all the fields (using "Set Field"), commits the record, and finally clears the global fields to be ready for the next use and returns to the Widget table.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use