Page 1 of 2 1 2 >
Topic Options
Rate This Topic
#135958 - 11/20/06 09:56 AM Delete records in forms
aravind Offline
Stealth Member

Registered: 08/22/06
Posts: 37
Hi All,

Another question for today.

Requirement:
a)Form B is called from Form A [Both forms in new mode].
b)User fills up form A and before saving it, calls Form B and saves form B.
c)After user saves Form B, he is returned to Form A but does not save form A. (He just simply closes the window)
d)At this point, all form B records linked to a particular Form A record must be deleted.

Can anyone advise how this can be achieved?

We tried deleting all Form B records upon 'Window Close/Undisplay' of Form A (we set some temp field on 'Submit' and if that temp field is $NULL$ on Window Close, we delete Form B records) but even if the user selects 'No' in the warning 'Your changes have not been saved or sent..Do you want to close the Form A window?', the Form B records are still deleted.

Thanks
Aravind

Top
#135959 - 11/20/06 01:24 PM Re: Delete records in forms [Re: aravind]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
you can open up the form B from form A as a dialog window rather than in a submit or modify mode... that way form B will not save anything by itself.. if form B has fields from form A, you can populate them on opening and if form B has extra fields, then you can push them back to the main form..

Thanks,

Anuj.

Top
#135962 - 11/20/06 10:45 PM Re: Delete records in forms [Re: remedybuff]
aravind Offline
Stealth Member

Registered: 08/22/06
Posts: 37
I am opening Form B in dialog. The user clicks on a button 'Save' in form B and the form B record gets saved in the DB and the control is returned to the Form A.

If we return to Form A without saving Form B data, then the Form B data that the user enters is lost.

The question is how to delete the Form B record if user does not save Form A.

Top
#135968 - 11/21/06 08:39 AM Re: Delete records in forms [Re: aravind]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
well, instead of saving data in form B, you can push the fields in form B into form A whenever the user clicks 'save' in form B. that way whenever a user does not save form A, there is nothing in form B.

if both form A and form B are totally unrelated and are two separate pieces of information, and you cannot push fields to form A, then you can commit the changes in form B only after the user clicks 'save' in form A.

Thanks,

Anuj.


Edited by anujtuli (11/21/06 08:40 AM)

Top
#135971 - 11/21/06 09:28 AM Re: Delete records in forms [Re: remedybuff]
Mlevy Offline
Stealth Member

Registered: 07/24/06
Posts: 14
My answer is:
On the form A and B you Add a char Field for setting a GUID
ON the Form B you had a Form A Request ID Field (char)

1) you are on Form A on a submit mode example a ticket that you have not yet save.


2) you click on a button to open a new window (Form B on a Dialog mode)

On your button you make 2 AL.
AL 1: RUN IF: IF GUID Field = $NULL$
IF Action
Set field GUID Field = $PROCESS$ Application-Generate-GUID
AL 2: Open Form B on Dialog mode
Mapping on open GUID = $GUID$.

You had a filter on the Form A

On submit you Push The Form A Request ID to all Form B with the Same GUID.

You had an escalation to the Form B

Al night or time you need you check on the form B all the records that have a GUID ! NULL and a Form A Request ID Field = NULL (that mean that you have created records on form B and the form A have not been saved)and you delete all the records on the form B

Enjoy







Edited by Mlevy (11/21/06 09:29 AM)

Top
#135973 - 11/21/06 10:30 AM Re: Delete records in forms [Re: Mlevy]
aravind Offline
Stealth Member

Registered: 08/22/06
Posts: 37
Quote:
if both form A and form B are totally unrelated and are two separate pieces of information, and you cannot push fields to form A, then you can commit the changes in form B only after the user clicks 'save' in form A.

Can you explain how this can be done? If you dont save the Form B data then-and-there (i.e. while in dialog mode), then where will the system retain the Form B data after the form B dialog closes in order to commit later?

Quote:
You had an escalation to the Form B

Al night or time you need you check on the form B all the records that have a GUID ! NULL and a Form A Request ID Field = NULL (that mean that you have created records on form B and the form A have not been saved)and you delete all the records on the form B


Yes, we had thought of escalations but we cannot have any zombie record hovering till the escalation deletes it (in case the escalation is scheduled to run at midnight). Also, running the escalation every few minutes is not recommended from a performance perspective.

Top
#135975 - 11/21/06 10:45 AM Re: Delete records in forms [Re: aravind]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
if you take the second approach (if we do not push fields to form A from form B), then you will have to save it as an independent record in form B after the user clicks 'save' in form B. i.e. you will have to save the record in form B then-and-there.

only if you push the fields from form B to form A when the user clicks 'save' in form B, you will not need to save any records in form B and also when the user exits form A without saving it, you will not have to worry about dangling records in form B.

Thanks,

Anuj


Top
#135976 - 11/21/06 12:24 PM Re: Delete records in forms [Re: remedybuff]
aravind Offline
Stealth Member

Registered: 08/22/06
Posts: 37
Anuj,

I got your point.

But the question is how do you delete form B record when the user DOES NOT save form A record. (Using escalations is ruled out)

NOTE: Form B data cannot be duplicated in Form A

Top
#135977 - 11/21/06 12:49 PM Re: Delete records in forms [Re: aravind]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
Well, if form A and form B have common fields, the you can populate form B fields using values from form A when you open it in dialog mode. That is how you can prevent duplication of data. Also, if there are more (or different) fields in form B than form A, you can push those fields to form A when the user clicks 'save' on form B. (ofcourse there must be hidden fields on form A to accomodate these pushed fields). This way there will be no records independently in form B, and you wont have to worry about deleting them when the user does not save the record on form A.

Currently how exactly are you linking form A with form B?? (you cannot link them by request ID as form A does not have a request ID until it is saved)

Are you linking them using GUID?



Edited by anujtuli (11/21/06 01:00 PM)

Top
#135978 - 11/21/06 03:06 PM Re: Delete records in forms [Re: Mlevy]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Originally Posted By: Mlevy
You had an escalation to the Form B

Al night or time you need you check on the form B all the records that have a GUID ! NULL and a Form A Request ID Field = NULL (that mean that you have created records on form B and the form A have not been saved)and you delete all the records on the form B


Mic, you can use the archive feature on the form B to do this... This allow more idle time on your escalation queue...

_________________________
Vincent.

Top
Page 1 of 2 1 2 >