2 Replies Latest reply on May 21, 2014 11:20 AM by lordhellfire

    Forced to use another layout to assign a value to auto-enter related field

    Invectus

      Title

      Forced to use another layout to assign a value to auto-enter related field

      Post

      Hi there,

       

      Here's a brief background of my issue:

       

      I have an order entry layout where a user can also specify the type of payment the customer will be using. 

      The order entry layout populates its records from the ORDERS table and the "PAYMENTS::payment_type" field retrieves its data from the PAYMENTS table.

      The PAYMENTS table is related to the ORDERS table through the INVOICES table where the PAYMENTS table acts as a child to the INVOICES table.

      A record can be created on the payments table through the relationship. 

       

      The problem:

       

      When the user creates a new order and tries to specify the payment type from the "payment_type" field, the following message is displayed:

       

      "PAYMENTS::Payment_ID" is defined to require a value, but it is not available on this layout. Use another layout to assign a value to this field.

      The prompt gives the user the option of either reverting the field or telling the system to use another layout to assign a value to this field.

       

      I should note that the "PAYMENTS::Payment_ID" field in question is obviously the primary key of the PAYMENTS table and is defined as an auto-entry field.

       

      I understand that FM is having issues creating a related record in the PAYMENTS table and assign a payment ID.

       

      My question is: Why? 

       

      I never used to have this issue before and I'm wondering what's going on.

       

      Any help will be appreciated.

       

        • 1. Re: Forced to use another layout to assign a value to auto-enter related field
          philmodjunk
             if Payments:: Payment_ID is an auto-entered serial number, it shouldn't need any validation rules set in the field's options. Clear those validation settings and this message should no longer appear. (I suspect you'll find that you've clicked the "not empty" check box on the validation tab.) If it's not an auto-entered serial number it probably should be.
          • 2. Re: Forced to use another layout to assign a value to auto-enter related field
            lordhellfire

                 I just had this exact same issue.

                 I maintain a database for a client, where I recently split the database into a Layout file and a Data file, enabling easier updates to layouts, scripts and relationships without touching the already entered data.

                 During this process, I received a copy of the original "combined" database with new data that the client had worked on. This data was imported into my new split version.
                 This is where it must have gone wrong, as the client afterwards had trouble creating some records in a portal.

                 It gave the exact same error as you mention and the cause was that the ID field in the related record, which was created upon data entry in the portal, inserted a new autogenerated serial, but this number was an old (lower) number, than the newer ID's that were imported.

                 Thereby the same ID existed twice, which the validation scheme caught and threw that error.

                 The fix...

                 ...is to verify and set the autogenerated  "Next serial value" on the ID field as a number higher than the existing records highest ID, to ensure it is unique upon creation/commit.
                 The problem is that the error thrown does not specify that it is a validation error related to multiple identical ID's, which causes confusion as to what the error actually is.

                 It just seems like the ID field does not contain a value, even if the field validation is set to "Unique", which mine was. I had not set it to "Not Empty", but still got the same error as you did.