Sending multiple productID with URL (client-side) - reactjs

React-SPA (client-side-routing)
I have this scenerio .I have a table with many products. And a table have an ID column. When user select multiple ID for example : 023653,023654,023655,023656 (basically they can select as many as they want )
The product URL is : localhost:3000/products
When the user selects multiple products and they trigger the button for example: calculate products .
The user will endup in this URL : localhost:3000/products/023653&023654&023655&...
As you can image if user selects more than 10 items the url would be awfully long.
The reason I want to do it this way is I want the userA to be able to send their selected page to the userB for example (localhost:3000/products/023653&023654&023655&). And once the user B open this page they will see everything the userA can see. What is the ideal way to solve it ?
Thank you in advanced :)

Related

Get value of unknown keys

This is my firebase database structure in the image :
I'll explain the structure aswell,
I have a forum, which people can post trades in.
Every post has some random user key as you can see in the picture.
Also every post has a list of items which the user wants to sell or buy ('have' or 'want', in the image).
the number of items in each trade can change from 1 to 10.
I want to fetch all of the forum posts of the users that are selling ( or buying ) with some item id.
For example : Get forum posts of users selling items with 'Id' of 'Some Item Name'
How do I do this? I can't seem to get reference to each item in the inventory
since you can't do multiple orderByChild.
If you think it's impossible with this DB structure, Please offer me an alternative.
I want to know whether I'm wasting my time with firebase and this is impossible to do :(
Please note that I have a lot of data in my DB so I can't just filter the posts on the client side.
Either you can change your database structure OR You can create a different node which can contain the metadata of all the "have" OR "want" items with the itemID, userID and "have" or "want" node child number(in this case it should be 0-9, as there are 10 items in each type). So whenever you are saving/deleting you data from "have" or "want" section you have to do the same operation in the other new metadata table also.
You can run your query on this node to get the desired item and then with the help of result data you get those particular items directly by creating a reference at runtime as you are having userId, have or want type, itemId.
your metadata should be something like.
metadata
|
|
+{randonId1}
|
|-type : "have" or "want"
|-userId : "randonId of user".(Kt0QclmY3.as shown in picture)
|-Id: "Breakout Type-S"
|-childOnNode: 0, (0-9)
+{randonId2}
|
|-type : "have" or "want"
|-userId : "randonId of user".(Kt0R48Cp..as shown in picture)
|-Id: "Breakout"
|-childOnNode: 0, (0-9)

how to pre-fill some parts of an access form?

New here, so be gentle with me. - edited to simplify
I'm trying to set up something in Access where:
user selects driver name and date
query finds stops along the driver's route
form opens with route stops (location details) filled in and user can add additional information (item picked up, weight of item)
all information gets transferred to a "Pickups" table, which has data on what was picked up, the weight, where (route stop) and by whom (driver).
I have stores A through H, and three drivers, Bob, Tom, and Jill. Bob’s route is stores A,B,C,D. Tom’s route is stores A,C,G,H, and Jill’s route is stores D,E,F,G. (I can't give real names/locations - work is very strict about privacy issues!)
Behind these are “Driver” Table, with driver name, ID, and truck info; and “Store” Table, with store name (A-H), address, phone number, and contact person.
We’re collecting all of the information about items picked up at each store into a “Pickup” table, with Fields: Date, Driver, Store, WeightOfFurniture, WeightOfBooks, WeightOfClothes
The user starts with the driver’s name and date, clicks a button, and this opens a form with the following fields:
Driver, Date, Store, WeightOfFurniture, WeightOfBooks, WeightOfClothes
with driver and date filled in based on the initial entry, and “Store” having all listings for a given driver’s route. So I select Bob and a date (11-12) and get a form with:
Name Date Store WtFurn WtBooks WtClothes
Bob 11-12 A
Bob 11-12 B
Bob 11-12 C
Bob 11-12 D
I can get the above information from a query without any problem, but I can't figure out how to (partially) fill the form with the query results (there will be multiple query results for a given route, so DLookup is not useful).
I think recordsets might be a way to go, but not sure how to do this. I'm very new at VBA, but am learning (the hard way!).
Any suggestions?
Thanks!
Use an INSERT INTO action query to insert those records into your Pickup table.
I can get the above information from a query without any problem,
This query is the SELECT FROM part for the INSERT query.
Then open your Pickup form, filtered for Driver, Date and Store that you just inserted.

Salesforce - Email Template Usage

Is there a quick method of reporting the usage of individual email templates within Salesforce on a Visualforce page? The usage data is already calculated and posted on the individual email templates page. I just need a method to query that data and report the usage for each email template on a summary page.
thanks
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_emailtemplate.htm
TimesUsed: Number of times this template has been used.
SELECT Id, Name, Subject, IsActive, TemplateType, LastUsedDate, TimesUsed
FROM EmailTemplate
WHERE TimesUsed > 0
ORDER BY TimesUsed DESC
LIMIT 10
Try this out too
SELECT Folder.Name, SUM(TimesUsed)
FROM EmailTemplate
WHERE IsActive = true
GROUP BY ROLLUP(Folder.Name)
(there will be 2 rows with blank folder name. First one will correspond to "unfiled public templates", second one will be a grand total row created because the ROLLUP function was used)

How to get all records when using pagination

Let's say I set a limit of 10 per page on a set of records retrieved with $results = $this->paginate('ModelName'). The total number of records matching the paginate/find parameter is 30, so 10 records show up on each of the pages. When I look at $results, it contains only 10 records displayed on the page.
Is there a way to get all 30 records in the view without having to separately do something like $allResults = find('all', $params) followed by $this->set('everything', $allResults)?
I ended up passing some of the pagination parameters that can be used to retrieved all of the 30 records from the view via a form to an action.
So, the user clicks on a form on the view that submits hidden variables to an action, where the whole set of 30 records are retrieved and desired operation is performed. Then, the page is redirected to the previously paginated view.

Update DB MVC 3 using RadioButton values

In my MVC 3 project, I am looking to select a row in a table displaying values from a database, choose a radio button representing a value and press "Confirm". I then want a row to be added to a ClientPayments table with the payment amount as the radio button value (and the other values in the other columns of ClientPayments). I also want the status in an Invoices table to change to "Confirmed".
Here's a link to a screenshot to illustrate what I want to do.
I have all the models and the views created, but I am not sure how to select the row and use the radio buttons to update the DB.
This is one of the radio buttons I have coded:
Private Lesson (1 Hour) #Html.RadioButton("InvoiceAmount", "640", true)
Any assistance would be greatly appreciated.
If you have something like #Html.RadioButton("InvoiceAmount", LineId, true) (where LineId is the key value from model) then you will get the selected row in your Post action. From there you can either add it to your client payment object, and do whatever else you need to do!

Resources