Bugzilla : Make user restrict to view bugs - bugzilla

I have a user which belongs to Group B.
I want him to restrict to view bugs for product for which group B is unchecked and NA/NA in edit group permissions.
Product is for Group A only.
Still he can access bugs and also edit. I don't want that.
What more I have to do. Any more configuration ?

Creating a two different group as per products.
Say For -
ProductA - Group A
ProductB - Group B
Then in
administrator---->Products----->Edit Group Controls
click on link. It will show you some setting for groups that newly created - Group A and Group B.
For product A then use group A setting -
mandatory/mandatory , editbugs
same for product B.
This will restrict A from accessing Product B and vice versa.
This works for me, I hope it may come to use to others too :)

Related

Salesforce Service Cloud - Table Account NULL values

I'm trying to obtain data from Service Cloud Salesforce but when I select the table in SSMS, the data is all NULL, so probably I'm not specifying the right columns or table.
Salesforce Report Builder
Salesforce Source Editor (Visual Studio)
When I run the report in Salesforce I can see that the country and postal code data are filled in, but when I read the documentation, I don't find the main column "Country" neither "Mailing Zip/Postal Code".
For the Zip Code, in this example, since it's also filled in the data about Billing Postal Code, this one I could obtain in the extraction, but for the country I can't find a column named "country", only "BillingCountry" and "ShippingCountry", but these columns do not contain any information.
Documentation:
https://developer.salesforce.com/docs/atlas.en-us.234.0.object_reference.meta/object_reference/sforce_api_objects_account.htm
Can anyone help here? I need to add on the select in salesforce source editor (visual studio) the right column names to obtain the country and the zip code.
Thank you,
Your report mixes fields from Account and Contact joined together by Contact.AccountId = Account.Id. You could edit it and expand the left sidebar to see which field comes from which object.
Account has Billing and Shipping address (2 sets of fields with actual names becoming BillingCity, BillingStreet... And Contact has Mailing address and Other Address.
So that's 4 * 6 fields across 2 tables out of the box. Can be muddied up further if you have "Person Accounts" enabled (some contacts get paired up as 1:1 relation to account instead of 1:n, in something that behaves a bit like materialised view for MS SQL people?). Also admin could rename one of the fields (API Names of columns stay the same but you'd see different labels in report and UI), add custom address fields...
See how these queries work for you. Try them out in Salesforce Developer Console (in web UI), or VSCode first, not in that tool you have.
Pure contacts
SELECT Id, FirstName, LastName, MailingStreet, MailingCity, MailingPostalCode
FROM Contact
WHERE MailingPostalCode = '4465-613'
LIMIT 10
Pure accounts
SELECT Id, Name, BillingStreet, BillingCity, BillingPostalCode
FROM Contact
WHERE BillingPostalCode = '4465-613'
LIMIT 10
Now JOIN (for normal Salesforce, B2B, where Account is more like a company and Contact is more like employee)
SELECT Id, FirstName, LastName, MailingStreet, MailingCity, MailingPostalCode, Account.Name, Account.City
FROM Contact
WHERE MailingPostalCode = '4465-613' AND Account.BillingPostalCode = '4465-613'
LIMIT 10
And since your second screenshot looks like you do have person accounts (more like B2C model, with standalone "1 man companies" like freelancers, doctors working in multiple hospitals, students in education...) try this one too
SELECT Id, Name, BillingCity, BillingPostalCode, ShippingCity, ShippingPostalCode, PersonMailingCity, PersonMailingPostalCode, PersonOtherCity, PersonOtherPostalCode
FROM Account
WHERE IsPersonAccount = true
LIMIT 10

How to edit Relationship properties to only use part of the CDM Identifier in LDM?

I'm creating a conceptual data model for a simplified web store using Power Designer.
I'm having trouble specifying the relation between an Order and a Receipt. I would like a receipt to only have a part of the order's identifier in its primary key in the logical model (more specifically, only order_id). I am unable to achieve this by tweaking the relationship properties (see the screenshots bellow; the problematic relationship is marked with a green arrow).
Should I simply omit the relation in the conceptual model?
Conceptual data model
Logical data model
EDIT
If perhaps it wasn't clear how I envisioned my tables…
User
username
password
mail
first_name
last_name
address
hacker123
greenGrass
david.norton#gmail.com
David
Norton
West Shire 40, 1240 Neverland
musicman100
SuperPassword
john.stewart#gmail.com
John
Stewart
Strange Alley 50, 1250 Outer Space
Product
product_id
name
description
price_per_unit
unit_of_measure
supply
1
Tooth Brush 100
NULL
5.99
piece
200
2
Super Paste 200
For sparkling smiles
7.99
piece
50
Order
order_id
username
product_id
amount
50
hacker123
1
2
50
hacker123
2
1
51
musicman100
1
5
Receipt
receipt_id
order_id
12
50
13
51
EDIT #2
I just realised that I should probably break up Order into two tables! One to track which products are on a particular order, and another to track who placed the order.
Perhaps I could even split the Order table into 3 parts
Order(order_id, order_time)
ProductsPerOrder(order_id, product_id, amount)
OrdersPlaced(order_id, username)
You have a contradiction... One part says that Order is identified by User+Product+Order; the other says that Order has its own identifier order_id.
I guess the second one is correct, with the usual design that Order has an id.
And you need to change the relationships in the CDM, between Order, and User/Product, to uncheck the Dependent property. These links are just mandatory, not dependent (which would mean that Order is defined relatively to User+Product).
p.s. the same holds for Receipt, which has its own identifier.
You can edit the relationship in the logical model!
If you click on a relationship, a Relationship properties dialog appears. There's a tab called Joins. This is where you can specify which columns to refer to with the relationship.

