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

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

Recommended Posts

Posted

I want to be able to use a script to create a new/empty record (and records in a related table/portal.)

After creating the record, I want the user to be able to enter data into the record/portal, and then I want to be able to validate the fields. Is this possible via scripts (I assume it is)? If so, do I need several scripts?

Ideally, I would like to be able to trap whenever the user tabs out of certain fields and validate their content, and then validate the entire layout contents. Can this be done without using the database validation rules?

At present the application that I am working on has a script to create the new record (initiated by a button,) but it doesn't do any validation. I'd like to do that.

Posted

A better way is to get the user to enter the data into global fields, validate it, then create the new record when the data is deemed OK.

This was you can keep the field-level validation, which is an important part of ensuring the system's security and integrity.

Posted

Interesting ... a radical departure from what I was thinking ... but it makes a lot of sense.

However as I think more about it ... does it not still raise the question of how to do field level validation on the global fields? I still need to understand how to do field level processing on a layout whether those fields are global or not. I am not sure how control is passed from an script to a layout, and back. Or do they have to be separate scripts and if so, how do they get invoked when a user tabs out of a field?

Is this an appropriate area to consider the Commit Records/Request step?

Posted

does it not still raise the question of how to do field level validation on the global fields?

No - it gives you even more flexibility by letting you do the validation either by the script on the submitting button, or you can do it with native validations or a bit of both. The native can handle typos and the scripted can handle field ommisions e.g. you use or-keying with multilinekeys which demands both a startvalue as well as a finish value in order to define the range ...the scripted validation handles the situation where one of these are missing.

What I tend to do is to let the fields be assigned as autoenters from their global counterparts, this make the script very short:


If[Count(field1;field2;field3)=3]

      New Record

End if

--sd

  • 1 month later...
Posted

It's been a while since I started this script and I'm still struggling with the overall approach.

Problem is that I have a script which creates a new client, and also creates two rows in a portal record (phone numbers). I need to validate the data in those portal rows based on combinations of values in the fields. (e.g. certain area codes may need a country codes; if there is an area code there must be a local number)

So I wrote a script which creates the new client and then creates two portal records. It then pauses to let the user enter data, and then validates the data. But I also have database validations and they don't take effect as long as the user is in the script. The user does not want to have to click on a button to save the record.

Creating the records works ok but the main problem is that once the user exits the script, they can go back and modify the data in the portal so that it violates the rules I established and there is no easy way to prevent that because the only thing that would prevent this would be database validations.

I suspect I'm trying to achieve the impossible and will just have to insist that the user clicks on a button to commit the changes.

  • 5 weeks later...
Posted

Just to conclude this thread ...

What I ended up doing was using EventScript plug-in which invokes a script when a field is validated. That way I could develop scripts to do the validation anytime the user changed data in the selected fields.

This topic is 7110 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.