Sitecore multi layered tagging - sitecore

I am working on some tagging infrastructure for my client. There is need to have tagging for the following - Regions, Countries, Cities and Office Locations.
Items in the content tree can be tagged for only region, country or city. But there also needs to exist relationship between the above tags as follows
Regions --> Countries --> Cities --> Office Locations.
The relationship between cities and office locations can be many to many.
I can pursue the above relationship by having 4 separate lists - one each for regions, countries, cities and offices.
Then I can follow two modes of tagging
EITHER
On the Office tag item, there can be a multilist field for a city tag and multiple cities could be selected that way for an office. Then the city tag can have a multilist field for selecting countries, and country tag can have a multilist for regions. The region item would not have any fields.
OR
A region tag can have a multilist field to select countries, a country tag can have a field to select cities, a city can have multilist field for offices, and offices won't have any fields.
Which method is preferable and why?
I do not want to do a hierarchical structure as that would not sit well with many to many relationship issue.
Thanks

If I understand your situation, it feels like the second (top-down) approach is the one you should go with.
I'd do it for a couple of reasons:
In your first option, you mention an Office would have a multilist for multiple cities. Would an Office location really have multiple cities? I would think that an office location should only have a single city associated with it, which would point me to the top-down approach.
The top-down approach just makes more sense logically. Look at the way you described your tagging relationship:
Regions --> Countries --> Cities --> Office Locations.
You're already describing it that way and I think it would make more sense to then architect it that way as well.

Related

How to assign multiple salesperson to customers?

This is a basic customer card:
As you can see there is a "Salesperson" linked to the customer, but in many situations customers can have multiple salespersons.
In this field I can only select one salesperson.
The problem created by this situation in the company is that sales people can't find customers that are not linked to them.
How can I assign multiple salesperson to customers?
If your salespeople are in fixed groups e.g. person A and B handle the same group of customers and C and D handle another group of customers, you could use the Responsibility Center feature.
Create a Responsibility Center for each group of customers and assign it to those customers. Then set the Sales Resp. Ctr. Filter on the User Setup for each Salesperson.
Using this field, obviously, you can't. You need to use some other field like department or customer group I don't know. Or if I remember correctly the was a table like ’My Customers’ where every user can build a list of customers he's interested in.

PowerBI conditional/advanced filtering - is it possible?

I have a large set of Equipment data that contains both geographical equipment location and company ownership data.
The geographical data has a hierarchy based on size (i.e. continent, country, county, city, street), so the filters for that data is easy.
The company data details which companies own which pieces of equipment, but it’s not directly related to geography, so multiple companies can own equipment on a single site. So I can filter by company name nicely.
As the data is common to both company and location, I’d like to combine in to one dashboard, but with two filters. I’d love to be able to filter by location OR filter by Company but ideally, I don’t want the users to try to use both filters at the same time. Is it possible to have some logic built in so that if a user selects a location filter, it clears any Company filters selected and vice versa so that if a user selects a company filter any location filters already selected are cleared.
Is this possible and if so, how would I go about it?
Thanks in advance,
Dofus
Using buttons and bookmarks you can clear filters and toggle the visibility of slicers.

How to load values related to selected multiple options in Django

Thank you all for always willing to help.
I have a Django app with countries and state choices fields. However, I have no idea whatsoever on how to load the related states for each country. What I mean here is, if I choose "Nigeria" in the list of countries, how can I make all Nigerian states to automatically load in the state choice field?
You have to create many to many field state table, then you can multiple select state as per country.
this feature available on django- country package or django- cities package.

Row level security in Power Bi

I am not able to implement row level security to my report. I have tried different methods on google and Microsoft forums but all in vain. Could you please help?
I have a dataset name "Cases" which have details of all cases logged into system with its country.
Then I have dataset name "Escalations" with details of the all the escalations along with its country.
Then there is one more table called "Country Mapping" which contains all the countries mapped with their Regions and Region Manager.
I have already prepared a report showing Global /Regional numbers But now people want to restrict the data according to its own territory.
Example :- Some want to see global data and some are responsible for a particular country. I know RLS can help me with this. I have tried to make two tables one with Username and country responsible and other one with just usernames and names.
I have made a relationship between all these tables. But the problem with the code is, like if I am the admin of the report then I need to manually add myself in the country responsible for every country. Like 146 countries .
Is there any better way to do this?

Django Copy Related Data and keep them unchanged over time

Using ForeignKey relationships, I want to be able to copy data and store it in another model. For example, think of how you would handle past Invoices and billed Services.
The Invoice would have one or more Services associated with it and with prices for the Services. This prices for a Service can / will change over time - but the Service price recorded with the Invoice should remain as it was when the Invoice was created.
My first thought was to create a pdf from the resulting data and store it. But this would make the data somewhat inaccessible.
Is there somehow a way to copy the data and keep them accessible?
This is a pretty broad problem with multiple solutions. I dont think that what you're aiming to is the correct one.
One rule for saving invoices is, that invoices never change. You should never update an invoice. So not only your 'copies' of invoices should remain the same, but the original too.
Also, you should have a InvoiceItem (or InvoiceRow) model which are the items on your invoice. Don't bind Products to a Invoice directly.
Here are 2 solutions I've used:
Solution 1
You can normalize the data on your invoice(items). So, don't use foreignkeys, but normalize all data about the product, so product info (incl. price) is saved within the invoice(item).
Solution 2
Give your products revision numbers. So everytime a product is updated (name or price change for example), a new product is created in the database. Now you can link the InvoiceItem to a Product with a Foreign Key, and it will will be historically accurate.
Im sure there are some guides/best practices for creating Invoice backends. Language or Framework is not important. Invoicing is really important, so do alot of research before starting to build something. That's just my two pennies