1 Reply Latest reply on Jun 24, 2014 2:25 PM by dklein@tgroupmail.com

    Item Checkout via portals and multiple users

    dklein@tgroupmail.com

      Title

      Item Checkout via portals and multiple users

      Post

           Hi All,

           I've currently got an asset/employee tracking database built that allows a user to checkout multiple items to a single employee at one time, get their signature, and mark the items as "checked out".

           There are two tables, and employee table and an asset table. If a user has to check out multiple times, they goto a layout based on the employee table that shows the details for that employee, including a portal of what items they have checked out.

           There's also two other portals on this layout; an AssetsAvailableForCheckout (a Table Occurrence of the Asset Table, where the relationship is defined by _kp_Employee_UID ≠ _kf_Employee_UID, a CheckOutSelected Variable being false, and an Available status being true); and an AssetsSelectedForCheckOut (a second Table Occurrence of the Asset Table, where the relationship is defined by _kp_Employee_UID ≠ _kf_Employee_UID and the CheckOutSelected field being true). 

           Basically, when a user is checking out assets, they select a checkmark next to the item (the CheckOutSelected field)  in the AssetsAvailableForCheckout portal and then that item is moved to the AssetsSelectedForCheckOut. A Done button is pressed triggering a script that then runs through each record in the AssetsSelectedForCheckout relationship and sets the appropriate values for those assets to show it's now checked out.

           This all works well and good when you have only one user checking items out at a time, however, it falls apart very fast if you have 2 or more users checking out, as when they select the CheckOutSelected field for their items, both users will see both sets of assets appearing on their layouts in the AssetsSelectedForCheckout portal. 

           Ideally, I'd like to be able to set the CheckOutSelected field to be a temporary storage variable that is dependent on the user currently logged in. Is there any way to do this? 

           If I make CheckOutSelected a Global field, then every item is always checked out as it's one value for every asset. 

           Does any one have any suggestions short of redesigning the whole database? Thanks for all your help!

        • 1. Re: Item Checkout via portals and multiple users
          dklein@tgroupmail.com

               I ended up developing a solution. Basically, I created a "_kf_employee_UID_Temp" field on the Asset's table that auto fills with "". Now, when a checkmark is selected, I have it run a script on modify that sets the _kf_employee_UID_Temp to the actual Employee UID that you're currently checking out to. The relationship now requires both the _kf_employee_UID_Temp to match the Employee UID and the CheckOutSelected Field to be true for items to appear in the portal and be modifiable by the check out scripts.

               Thanks!