Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reposition record pointer in a BizObj
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00362006
Message ID:
00363007
Views:
16
Cathi,

>I need move to a specific record in a BizObj based on the cUniqueIdField. Is there a method to do this in the BizObj or DataBehavior? I can't seem to find one. I don't like coding record movement directly on my forms because the DataBehavior could change in the future and cause my code to error. There is methods for First, Last, Next, and Prior but not for a specific record based on the cUniqueIdField or any other field.>

There is no generic method in KBizObj to locate a specific record based on UniqueID. What I recommend is this...

1. Subclass KBizObj to create your own "common" or "base" business object class. Create all of your business objects as subclasses of this base business object class

NOTE: If you've already created your existing business objects as direct subclasses of KBizObj you can open your business object class libraries in the Class Browser and use the "Redefine" button to change the parent class of your objects from KBizObj to your new base business object class.

2. Create a new method in your base business object and name it something like "SeekRecord". For example, you could do something like this:

LPARAMETERS tcUniqueID
LOCAL lcAlias

lcAlias = This.GetAlias()

*--- NOTE: This only works if you have a tag named the same
*--- as the field name stored in This.cUniqueIDField

RETURN SEEK(tcUniqueID, lcAlias, This.cUniqueIDField)

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform