How to link/nest 2 dropdowns in a form in Adalo - dropdown

I have 2 collections:
collection 1 is called “Category” with almost 10 records.
collection 2 is called “Subcategory” with almost 100 records.
these 2 collections are currently linked.
I have a form that allow user to create a profile, the form has 2 drop downs, one for Category and one for sub-category.
i want when user pick a category from the first dropdown, it only shows the relevant sub-category of that item in the second drop down. at the moment both drop downs show full list and there’s no way i can filter either of them.
the select filter for subcategory drop down doesn’t give me an option to filter that based on the content of category dropdown:
i chose other component but it takes you the chain of pages with no end

Related

MS Access 2016: Avoiding entering the same data multiple times

one of my table keeps track of assets that has been assigned to different customers. For example, I have a field named "Location" which is a list of devices and a field name "Customer"
The 1st 2 or 3 letters of "Location" is unique to the Customer's name, for example let's say the customer name is "All About Customers", my Location will be AAC001, AAC002, etc. The sequence continues indefinitely.
When adding records, I would type AAC010, AAC011, AAC012, etc. and then I would have to select from a drop down box which customer these belongs to, if I'm adding 40 records, I'd have to select the same customer 40 times.
Is there away to let access know which Customer I'm preferring to based on the 1st 2 or 3 letters of my location?
Not gonna talk about the flaws in this approach in terms of database modelling and rules etc.
But to do some vba code, you just have to define the OnChange event of the desired control e.g. TextBox
Whenever there is a character entered you could execute code.
(in example it would happen only if text has 3 or more characters)
Public Sub OnChange()
If Len(Textbox) >= 3 Then
'Do Something
End If
end Sub
My time is limited right now, so I can only provide you with my approach and not the actual code:
I would create a separate table named Customers.
The table should have the two fields (test data in parentheses):
customer (All About Customer, The Store)
customerAbbreviation (AAC, TS)
On your form, there should be a macro fired after the update of the form's Location field.
The macro should have some type of code that separates the numbers and text in the Location field. Using All About Company as an example, the macro should return AAC and 001.
You could search the Customers table for the customer whose customerAbbreviation is AAC.
You could then set the form's Customer field to the All About Company, or whatever's returned in the above line.

Trying to create an APEX Link Column that queries a report

Basically, say I have a report A and I want to add a link column to it, and I set its target to a page in the application...the page its referring to has another report (lets call it B)
Is it possible for me to somehow make it so that table A's link column opens the page with Report B with rows that have the same column value for one of their columns?
Example here:
A
Name Num1 Num2
--------------
A 5 3
B 3 3
C 4 2
B
Name Quantity Serial
--------------------
D 2 3
E 1 8
F 4 6
So if I click the link column for row A, I want it to open report B and only shows rows where its Num2 = Serial, so only row D would show since it is the only one that equals 3
Using Report Linking to Filter Other APEX Report Outputs
I had some fun with this one although. The "A" and "B" stuff was pretty dry, so I decided to create a data set that was more engaging, and perhaps clearer to understand for the rest of us... :) This is how the data-ecosystem was broken down, and the way I fulfilled the OP requirements.
The Test Schema:
Welcome to the manufacturing facilities of the "Recipe Stack" Food Works. The schema design and ERD (Entity Relation Diagram) is below, with the sample data used for this demonstration:
The data relations are as follows:
The staff at the Stack Food-Works keeps an inventory of all ingredients for the types of meals and prepared foods they manufacture. Each ingredient has a unique ID (INGREDIENT_ID) and the staff tracks the amounts of each item in their pantry.
Each ingredient can be used in multiple recipes, but they will be used exactly once for a given recipe.
The ENTREE_RECIPE table has a COMPOSITE KEY which means it is the combination of the two pieces of this composite key (ENTREE_NAME and INGREDIENT_SEQ) that should be unique.
There is a FOREIGN KEY relation between the INGREDIENT_ID values of both tables.
Report Display Requirements (APEX and SQL Design Elements)
Selecting an item from the FIRST report is used as the input and the restriction/filter criteria of the second report.
User Case #1:
User Selects a Ingredient ID from the list of available ingredients in the pantry.
Input from (1) filters output of the RECIPE REPORT. This is a list of all the recipes that have the chosen ingredient in their formula.
User Case #2:
User Selects an ENTREE_NAME from the RECIPE REPORT. The ENTREE_NAME is used to deliver a third report: the RECIPE FORMULA which is the full recipe for the entree item that was selected from the previous report.
Testing Tools
(You usually need these these for the more complex pages, so it's a good start to use or develop them for the easier ones...)
I made my own, but you can also invoke the SESSION link on the developer's tool bar at the bottom of the APEX page on your running application (when it is displayed).
Here's my idea; it's a header region that also has a button to RESET input values so that I can clear the cache and retest or try other examples. I'll show later how you can use this link to see what is going on. You can see it in the discussion of testing at the bottom of this guide.
APEX Report/Page Design and SQL Parametrization
My columnn linking scheme looks similar to the previous post such as the one from FTaveras. This is how my linking works. What's different is that I do not go to another page, I simply go BACK to the same page I came from. Redirects and Branches apparently don't care if they are simply returning to the same location.
What is different on the return trip is that page parameters that were originally null or unpopulated NOW have a value. That value now brings life to the reports on the page that were empty.
Step 1: The PANTRY REPORT
Output: Query all items from the FOOD_SUPPLIES table.
Inputs: Supply links by INGREDIENT_ID to filter the RECIPE_REPORT output.
How to do it: (hint) To accomplish this, define the report column/field value in your report layout design page as a "linked" column and assign its value as a page item. The page item will be referenced in the SQL query of the next report...
Step 2: The RECIPE REPORT
Output: Query all records from the ENTREE_RECIPE table which have the INGREDIENT_ID from Step 1 within their formula.
Input: Supply links by ENTREE_NAME to filter the RECIPE_FORMULA output.
How to do it: (hint) Include the page item defined from Step 1 within the SQL query of this report:
SELECT * FROM entree_recipe
WHERE ingredient_id = :P3_INGREDIENT_ID
Step 3: The FORMULA REPORT
Output: Query all records from the ENTREE_RECIPE table which have the ENTREE_NAME selected from Step 2.
Debug and Test Run
Most will be able to get this far without any problems. If not, here are a couple of examples of how you can debug and test your work. There may be some built-in tools and packages that already exist within Apex, so any suggestions on alternate approaches are welcome in the comments...!
Using the APEX Developer SESSION Output
After selecting the inputs for the trial run, click on the SESSION link on the developer toolbar at the bottom of the page. This is an example output:
Note that the page items that were set for that session are displayed. The inputs I used for this test were:
INGREDIENT_ID: 6432
ENTREE_NAME: peach cobbler (fresh)
Extra Credit: This one is an alternate approach. It may be useful to design something like this as an add-on to any app you design. You do not need to remove it from your app when you push it to production because there is a "conditional display/suppress" feature for page regions. (check it out)
Simply set a global parameter as a "mode" on your Apex app. Set the value to "DEBUG" or "TEST" or whatever and key all your instances of this page region to display only when the global parameter is set to it.
Wrap Up and Discussion
Hopefully, you've enjoyed your visit to the "Stack Food Works" (no tasting or sampling from the line, please).
This has been more of a holistic approach to Apex app design. It helps to have a methodology to map out each step, and a way to check your work at both the beginning and the end of your development process. Using smaller examples like this demo to apply these methods provides a chance to understand Apex development as a Software Creation PROCESS.
Yes it's possible.
On page B, add and hidden Item name for example P(#)_SERIAL where (#) is your current page number.
Modify your query and add one line like AND SERIAL=:P(#)_SERIAL.
On Page A go to "Report Attributes" tab on the report region, click edit.
On the column link section configure your link to page B and set the hidden item on page B to the value on report column of page A.
Name: Item 1 [P(#)_SERIAL] Value: #Num2#
Demo

SSRS Select All Causes URL to Exceed Max Length

I have about 250 items with IDs about 6-7 characters long. I have them organized into 3 classes with about 8 sub classes in each class. When using the report, users will have the ability to use cascading drop down lists to filter the list of items. However, when the report initially loads, the users want all items to be visible.
The report parameters are being passed via a URL to a web service that will retrieve data for me.
I have set up the items report parameter as a multiselect, but I have manually added the value "All" as the default parameter and have included "All" as a option in the list of resources using the following query:
SELECT 'All' as ItemID
UNION
SELECT itemID as ItemID
FROM (SELECT DISTINCT itemID
FROM itemMaster
WHERE (itemSubClass IN (#itemSubClass)) and itemClass IN (#itemClass))
ORDER BY itemID) as derivedtbl_1
When my program logic detects 'All' as a parameter for items it does not filter any items and sends the full list to the report.
There are a few problems I have with this set up
The 'All' Selection appears buried in my list of items. i.e. (Select All) is first, followed by the numerical items, followed by 'All', followed by alphabetic items.
The (Select All) item still appears in the list because it is a multiselect parameter ad if the user selects it, all 250 items are selected and I receive the max URL characters error.
So, is there an easy way to allow for multiselecting items from that items list (within reason i.e. 10 max which would keep me under the URL error), disabling the (Select All) option, and moving my custom 'All' option to the top of the list in its place?
I think you can get rid of ALL. You need to manipulate the behavior of "SELECT ALL" to behave like ALL i.e. no filters applied in your URL. The way you can do is count the rows in your dataset and compare it with parameter count selection.
Something like:
=iif(Parameters!ItemID.Count=CountRows("ItemIDDataset"),"ALL",JOIN(Parameters!ItemID.Value, ", "))
Make sure when doing count comparison based on if you have removed "ALL" option.
Here are some helpful articles explain this scenario.
http://www.mssqltips.com/sqlservertip/2844/working-with-multiselect-parameters-for-ssrs-reports/
http://dataqueen.unlimitedviz.com/2011/06/how-to-default-to-all-in-an-ssrs-multi-select-parameter/
HTH

Access Main View data from ajax partial view

Situation:
Let say we have a list of products and each with a bunch of orders. I have a my index view that has this list of products contained in the model. I iterate over the list and display a list of products on the page. I add an jquery click event for each project, the click event loads a partial view for each order beneith the product list.
Order partial view would look like this:
#model Order
<p>#Model.orderNum</p>
#Html.DropDownListFor(Order.CustomerName,CustomerNameList)
<input type="submit"/>
Index view would look like this:
#model List<Products>
#foreach(Product p in #Model)
{<button class="product-button">#p.productId</button>}
<div id="orderDiv"/>
then I would execute the following javascript for every order for the product:
$("#orderDiv").append($("<div></div>).load("MyController/Order/[order ID would go here]"));
This would load an order with a seperate partial view for each order id the product had.
Problem:
The simple solution would be to have the CustomerNameList in the Order Model. However, I don't want to load that data to the page so many times. Is there a way I can put it in the ViewBag or store it somewhere else so this list is available to the whole page?
Notes:
I don't want to use one partial view for all of the orders (ie. have the order view model be a list and iterate over it in the partial view) because I want to be able to submit each order individually (to save it)
I also might need to use this list of Customers on some other part of my page. I would like to keep it available. For example maybe I have a button that says new order and this uses ajax to load a parital view and that partial view also needs the customer list. I don't want to send that data to the page so manye times.
Can I do this?
Is this just a bad way to do this?
Not too sure why you would want to load a dropdown list of users, for already, existing orders. That means you are wanting the facility to change WHO made the order?
However, if you must, you can load your customer dropdown list as an empty dropdown with a class of customer, you can then make an internal call to get the json for customer, and then load up all your instances of class customer, with the data from your json call of customer data.
This would allow you to have 50 orders listed, with one single collection of customers data.
personally though, you should have relationships with your models using foreign keys, or using a viewmodel that would already add in your customers list, you would also only wish to show full order details to a user, if they clicked on the row to show full details.
Even if someone goes mental on the screen and clicks all 50 to look at, you should still be able to handle these request without much trouble, otherwise and likewise you wont be able to have 50 customers all looking at there baskets at the same time, or 50 customers all searching the products database at once!

MS Access 2007 - Select multiple records and assign a value into a field

I am using a Multiple Items Form to list CASES (records) where there is no TECHNICIAN assigned (Maybe I should use a Datasheet to list the records?).
I would like the user to select a TECHNICIAN from a dropdown field that gets its values from an Employee Table (I can do this). Then I would like the user to select multiple CASES (records) in order to assign that one TECHNICIAN to the Technician field in all of the selected CASES.
Basically, I'm trying to keep the user from having to assign a technician from within each and every incoming case request. I want them to "batch" assign a tech to multiple cases.
Can someone point me in the right direction?
Ok so I did some more research. This may not be the best answer but it works for now.
I created a Multiple Item Form.
I added an unbound dropbox that lists Employees from the table
I added a button on the detail section (for each record) with the follow line of code:
Me.Technician = Me.Choose_Technician
Now the user can pick a technician from the dropdown and then click the button to assign that technician to the record/casefile.
This is a simple solution if you only have a couple of records/casefiles to assign. If the amount of incoming casefiles increases there will have to be a way to select multiple records using the shift key. I'll keep researching this.