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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get modfied form with new field to save changes?

Status
Not open for further replies.

jtvance

Technical User
Jul 10, 2003
9
US
I'm trying to modify the PM_Vendor_Maintenance form to have the "Tax ID Number" field instead of having users go to the PM_Vendor_Maintenance_Additional_Information form. Both forms are based upon the PM_Vendor_MSTR table.

I can add the field, enable it, and see the existing value for that record, but any changes I make to the data via the field on the PM_Vendor_Maintenance form are not saved. I still have to go to the Additional Information form to get changes to be saved.

What am I not doing? I have compared the new field to other fields on the same form and I don't see any material differences.

This is my first form modification, so I apologize if it's obvious.

Thanks in advance.
 
You need to set your security to see the new modified form. Once you make any changes to a canned form or report it then becomes a "modified form" or report.
 
I did update the security and can see the modified form. I can see the new field (which shows the apprpriate data). I can change the values in the new field, but when I save the record and then requery it, the change I made didn't "take".
 
The problem is that the field exists in two windows on the same form. You need to remove it from the Options window for it to work, or use VBA to synchronise the two fields to always have the same value.

When the command to copy the window contents to the table is executed, the windows are copied in the order they show in the form definition. So the contents of the field in the options window is overwriting the same field on the main window.

Hope this helps

David Musgrave
Senior Development Consultant
MBS Services - Asia Pacific

Microsoft Business Solutions

mailto:dmusgrav@nospam-microsoft.com

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
 
David -

Thanks for your input. I found a techknowledge late today referring to this as a problem (number 9292).

Here's my question. How can I remove the field from the original form ? When I click on it, Edit/Cut is not enabled. I tried moving it to "off the form" (that is to say, I dragged it outside the boundary of the form so when you open the form in GP, you can't see the field) but the behavior I described remained (even though that field is no longer visible on the "Additional Info" form). I hoped I could click on the field in Modifier and then hit delete, but that didn't remove it.

Is there a way to remove it from the "Additional Info" form ? Or is there a way to change sequence in the form definition ?

Thanks in advance.
 
With Dexterity you can make this change, but with modifier there is no way to delete the other field or to change the sequence in the form definition. The top window is the Main window (ie, if it is closed, all other secondary windows close as well) and cannot be changed.

The only solution is to use two one line VBA scripts to update the fields from one window to the other window after the user changes the field.

David Musgrave
Senior Develophment Consultant
MBS Services - Asia Pacific

Microsoft Business Solutions

mailto:dmusgrav@nospam-microsoft.com

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
 
I haven't added VBA scripts to a form before. I was able to add both forms to VB and then each tax_id_number field (the original and the "new" one on the "PM Vendor Maintenance" form). Do you have an idea of what code I should add ? I have taken a VBA class for Access (but haven't done a ton with it yet), so if you can help me get started, I probably can finish it.

Thanks !!
 
Great Plains has some excellent help on VBA and modifier. If you have access to CustomerSource, they have a word document that explains how to have a new field on the main screen update the real filed on the "drill-to" screen, and even avoid "winking" the form. Here is a sample:

The easiest way to prevent the window from appearing is to use the Hide parameter with the BeforeOpen event. To do this properly, the developer must use a Public variable someplace in the application that tells the developer if the window is being opened normally by the user in Dynamics or by VBA code to retrieve extra data. An example of this functionality is given in the sample application. This is the code that would be added to the Customer Maintenance window to prevent it from being displayed.
------
Public Zoomer As Integer

Private Sub Window_AfterClose()
Zoomer = 0
End Sub

Private Sub Window_BeforeOpen(OpenVisible As Boolean)
If Zoomer = 1 Then OpenVisible = False
End Sub
------
Then, from whatever screen you want to retrieve extra data, you would open the Customer Maintenance window in the following manner:
------
Private Sub CustomerNumber_Changed()
CustomerMaintenance.Zoomer = 1
CustomerMaintenance.Open
CustomerMaintenance.CustomerNumber = CustomerNumber
ContactPerson = CustomerMaintenance.ContactPerson
CustomerMaintenance.Close
End Sub
------
One other thing that probably should be done is to use the Activate Event on this window to make sure the Customer Maintenance window is closed before processing can begin. This will help eliminate users from having the Customer Maintenance window open and minimized while the developer tries to zoom into the window to retrieve data.
 
I'm trying to find the document on customer source you refer to. I'm guessing it is in the "How-To Articles" and within the "Modifer/VBA Samples for Dynamics and eEnterprise 7.0" group of documents. Am I on the right path ? Which one within that are you refering to ?

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

Part and Inventory Search

Sponsor

Back
Top