Results 1 to 3 of 3

Thread: Key field State

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    11,085

    Default Key field State

    Hi -

    I don't believe the DF version matters - though it's most likely always been this way.

    With it true, if you try to save the record after changing it, you get an error msg. OK - good. However, if you really can't change it - shouldn't DF change it back to what it was?

    I had an instance on a view where a user accidentally changed a part #. They then clicked a button that gets the Field_Current_Value of the Part # & creates a child record with it. Thing is, it got the changed (wrong) value & made a mess when it tried to create an orphan.

    I could add a Request_Save in the button, which would put the focus back in the Part # form, but this is awkward, as they have to clear & refind the record.

    Someone have a better way of dealing with this? Thoughts on having DF automagically changing it back?
    Garret

    Time for an oldie but goodie:

    "If it ain't broke, you're not trying." - Red Green

  2. #2
    Join Date
    Feb 2009
    Location
    Stuart, FL
    Posts
    5,321

    Default Re: Key field State

    that means you are not using a relationship but rather copy the value from the DD into another DD

    in that case you would need to make sure the origin DD validates properly before creating data based on it. either just call validate on it or even better validate and save and only if successful try to create a record.
    Otherwise you'd have orphans if you just type data and click your button without ever creating the record

    as far as automatically changing it back that may create some issues as well.
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    IT Director at Balloons Everywhere

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  3. #3
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    11,085

    Default Re: Key field State

    Thanks Michael -

    This is a horribly designed view - well, parts system in general. You have to find a child, then go from there to the parent so you can create a new child. The entire parts module needs a rewrite, but that's not in the cards at this juncture. As another example, it uses DD code to get the parent part # & then procedural code to create the child.

    We've dealt with it, but doing so made me think that Key_Field_State might be augmented to reset the field to its original value.
    Garret

    Time for an oldie but goodie:

    "If it ain't broke, you're not trying." - Red Green

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •