Alpha Video Training
Results 1 to 6 of 6

Thread: V8 calc field rule error

  1. #1
    Member
    Real Name
    joseph mar
    Join Date
    Apr 2005
    Posts
    50

    Default V8 calc field rule error

    Hi Folks,

    I changed the field rule in the Alphasports Invoice set for the ITEMS->EXTENSION field.

    The expression that I use is:

    IF( LEFT(CUSTOMER_ID,1)="8", ITEMS->QUANTITY * ITEMS->PRICE, ITEMS->QUANTITY * PRODUCT->COST)

    It displays as RESULT: 15.75

    But, when I click on the OK button, I get the following error: "No such field"

    Has anyone else encountered the same error? Please let me know.

    Thank You.

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

    Default Re: V8 calc field rule error

    Alpha Five does not use set based field rules. Your rule must make sense within the context of the invoice_items table alone. The cost field value from the product table is not found within the items table so the expression fails. You'll need to use one of the lookup() expressions to retrieve the cost for the correct product.

  3. #3
    Member
    Real Name
    joseph mar
    Join Date
    Apr 2005
    Posts
    50

    Default Re: V8 calc field rule error

    Thank You for your quick response. I shall try your suggestion.

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

    Default Re: V8 calc field rule error

    Quote Originally Posted by Joseph Mar View Post
    Hi Folks,

    I changed the field rule in the Alphasports Invoice set for the ITEMS->EXTENSION field.

    The expression that I use is:

    IF( LEFT(CUSTOMER_ID,1)="8", ITEMS->QUANTITY * ITEMS->PRICE, ITEMS->QUANTITY * PRODUCT->COST)

    It displays as RESULT: 15.75

    But, when I click on the OK button, I get the following error: "No such field"

    Has anyone else encountered the same error? Please let me know.

    Thank You.
    The following in the main part duplicates Tom's response while I was composing.

    Firstly, the field rule for the invoice_items, item_extension field does not "live" in the invoice set although you can access it there as a convenience. It really exists solely in the invoice items table data dictionary.

    As such you cannot refer to other tables in the set without using functions that independently gather data from other tables such as lookup(), table.external_record_content_get(), etc.

    You could create the indicated expression as a calculated field for the invoice form because the form does know about the other tables and their fields since the form is based on the set.

    IOW there are no set field rules, only table field rules, and table field rules do not implicitly gather data from other tables.
    Last edited by Stan Mathews; 10-18-2007 at 02:00 PM. Reason: took too long explaining and Tom was quicker

  5. #5
    Member
    Real Name
    joseph mar
    Join Date
    Apr 2005
    Posts
    50

    Default Re: V8 calc field rule error

    Thank you for your response. I shall try your suggestion.

  6. #6
    Member
    Real Name
    joseph mar
    Join Date
    Apr 2005
    Posts
    50

    Default Re: V8 calc field rule error

    Quote Originally Posted by Tom Cone Jr View Post
    Alpha Five does not use set based field rules. Your rule must make sense within the context of the invoice_items table alone. The cost field value from the product table is not found within the items table so the expression fails. You'll need to use one of the lookup() expressions to retrieve the cost for the correct product.
    I tried your suggestion and used the LOOKUPN() function and the field ruled worked perfectly.

    Thank you again for providing the correct solution to my problem.

Similar Threads

  1. Problem Using Case Function in Field Rule Calc
    By MikeWeber in forum Alpha Five Version 4
    Replies: 1
    Last Post: 01-02-2007, 01:52 PM
  2. field rule error
    By ralphwilson in forum Alpha Four Version 6 and Prior
    Replies: 3
    Last Post: 04-21-2005, 10:41 AM
  3. Calc too big for Field rule???
    By Themis Skiathitis in forum Alpha Five Version 4
    Replies: 3
    Last Post: 06-29-2003, 11:57 PM
  4. Field Rule Error
    By John Wood in forum Alpha Five Version 4
    Replies: 2
    Last Post: 10-01-2000, 11:25 AM
  5. V5 calc field rule wish...
    By Michael Humby in forum Alpha Five Version 4
    Replies: 2
    Last Post: 06-10-2000, 11:22 AM

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
  •