Alpha Video Training
Results 1 to 6 of 6

Thread: Set Object Properties

  1. #1
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default Set Object Properties

    In Action Scripting, how do you set the text or value properties of a field object in 'another form or browse' ?

    The Action Scripting choices available in Build 1389.1027 don't seem to support it directly.

    Here's the scenario:

    Assume you have a set based form, composed of two tables, related through a 1:N link.

    Assume the designer does not want the user to enter new child table records through the embedded browse which displays child table records.

    So, she puts a button on the form and, using only Action Scripting, heads down this path:

    1) Stores the current link field value in a shared variable, in preparation for passing it to another form

    2) Opens a second form, based on the child table, but does so 'hiding' it - so that the key field can be populated before it's displayed on screen.

    3) Begins a new record in the hidden child table form.


    Ok. Here's the question. At this point, without using inline xbasic, how does she set the value or text of the key field in the hidden child table form?

    Thanks.

    -- tom

  2. #2
    Alan Anthony
    Guest

    Default RE: Set Object Properties

    Tom.... I am rather new to A5 but I think the app I'm working on does what you are asking. Go to the "Payee Main Menu" and then "Setup a New Payee".

    Hope this helps
    Alan

  3. #3
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,172

    Default RE: Set Object Properties

    Tom

    While this is much easier in xbasic, I found a little quirk in action scripting that will let you do this. When you go to action scripting to "Set value property of a field", you have the option of using a form other than the form for the button. However, the form you want action scripting to open hidden is not yet open. Solution - save your editing to this point, go back to the control panel and open the other form. Now go back to, the action scripting and you can select this form since it is now open. When done with action scripting, close the form.

    Jerry

  4. #4
    "Certified" Alphaholic
    Real Name
    Russ Boehle
    Join Date
    Mar 2000
    Location
    Connecticut
    Posts
    2,767

    Default RE: Set Object Properties

    Tom,
    Being rather weak in xbasic, I do this all the time using only action scripting. When you leave the parent, as Jerry said, save the field value to a variable.
    Then open the form for the child.

    Enter new record

    Set field values (the the previous variable in the linking key)

    I also sometimes hide the linking field (in field properties) if there is no reason for the user to see it or a the lease disable it so the user can't change it.

    Also this method allows me to show the user field values that are not on the open form but are useful. For instance I have vendor contact (people at the vendor) To enter a new one I pop up a form and fill in the linking value (vendno). The contact form doesn't have the vendor name because it is not needed there (normalization) but the employee might want to know what the customer name is so I also save the customer name to a variable before opening the contact form. When the contact form is open I can just show the variable value on the form along side the vendno and it is much more imformative.


    Russ

  5. #5
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Set Object Properties

    Jerry, thanks. Was just what the doctor ordered.

    -- tom

  6. #6
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: Set Object Properties

    Russ,

    Exactly. That's what I was attempting to do solely in Action Scripting, without resorting to Inline Xbasic anywhere along the way. Jerry's tip got me past the hurdle presented by the Set Text or Set Value action commands. They are limited to the current form, and you can't 'see' the form your script is opening... unless you follow Jerry's tip.

    -- tom

Similar Threads

  1. Object Properties not in effect on Shadow
    By mronck in forum Alpha Five Version 6
    Replies: 0
    Last Post: 04-06-2005, 02:07 AM
  2. Tabbed Object vs. Conditional Object
    By Tom Cone Jr in forum Alpha Five Version 6
    Replies: 26
    Last Post: 02-28-2005, 10:23 AM
  3. Form Object Properties Problems
    By David Priest in forum Alpha Five Version 5
    Replies: 2
    Last Post: 07-04-2003, 03:07 PM
  4. Frame object properties
    By Doug Hawkins in forum Alpha Five Version 5
    Replies: 4
    Last Post: 02-27-2003, 12:58 PM
  5. Object properties?
    By Jeff Moses in forum Alpha Five Version 5
    Replies: 6
    Last Post: 07-26-2002, 03:11 PM

Bookmarks

Posting Permissions

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