Wiki Home

Visual FoxExpress Faq

Namespace: VB
Visual FoxExpress Frequently Asked Questions and Answers will be posted here.
How can I get rid off from the error message 'A Record already exist with some or all of this information'( Error 1884) .I want this because I just dont want to click ok button of message box when I transfer records from other sources of data with the same key values , I just want not to save indeed it is not saving but showing the message box.

Not sure if this falls into FAQ... but, you would most likly need to trap the error in your cursor class and return a FILE_OK rather than FILE_ERRORHANDLED so that the message is not displayed. -- Bob Archer
Note: F1 Technologies does not intend to monitor the wiki on a daily basis to answer questions. To guarantee a response from F1 to your questions please post your questions in the appropriate conference at
Visual FoxExpress Formatting Grids

Q: How do I get grids to show me data from the parent record instead of the foreign key?
A: Related Business Objects, Combos in the grid or use a view. see: Vfe Grid Lookups

Q: Why do I keep getting a C0000005 Ex Error when running VFE, especially when I am trying to do Mark Austen's tutorial?
A: Because someone at MS doesn't care enough to make them go away. Actually, VFP SP 5.0 fixes most of the C5 errors, espesially the one you would see in VFE alot when using multiple class wizards.

Q: After I have created a Presentation Object via the wizard, I want to add a new control to it. Do I have to remove the Presentation Object and start from scratch?
A: No, just add the control to the presentation object (from the i-layer) and run the builder on it. The builder will allow you to associate a field with the control, if necessary. Also, remember to set your new tab order.

Q: What is the best way to carry field values from a previous record to a newly created record?
A: Create a property in the business object for each field you want to carry over. Store the value of the field in the New_Pre method and update the value in the New_Post method. You could also use SET CARRY TO. You could set this in the Init of the bizobj.

Q: When the child PO has focus and I hit "new", I get a new parent. How do I get new child records?
A: By default the toolbar only talks to the main presentation object on the form. You could set the form's oPresentObj property to reference the current presentation object in its Got Focus method, but I doubt users would understand that. I'd recommend placing controls within the child presentation object.

Q: How do I set and reset environment settings?
A: Use the VFEc Set class to set, reset will happen when the object gets destroyed.
Example: loSet = Createobj('cset','CENTURY','OFF')

Q: What is the name of the application object?
A: this.oApplication

Most applications have an application object that can be referenced anywhere in the app. Typically this requires that it be assigned to a specific variable name. A feature of the Visual FoxExpress framework is that every class has a property oApplication, which is a reference the application object. So anywhere in the app, you can use this.oApplication instead of the name of the application object. It is a value local to every object that references a global value. This allows multiple applications (the same or different) to be run concurrently.

Q: Should the I level classes contain all the C level classes?
A: Maybe. See Vfe Ilibs

Q: How do I stop the "enter parameter" dialog for my parameterized views when I have parameter textboxs on my form?
A: Set the cursor object's "NoDataOnLoad" to .t.

Q: How do I iterate through all the items of Business Object?
A: Not DO while !this.eof() - See Vfe Loops

Q: How to modify things in VFE so that they will survive an update.
Q: Vfe Customizations - Some things are easier than others, but the important ones are easy.

Contributors: Carl Karsten
Category Visual FoxExpress Category Visual FoxExpress Tips And Tricks
( Topic last updated: 2004.03.17 03:03:16 PM )