How to implement Dependent dropdown for postal code and city in drupal8? - drupal-8

We have a form in that we need two postcode and two city. I have created as entity reference field (Taxonomy). Created a taxonomy as with hierarchical order postcode as first level and cities mapped under postcode. I have totally 18k terms in single taxonomy. when i try to access the page i am getting Memory Limit error. In which i need to implement dependent dropdown. based on postcode selection cities need to be populated in city drop down field. Used Heirrchical select module. which is not suppported for large taxonomy. Any help.

You can do it by creating AJAX callback functions on form

Related

Basic List on Entity Form

In Dynamics CRM online, I can add a list of entities to another entity, for example a list of products to an opportunity.
Is there any way I can have a list that is not picked from pre-populated items, e.g. just a simple list of {number, date, text} that you type in each time you want to add to the list, not picking items from a pre-defined list.
I am just using the web interface to customise at the moment, but I am open to any suggestions.
EDIT:
So far i have;
Created two entities, proposal and proposal version
Added a 1:N relationship between proposal and proposal version
Added a sub-grid to the proposal form, tried to make it editable but it refuses to work
This lets me add new rows by opening up the proposal version form and adding a new one or picking from already created ones for other proposals but that is rather clunky for a simple list.
I don't want it to offer to search for previous entries, just let me add to the list by typing stuff in, surely this should be fairly simple?
If you want a pre-defined list of items that are simple (number, date, text..) then you can create an option set field in CRM. These lists are fixed and can only be extended by customising the system. An example option set field might be Organisation Type:
Prospect
Site
Head Office
...
If you want a pre-defined list that can be extended, you need to create a new entity. Following from the previous example, you would create a custom entity called Organisation Type and then create a record for each type you wanted, populating only the name field with the type: Prospect, Site etc.
Then you would add a lookup field pointing to the Organisation Type entity on any other entity that used the field, such as Organisation (Account).
You see how the custom entity still appears as simple data because you're only populating the name field, which can be text, a number etc. You can also apply security roles to this entity, limiting which users can create and delete options from your list.
Edit: to only allow the creation of new records in a subgrid, make sure the lookup attribute to the parent entity on the child entity is business required.

Order Attributes for HeirarchicalRequirement's in RallyDev API v2.0

Using a TypeDefinition Query:
https://rally1.rallydev.com/slm/webservice/v2.0/typedefinition/?fetch=ObjectID&pagesize=100&pretty=true
I can grab the Object ID for Hierarchical Requirements definition.
Using that ID I can get all the attributes (inputs) for Hierarchical Requirement's (User Stories).
https://rally1.rallydev.com/slm/webservice/v2.0/TypeDefinition/[DefObjectID]/Attributes?pagesize=100&order=ObjectID&pretty=true
However I wondering how I can order this list in the order it is displayed in the "Create User Story" screen in RallyDev?
I don't believe there is a way to do this- there is no "category" field with which to group the fields. Those editors are manually configured to logically group fields together. You could fairly easily group some of them together based on whether they are required or custom, but other than that you'll have to manually arrange them...
Not exactly sure what you mean by "Create User Story" screen. The default view for "Plan -> User Stories" shows in Rank order. If that's what you are looking for then the order would just be:
order=Rank

DB Structure for a shopping cart

I like to develop a shopping cart website with multiple products.
(ex.: mobile phone, furniture etc.,)
here mobile phone specification will cover
size of display
memory
operating system
camera etc.,
but for furniture - its specification is entirely different from above electronic product.
type of wood
color
weight
shape
glass or mat finish etc.,
My question is: how to handle a common database-table for product specification ?
each & every category of product & its spec will be differ - so how to have a common
table ProductSpecificationTable ?
I searched many site including google.. but cant able to get the perfect soultion.
Please help me to move to next step.
Ask yourself the question: How can I accomplish this kind of database? First of all you need products.. Every product has to be in some kind of category and every category has to have his own properties. So, you've to create a product table with unique id and every product needs a category id. At this moment it is time to link from your property table to your category table(by id) and to set the values you need a 'property_value' table.
**table:** **id**
product --> category id
property --> category_id
property_value --> property_id
I hope you will understand my explanation otherwise just ask :)
You can add 1 more table to accomplish that. Table that contains cat_id, product_id and the property. That is a many to many relationship. I believe this way you can accomplish thst.
You can achieve this with a single table within a database but that will complicate the CRUD operations over the table. So I will recommend you to create one database like ‘Inventory’ which can have multiple tables (one table for each of the Product Type).
First Table could be list of Product Types you have (mobile phones, accessories, furniture):
You can use this table to populate your list of items available. Here the column _table_name will contain the actual name of the Tables.
Then for each of the product you can have different tables with different number of columns:
Table for Product Type Mobile Phones:
Table for Product Type Furniture:
I hope this will help.

