Run Process while creating a new record

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Run Process while creating a new record

Post by Jhstephenson »

Here is the situation...

I have a form where I am creating a new client record.

After entering some of the new client information (Last Name, First Name, Date of Birth, Gender) I need to run a process that will display a query of potential conflicts with the last name just entered.

Right now I have a button on the New Client Form called 'Check for Conflicts' that executes the process that calls my potential conflict query.

The process does this:

Code: Select all

SessionVariables.Search_FirstName=TRIM(ClientMaster.FirstName) 
SessionVariables.Search_LastName=TRIM(ClientMaster.LastName) 
DISPLAY 'Check for Potential Conflict' 
A couple of issues come up:
1. When I click on that button I get a message saying "There are unsaved changes in the form of object ClientMaster.
Do you want to save them?" I say 'No', the query runs,

2. But there is nothing in the SessionVariables, so nothing shows up on the query.

3. When I close the query (it opens in a popup) and return to the New Client Screen most of the previously entered information is gone. The only attribute that has anything in it is FirstName.

What I would like to have happen is...

1. After entering the date of birth I would like it to automatically run the 'CheckForConflicts' process. If I still need to call the process through a button, I can live with that.

2. I don't want the 'unsaved changes' screen to popup.

3. When I return to the New Client Form, after looking at the Potential Conflict Query, I would like the data I had previously entered to still be there.

Is any of this possible?

Thanks,
Jim
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Run Process while creating a new record

Post by Jaymer »

1. TRIM not needed
2. On the button, check "Save Form" (or similar) to save that record before it goes off and does something else.
3. That process doesn't have access to the ClientMaster vars because that rec was tossed (u answered "No"). Thats fixed with the AutoSave, and make sure ClientMaster is an Input BO to that process.

These are the simple answers
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Run Process while creating a new record

Post by Jhstephenson »

Thanks Jaymer.

1. The TRIM is needed. I tried the process from a Client Master query and without the trim it found nothing. With it, it found what I was looking for. The query actually does a FIND CLIENTS WHERE CLIENTS.FULLNAME CONTAINS SessionVariables.LastName

2. I don't want to save the record yet. If the user decides, based on what comes up on the query that there is a potential conflict they may decide to not create the New Client.

3. Is there a way through JavaScript to update a SessionVariable with the value that was entered in those attributes, prior to saving the New Client Record.
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Run Process while creating a new record

Post by Jaymer »

Jhstephenson wrote: Thu Jul 27, 2023 2:52 pm Thanks Jaymer.

1. The TRIM is needed. I tried the process from a Client Master query and without the trim it found nothing. With it, it found what I was looking for. The query actually does a FIND CLIENTS WHERE CLIENTS.FULLNAME CONTAINS SessionVariables.LastName

2. I don't want to save the record yet. If the user decides, based on what comes up on the query that there is a potential conflict they may decide to not create the New Client.

3. Is there a way through JavaScript to update a SessionVariable with the value that was entered in those attributes, prior to saving the New Client Record.
1. well, if you've imported the data, saved data may have whitespace at the end, but if these were keyed in on a form, there is no need for a TRIM.

2. I figured as much, but Unless there's a bunch of rules and behind the scenes stuff, you can save the record in a "temp" state with a hidden field. Then at the end of the process Flip that field.
2b. OR, use a temp ClientMaster table to input these 'unsure' entries - and move them when they decide to create.

3. Then use Dynamic rules when that field(s) is entered to save the value.
IF ClientMaster.FirstName WAS CHANGED THEN Search_FN = ClientMaster.FirstName
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Run Process while creating a new record

Post by Jhstephenson »

I think I have it figured out.

Kind of like you suggested in #3.

I created attributes in SessionVariables to hold the Client's Names, DOB, & Gender.

When they want to create a new client, I present them a SessionVariables form, with those attributes on it. It looks almost identical to the normal New Client form.

The Save button calls the Potential Conflict Query.

When they close the Query, if they choose 'Continue', I then just do a CREATE ClientMaster and update the corresponding attributes for each SessionVariable attribute and present the normal Client Entry screen. If they choose Cancel, it just ends the process.

Then it is just a matter of them deciding if they want to continue entering the new client, or closing it without saving anything.

It works, and is only slightly different than their current 'Magic' program.
Post Reply