Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New field generate the message "Save Changes?" in Item Maintenance

Status
Not open for further replies.

mlbechard

Programmer
Jun 22, 2009
87
0
0
CA
I have added a new field in the Basics tab of IM0101 screen. I have called a function to display the data in this new field when the Description field got focus. The function to save the data is called when this new field loses focus. Here is the issue. I get the error message "Save Changes?" with Yes/No/Cancel button from Macola ES each time I clicked on Cancel to close the screen. Changing or not the data in this new field does not matter. It does not even go into the function to save the data when clicking on Cancel.

Why do I have this message all the time I close the screen?
 
What trigger the "Save Changes?" message box?

Thanks in advance
 
The MacformSave event should do it, but I am not in front of Macola ES at the moment. Please give this a try and let us know.

Software Training, Implementation, Programming and Support for Macola Progression, Macola ES, Synergy, and Crystal Reports. Check out our Macola tools:
 
How can I get that message when there is no change in the form? I just populate a custom field from the extra_6 table field imitmidx_sql.
 
Populating an extra field in the screen IS a change in the data, hence the prompt. Try instead on the macform_save event to just change the value in the extra field with a SQL statement, without ever populating the field on the screen.

Software Training, Implementation, Programming and Support for Macola Progression, Macola ES, Synergy, and Crystal Reports. Check out our Macola tools:
 
That is a good idea but the thing is it does not go in the macform_save event when I press Cancel. This is where I got the prompt. I looked but did not find any event for the Cancel. Does it exist?
 
But if you hit cancel, you do not want it to save anyway do you?

Software Training, Implementation, Programming and Support for Macola Progression, Macola ES, Synergy, and Crystal Reports. Check out our Macola tools:
 
No I don't want it to save when I hit Cancel but I get the prompt. I think I get the prompt because I populate the field with the extra_6 field value on the description_gotfocus event. If I am not populating the value from a SQL query, it is always blank even if there is data in the table for the item selected.

I tried to save the value in the table as soon as I display it but I still get the prompt when I hit Cancel.

Here is what I want to do. I have create a custom text field from the Designer to show the value of the extra_6 field from the imitmidx_sql table. I looked if there was a hidden field for the extra_6 but there was not. Because the custom field on the screen is not directly related to extra_6, I have created a function in macform to display the value of extra_6 for the selected item. This function is called in the getfocus event of the Description field. There is another function to save the value of the extra_6 in the database and it is called on the losefocus event of the custom field.

So far, what ever I am trying to do, I always get the prompt. To get rid of the prompt, I have to comment the function to display the value of extra_6 in the custom field on the screen. But I have to see the value somewhere in the screen and the user can change the value as desired.

Is there something I do wrong???
 
The solution I found is to display as read only the value of the extra_6 field on the screen. Create a push button to call a new form that allow to change de value of the extra_6 in the database. Just displaying the extra_6 value as read only get rid of the prompt.

Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top