Alpha Video Training
Results 1 to 9 of 9

Thread: No set Field Rules

  1. #1
    Member
    Real Name
    Dick Anderson
    Join Date
    May 2006
    Location
    Milwaukee, WI
    Posts
    100

    Default No set Field Rules

    I created a complex application in 1993 using Alpha Four (A4). Because of A4’s field rules for sets I was able to produce the application quickly without programming. I did have to write a lot of expressions.

    Now I’m trying to reproduce the application using Alpha Five (A5) without field rules for sets. I don’t know where to begin. I can design the tables, sets and forms; write expressions for a database that would work fine but the data entry is clunky. Let me explain.

    I have a Work Order entry form with parent table Work Order and three linked child tables, Shipping Customer, Billing Customer and Contact.

    When entering a new Billing Customer I would like to get default values from Shipping Customer which can be accepted or over type. Also before this Work Order record is saved I want to auto fill Billing_ID and Contact_ID to the appropriate fields in Shipping Customer to be default values for the next time this Shipping Customer is used.

    Once this Work Order is saved you should not be able to enter it except in the change mode where you can change the Shipping, Billing or Contact but you may not change Shipping, Billing or Contact particulars.

    In A4 I used default expressions and skip expressions at Set Field Rules to accomplish the above actions.

    Can anybody lead me in the right direction?

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

    Default

    Dick,

    In Alpha Five data entry occurs through tables, not sets. In your set based form you will need to enter the parent table record first.

    The default value field rule could be used in both shipping and billing tables to suggest an ID and Contact field values, using an expression that incorporates either the lookup() or lookupc() functions. These will automatically lookup a record, based on filtering criteria you supply, and return the field value you want.

    People have built amazingly sophisticated apps using Alpha Four. Often they come to Alpha Five and assume they should be able to replicate the entire app easily here. Typically the conversion of the A4 app is their very first A5 database. This is often a mistake. Windows is not DOS. Things work very differently here. I recommend you start small. Build a simple one table form and figure out how to control data entry through it. Learn how Alpha Five's default behaviors work. Learn how to alter them. Learn how to modify the properties of field objects in your form layout. Learn how the event driven paradigm (sp?) works. Learn how to open other forms, prepositioned to specific records. Learn how to open and run reports. Learn the difference in filtering the set first, and then calling the report based on the "currently selected records", and leaving the set unfiltered, but filtering the report at print time. I think your conversion will be much less frustrating and will have a higher probability of success if you wait to work on it until you are thoroughly familiar with how Alpha Five's design tools work.

    --tom

  3. #3
    Member
    Real Name
    Dick Anderson
    Join Date
    May 2006
    Location
    Milwaukee, WI
    Posts
    100

    Default

    Quote Originally Posted by Tom Cone Jr
    Dick,

    In Alpha Five data entry occurs through tables, not sets. In your set based form you will need to enter the parent table record first.

    The default value field rule could be used in both shipping and billing tables to suggest an ID and Contact field values, using an expression that incorporates either the lookup() or lookupc() functions. These will automatically lookup a record, based on filtering criteria you supply, and return the field value you want.

    People have built amazingly sophisticated apps using Alpha Four. Often they come to Alpha Five and assume they should be able to replicate the entire app easily here. Typically the conversion of the A4 app is their very first A5 database. This is often a mistake. Windows is not DOS. Things work very differently here. I recommend you start small. Build a simple one table form and figure out how to control data entry through it. Learn how Alpha Five's default behaviors work. Learn how to alter them. Learn how to modify the properties of field objects in your form layout. Learn how the event driven paradigm (sp?) works. Learn how to open other forms, prepositioned to specific records. Learn how to open and run reports. Learn the difference in filtering the set first, and then calling the report based on the "currently selected records", and leaving the set unfiltered, but filtering the report at print time. I think your conversion will be much less frustrating and will have a higher probability of success if you wait to work on it until you are thoroughly familiar with how Alpha Five's design tools work.

    --tom

    I used lookupc() in the field rules for default values. The expession gave me the right values but I didn't get anything in actual operation. The expression builder didn't offer the source table for looked up data so I typed in the table followed by a dash and the greater symbol (->). I know I'm not doing it right.

    Dick

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

    Default

    Dick, if you attach a working copy of the sample database you're working on, we can look over your shoulder and offer advice. If you opt to do this, please give us specific instructions to follow in order to see the problem, and a specific description of the behavior you're striving for. --- tom

  5. #5
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default

    Quote Originally Posted by Dick Anderson
    I used lookupc() in the field rules for default values.
    There is more than one type of default value (Simple and Conditional) so you would have to tell us which one you used. Also you can specify when the default value is set during actual entry so
    Quote Originally Posted by Dick Anderson
    I didn't get anything in actual operation.
    doesn't tell us much.
    Quote Originally Posted by Dick Anderson
    The expression builder didn't offer the source table for looked up data so I typed in the table followed by a dash and the greater symbol (->).
    Dick
    if you study the example of lookupc() in the documentation

    tn = table.filename_get("customer")
    lookupc("F", CUST_ID, "LAST_NAME", tn, "CUSTOMER_ID")

    you will notice that -> is not used in a table specification.

    At least show us the lookupc() expression you tried if you don't follow Tom's advice.

  6. #6
    Member
    Real Name
    Dick Anderson
    Join Date
    May 2006
    Location
    Milwaukee, WI
    Posts
    100

    Default

    Quote Originally Posted by Stan Mathews

    At least show us the lookupc() expression you tried if you don't follow Tom's advice.
    I entered this expression.

    Order.Set Field Rules
    B_Cust->B_NAME
    Data Entry
    Simple default expression
    LOOKUPC(“F”,ORDER->SHIP_ID,”S_NAME”,”S_CUST”,”Ship_Id”)
    Expression Builder
    Result: is O.K. record-to-record


    Alphafive created the following expression.

    B_Cust.dbf Field Rules
    B_Cust->B_NAME
    Data Entry
    Simple default expression
    LOOKUPC(“F”,Lookup(“Order”,“Bill_ID=“+chr(34)+BILL_ID+chr(34),
    “SHIP_ID“),”S_NAME”,”S_CUST”,”Ship_Id”)
    Expression Builder
    Result: is O.K. record-to-record

    If I am supposed to attach my application; I'll need detailed instructions on how to do that.

    Thank you

    Dick

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

    Default

    There are no "set" field rules. As mentioned earlier you must define them in the table. When you edit field rules from the set, you're really editing them in each table, separately. This means that in a child table the field rule editor does not know about the links to the parent table.

    Once your database is zipped you can attach it to a reply here. I use the quick reply link, and then click the "go advanced" button. This leads to a page where I can continue editing my message, while additonal options are presented below the text editor, including one to attach files (Manage Attachments).

    what files do I send is a common question. For beginners it's best to send everything. You may want to copy your database to a temporary folder, open it there, and then delete most of the data. Don't delete it all or we won't be able to use it easily. Remember that what you post here is public, so if privacy is an issue edit your data to remove or scramble things you would not want others to see.

    -- tom

  8. #8
    Member
    Real Name
    Dick Anderson
    Join Date
    May 2006
    Location
    Milwaukee, WI
    Posts
    100

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

    Default

    Dick,

    I took a look at your database. Here are some suggestions and ideas for you.

    1) Rename your set. Windows is very particular about names. It's important to use unique names for the different components of your database. Here you have both a table and a set with the same name.

    2) Your set consists of a parent table, and three child tables each of which has a one to one link to the parent. You're trying to establish default field values for the billing and contact children, using the Shipping table as source for a lookup() or lookupc() default field value expression. I recommend against this approach. Field rules should be developed that will work for the table regardless of the context in which records are being entered or edited. If you eventually succeed in developing your approach it will only work if data entry will ALWAYS occur through your set, and then only if the user supplies the Shipping record first. A better approach would be to remove the default value field rules, and put a button on your data entry form. The button would simply copy (assign) the shipping field values to the Billing fields. An example of this is found in the Customer Information form in the AlphaSports sample database (though it uses a checkbox instead of a button).

    I'll continue monitoring this thread to see if others different or better ideas for you.

    -- tom

Similar Threads

  1. Edit field rules in a set
    By Peter Wade-Graham in forum Alpha Five Version 6
    Replies: 4
    Last Post: 11-23-2005, 07:04 PM
  2. Set Field Rules?
    By DiFaz in forum Alpha Five Version 5
    Replies: 5
    Last Post: 01-08-2004, 06:17 PM
  3. Set field rules - calculated field
    By Danny Siu in forum Alpha Five Version 5
    Replies: 2
    Last Post: 03-25-2003, 04:56 PM
  4. how to set transaction field with field rules post
    By Dale Hartshorn in forum Alpha Four Version 6 and Prior
    Replies: 0
    Last Post: 08-10-2000, 08:40 AM
  5. Set Field Rules
    By james blair in forum Alpha Five Version 4
    Replies: 7
    Last Post: 07-24-2000, 07:40 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
  •