Just a little modification from Peter's code

Instead of defining an object attribute in the Variable and Expression, leave 
it blank so 4D will generate a dynamic variable for it. In the object method, 
you just need to execute the following when the On Data Change occurs.

Case of
   : (FORM Event=On Data Change)
      Form.en_edit.contact:=Self->
End case

HTH,
Add




On 2-5-20, 9:50 AM, "4D_Tech on behalf of Peter Bozek via 4D_Tech" 
<[email protected] on behalf of [email protected]> wrote:

    On Tue, Feb 4, 2020 at 9:58 PM Chris Belanger via 4D_Tech <
    [email protected]> wrote:

    >
    > So I had to resort to creating a FORMULA OBJECT that gets executed to do
    > the update of the .storeLoc
    >
    > $formula:=Formula from string($storeLoc+":="+Qu ($UUID))  // $storeLoc is
    > the full ‘path’ of the attribute, such as    Form.en_edit.contact
    >
    >                                       // $UUID is the value that needs to
    > be put into that attribute (i.e. field)
    > $formula.call()  // ...this updates it into the entity’s attribute
    >
    > Seems cumbersome to need to go about it that way, but it was the only way
    > I could find to accomplish it. But at least it worked.
    >

    Another possibility - I have not tested it, so I am not 100% sure it would
    work - would be not to assign  Form property to object, and rather leave
    the expression empty. Then you would have Self-> and could get pointer to
    object with OBJECT Get pointer (object named;) call.

    However, you would have to bind the object to the form property yourself,
    with code like

    case of
      :((form event=on load) | (form event=on outside call))
         Self->:=Form.en_edit.contact
      :(form event=on data change)
          Form.en_edit.contact:=Self->
    end case

    Peter Bozek


    > The complexity is that when I define the comboBox specs, the storeLoc must
    > be text, like “Form.en_edit.contact"
    >
    > Seems counter-intuitive to need to resort to a similar mechanism just to
    > coerce a way to update a value of a form object (i.e. a ‘variable’ on a
    > form).
    >
    > Chris
    >
    >
    **********************************************************************
    4D Internet Users Group (4D iNUG)
    Archive:  http://lists.4d.com/archives.html
    Options: https://lists.4d.com/mailman/options/4d_tech
    Unsub:  mailto:[email protected]
    **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to