Adding a custom property dependent on another in Umbraco

The request
I want to add Members to their department in our Company, but our company has more offices and each office its own departments, so we need to organize that first and then try to assign each Member to its department so that they only have permissions to access their own department.
Departments overview as Umbraco Content:
Root Node
-Office 1
-- Department1.1
-- Department1.2
-Office 2
-- Department 2.1
-Office 3
-- Department 3.1
-- Department 3.2
-- Department 3.3
Now, if I add a User, I want one property to select the office and another to select the department.
Possible solutions
Checking here and there, I've seen I can make the Office property using the UltimatePicker type in Umbraco creating a custom data-type linked to a parent node and then a property inside my MemberType. That will display the offices under "Root Node" and link the member to one of them.
Now, to make the department property I've seen there could be some way using a custom manually-coded property, adding a usercontrol and using it to display the office children dynamically (I've not tried it yet, I'm theorizing).
But I am worried that the second property will be dependent on the first one, and when I've tried to create my custom property implementing umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor in my usercontrol it only allows me to save one value, not two of them. Which has sense as this is supposed to be A property, and not a bunch of them.
My question
Now, what's the best way to have those 2 custom properties and also make sure that in case I change the office the department will be also refreshed?
Best crazy idea at the moment
Up to this moment, I can only imagine creating 2 usercontrols, one for each property, and manually clean the department each time the office is updated, though I don't know if this is possible (Can I really get departments dynamically? Can I clean the dep. property FROM office property usercontrol?) and I would prefer to have them together as to simplify the codes.
If the relationship is key and you need to prevent a user from accidentally choosing a department that doesn't belong to an office, then you could create a single usercontrol that contains two drop-down menus. The first menu displays the offices and the second is only populated (preferably by an ajax call) once an office selection has been made.
The code for retrieving the offices and departments would be relatively straightforward using the umbraco api.
The usercontrol could then save the id's of each to xml or a comma delimited list.
Alternatively, you could just allow the user to select a department and the office is implied by the choice of department. You could use the uComponent's multi-nodepicker and filter the node selection to only the Department doc type. The overhead then is in the UI code where you have to work out the Office from the Department.
To get around this, you could have a label property that simply stores the ID of the Department's Office. The Office ID could then be saved using an OnSave event handler.

Best practice for many-to-many relationship between content tree items?

In my content tree, I have a tree of content items which represent cities. For each of those I want to have logical connections to a set of... let's say... National Parks that are within 2 hours driving distance. So a city will have multiple parks... and each set will be different... but of course a park will also be associated with more than one city.
What kind of Item and field setup works well for this sort of situation? I will be creating a custom renderer for these items, so I'm mostly concerned with how this should look in Sitecore to maximize ease of use and performance.
I'm using Sitecore 6.2.
(cross-posting from SDN, please forgive me... but I want to encourage more Sitecore community here on StackOverflow)
For this kind of relationship you'll need the following structure:
Home
Cities
NY
London
Paris
Parks
Park1
Park2
Park3
The "City" template should have the Multilist type field called "Parks". The soulrce of this field should look to the root of Parks (Home > Parks). The same way the "Park" template has the Multilist field called "Cities". The source of this field should look to the root of Cities (Home > Cities).
In this way you'll be easily able to perform any kind of request.
Hope this helps.
If the connection has to be both ways one way you could handle it is by adding some code to the save event.
Let's assume we have a City template with a field called "Related Parks", and a Park template with a "Related Cities" field.
Say we save a City item with two parks in the "Related Parks" field. On the save event we could retrieve the two parks and insert the current city being saved into the "Related Cities" field on those parks.
I am not necessarily saying this is the best way to go about it, just another option.
Are you going to be doing any lookups from park to city? For instance, would you need to say "find all the cities that are associated with a given park"? Or will it just be "find all the parks that are associated with a given city"? If you need to do the lookups in both directions, things get a little trickier and I would probably recommend using a search index. However, if your lookup is only in one direction, you could just use a treelist field to make associations from one item to many others.
From your description I'm not entirely sure if you actually need to use that many-to-many relationship, or if a one-to-many path is all you need?