1 Reply Latest reply on Mar 11, 2012 8:20 AM by philmodjunk

    if Inventory ID number not already associated with this record Boolean statement

    ericjlindholm

      Title

      if Inventory ID number not already associated with this record Boolean statement

      Your post

      I need a boolean statement that will trigger if an inventory item I am trying to add to an invoice via a line item has already been added.  I want to force a user to increase the qty and not add the same line item again.  Thank you

        • 1. Re: if Inventory ID number not already associated with this record Boolean statement
          philmodjunk

          You've posted this request in the FM Server forum. Seems like it should have been posted in FM Pro Forum (See tab at top of this screen).

          Presumably you have a relationship that matches Invoice to LineItem by an InvoiceID field and each line item to different Inventory records by an InventoryID field (though maybe with a different field names). If so, you can define a new field, CombinedIDs and set it up with this auto-entered calculation: InvoiceID & " " & InventoryID. Now specify a Unique Values validation rule for this new field. Each time a user selects the same item in the same portal, this field's validation rule will trigger an error message. (And you can specify a custom validation message to tell them what went wrong.)

          This is the simplest option for precluding duplicate selections in a join table. (A lineitems table is probably the most commonly used join table in the most commonly used many to many relationship found in database solutions.) There are more sophisticated approaches that can be used that prevent duplicate selections by making it impossible for the user to make such selections. This demo file illustrates two such methods:  http://www.4shared.com/file/dZ0bjclw/ManyToManywDemoWExtras.html