Summing up values from one column into one row on a different table when joining

I've only had a (frustrating) couple days experience with SQL Server, and I need some help, since I cant find anything related to my question when searching.
For background info, I'm working in an accountancy, and right now I'm trying to create a table for balance statements to use in crystal reports. Each invoice has multiple items, but for the statement I need to sum them all up with the invoice reference being the information that links the group of data that needs to be summarised.
So, what I need is to pull information from one table (dbo.SalesInvItems), this information including the date (InvDate), the due date (InvDueDate), and the customer name (CustomerName). This information stays the same with the Invoice Reference (InvRef), and it's what I want to use to link the two tables.
For example, Invoice Reference: 1478 will always have the date 14/05/18, the due date: 14/06/18 and the customer name: Pen Sellers Ltd.
The same Invoice Reference is used by multiple rows, but the only thing that changes (that I need) is the Invoice Item Total (InvItemTotal).
For example, the one reference will always be addressed to Pen Sellers, but one item has the Total as £13 and another item using the same reference is £20.
The Invoice Item Total is what I need to sum up. I want to add all the Invoice Item Total's together that have the same Invoice Reference, while joining the tables.
Sales Invoices
So when I've inserted the references into the table (sorry they're not the same in both pictures, I was having problems making examples and I made a mistake), I want to grab the information from the Invoice table to fill it in, going from this...
Pre Solution
To this...
Desired Result
The desired location is a table called dbo.Statement.
1.Is this even possible to do?
2.How would I go about doing this?
3.Is there a method I could use that would make sure that every time I insert an Invoice Reference into the Statement table, it would automatically pull out the data needed from the Invoice Table?
If any additional information is needed, just say and I'll do my best to provide it, I have never asked a question on here before and I'm new to SQL Server and coding in general.
Im using SQL Server Management Tool 2017
Thank You
Select item.InvRef
, item.CustomerName
, item.InvDate
, item.InvDueDate
, Sum(item.InvItemTotal) InvAmt
, sum(IsNull(payments.Amount,0)) PayAmount
, Sum(item.InvItemTotal) InvAmt - sum(IsNull(payments.Amount,0)) as Balance
from SalesInvItems item
left join payments -- you didn't define this
on item.InvRef = payments.InvRef
group by item.InvRef
, item.CustomerName
, item.InvDate
, item.InvDueDate
Select item.InvRef
, item.CustomerName
, item.InvDate
, item.InvDueDate
, Sum(item.InvItemTotal) InvAmt
from SalesInvItems item
left join Statement
on item.InvRef = Statement.Reference
group by item.InvRef
, item.CustomerName
, item.InvDate
, item.InvDueDate

Crystal report - Group Towns by Countries

I have two tables
With this query i got the results
select countries.id, countries.name, Towns.id,Towns.TownName
from
Countries
left outer join Towns on countries.id = towns.countryID
Now i want to group results by country to get something like this on my CrystalReport. Is it even possible to make it ?
In the example you have provided, doing a GROUP BY in Sql Server would not be desirable. A Sql GROUP BY is generally used to project single scalar values from a list in each group, e.g.
SELECT Countries.Name, Count(Towns.Id) AS NumberOfTowns, Sum(Towns.Population) AS TotalPop
FROM Countries
LEFT OUTER JOIN Towns
ON Countries.Id = Towns.CountryID
GROUP BY Countries.Name;
Would give results like
Name NumberOfTowns TotalPop
Bosnia 2 123456
England 2 98765
by applying the Aggregates COUNT and SUM to all rows (Towns) in each country.
This isn't going to be useful for your report, as you need to show a list of all towns per country.
What you want instead is to use your current query as-is, and then to apply a Crystal Group Header on Countries.Name. Then, in Crystal, remove the Countries.Name field from the Details section (since you don't want the country repeated). You'll possibly also want some ordering done in the groups and data - again, I would suggest you do this in Crystal (although an ORDER BY Countries.Name, Towns.TownName would also work).
You'll then have a report which resembles your requirement.

cakephp - view with data from multiple tables as one

I want to have a view for each table (letters, filings, notes) which each have a name and date. I want to have a separate view for items from each table that also fall into a particular category -- say categoryx -- so it is a separate view. The categoryx view would combine particular fields from each of the multiple tables into one table, in effect, ordered by date.
E.g.,
Category x
DATE NAME ORIGTABLE
1/2/11 SmithToJones Letters
1/3/11 Filing on X Filings
1/4/11 Note re X Notes
1/7/11 JonesToSmith Letters
I'm just stumped on whether there is a good or straightforward way to do this. Open to options. Thanks
I think I have the answer, though it's not perfect. I do this in the controller (may try it in the model next):
$query='select name,date, "letters" as "origtable" from letters
UNION SELECT name,date, "filings" as "origtable" from filings
UNION SELECT name,date, "notes" as "origtable" from notes
ORDER BY date';
$things=$this->Letter->query($query);
$this->set('items',$things);
This gets me an array I can parse out. If I add id to it, then I can easily create links to the relevant item in the relevant table.

Resources