1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

Input Only Sub Form

Discussion in 'Community' started by eugenecjr, Sep 23, 2022.

  1. eugenecjr

    eugenecjr Member

    Level: Community
    I am trying to setup a form with a sub from where the only purpose of the sub is to input data without showing any of the previous records.

    The idea is to show a list of items that you want to get current counts for. For each item the user opens the record and in a subform enter the counts. The sub forms record will default to the current date and based on the location I have it setup to pre-populate the store. I simply want the the end user to enter a count for the item.

    The data that is collected which is counts for items at various locations is used to populate a table for a manager to order items to be shipped to the appropriate location and set the status of that same record to ordered.
     
  2. lousyfool

    lousyfool Well-Known Member

    Level: Community
    Thanks for the report.
    What do you have so far? And what is your question?
     
  3. eugenecjr

    eugenecjr Member

    Level: Community
    lousyfool.

    How can a form be setup with a subform that only allows the creation a new records and does not show any of the previously entered records?

    What I have is a form that has a sub form that shows all the records of the sub form. Because the users entering the data are just putting in current counts I am looking to achieve the following:
    1. Not show previous records as these records are for multiple locations and will impact the performance of the form.
    2. Not show the previous records due to the fact that some people are so lazy that they will just take the previous number and enter something close instead of actually counting the number they have for that item.
    3. As mentioned in 1 make it as simple as possible so the form loads and saves faster.
    -Eugene
     
  4. lousyfool

    lousyfool Well-Known Member

    Level: Community
    TBH, not at all sure what you are trying to do. Also not understanding your terminology.

    In Fabrik, a form is for addition or edition of a single record (a.k.a. "row").
    - What do you refer to as "subform"? AFAIK this term is neither defined nor used in Fabrik and, hence, unclear.
    - How/where do you see other, "previously entered records" (plural!) in a Fabrik add/edit form?

    Perhaps a link with some more specific pointers or at least some screenshot(s) with annotations would help.
    Until then, at least for me the question of what you have so far remains open, sorry.

    EDIT:
    I see you added "[Solved]" to the thread title. Well, glad to hear, case closed then. :)
     
    Last edited: Sep 23, 2022
  5. eugenecjr

    eugenecjr Member

    Level: Community
    Lousyfool,

    I was actually solving another thread and must have got my wire crossed. This is not solved. I will correct my mistake when I get back to a computer.

    -Eugene


    Sent from my iPhone using Tapatalk
     
  6. eugenecjr

    eugenecjr Member

    Level: Community
    Lousyfool,

    Slightly confused by not knowing what is meant by subform. Searching the forum shows many post using the term.

    Would it be more clear for me to call it a joined table with repeat enabled resulting in what appears to be a form linked to another form allowing repeat records ie subform?

    What we are doing is looking for the current count of the items. We have a table filled with inventory items. Joined to this table and setup to repeat is another table that houses the counts by day. Each item is assigned a specific day of the week ie. Monday, Tuesday, etc…. So let say I have 100 items. I split them up over 7 days a week so that they only have to count 100/7 items each day. Effectively giving me weekly inventory. Each item is assigned a reorder count, ie. 10. I have created a table where users can see items for that day if the week that have not had a count added for their location. All is working as expected. When they open the item they then enter as part of the joined repeat record the count for that item. I have it setup so they have a drop-down to specific the location they are entering the count for. Kings that were previously entered are never edited as they are historical inventory information so no need to be visible.

    I will then crest another table, outside if Fabrik, where I will present to the operations manager a list of items where the count entered is less then the reorder count showing the location. This is a list of items that need to be ordered.

    As I have typed this out I am seeing a flaw in what I am looking to do as the users entering the count don’t need to see any history and only need to add their counts but the person that is ordering needs to open the record as to mark the item as ordered (a status field) that is null (not visible) for the person entering the counts. So the person ordering only needs to see the most recent record. In the joined table. With that being the case it seems I may have to create two list based on the same tables to allow one to only add new records for the users and a different list for the manager to open and see the most recent record so they can updated the status once the item is ordered.

    I hope this helps explain what I am trying to do.

    -Eugene
     
  7. lousyfool

    lousyfool Well-Known Member

    Level: Community
    Yeah, while I'm still having difficulties visualizing your exact use case, it seems you might be off best by copying a list, then applying different pre-filters or so.

    Of course, it helps hugely if here we keep using the Fabrik lingo as per Wiki. ;)
    Seems you mean, in Fabrik terms, group (of elements) and, in your case, repeat group.

    Just for the record: across the forum, indeed the term "subform" shows up several times (mostly in your posts, haha), but different users seem to mean different things. And so, what it means either only becomes clear from the context, or one needs to ask/verify.
     
  8. eugenecjr

    eugenecjr Member

    Level: Community
    Lousyfool, I do agree that the same term may be seen differently by different people. I will review the wiki for consistent lingo.

    I am chasing down the use of two list. I have written a statement that gives me the results I am looking for but not sure how to incorporate this into fabrik.

    Code (Text):
    SELECT * FROM fab_inventory_items a
    LEFT JOIN fab_inventory_items_counts b on a.id = b.parent_id and DATE(b.date) = DATE(NOW())
    Obviously setting up the join is pretty straight forward but how to incorporate 'and DATE(b.date) = DATE(NOW()). Showing all records in fab_inventory_items and any records joined with CURRENT_DATE.
     
  9. lousyfool

    lousyfool Well-Known Member

    Level: Community
    First, surely you mean something like "... WHERE b.date = NOW()". However, this condition will likely also not be what you want as it would only give you records where b.date is the exact same date & time as "right now"... both down to the second... in other words, almost guaranteed at all times an empty list. So, you'll want to refine the condition, also depending on the format of the date column, eventually use a different comparison symbol, etc.

    As already indicated, in Fabrik you may copy the existing list or create a new one for the fab_inventory_items table, then create a list join with fab_inventory_items_counts, and finally set a pre-filter equivalent to the correct "date" condition as needed.
     
    Last edited: Sep 25, 2022
  10. eugenecjr

    eugenecjr Member

    Level: Community
    Made adjustments to the query after making a copy of the list and have been able to get the results I was looking for.


    Sent from my iPhone using Tapatalk
     

Share This Page