how to have hierarchy users in sugarCRM Community Edition? - sugarcrm

I have created 6 users say aa,bb,cc,dd,ee,ff.
cc,dd reports-to aa
ee,ff reports-to bb
When leads are created by cc,dd its visible to both aa and bb users.
How to have only aa-user to see leads?

In CE you'll need to use a teams-like solution such as https://www.sugaroutfitters.com/addons/securitysuite. Then cc, dd, and aa would all be added to the same teams (same wiht ee, ff, and bb). When cc and dd create a lead it will automatically be assigned to the same team so that aa can see the lead.
For security, a role would be assigned to the team to allow owner only access so that cc and dd only see their own leads (if your needs require this). Then the aa manager-type would be assigned a role with Team level access. In SecuritySuite that would be Group only access which gives the aa user access to his/her own records along with any records assign to aa's team(s).

Related

check what data does not match on a customer list using tsql

I have a customer list table holding all data for a number of our branches. We have recently had a load of customers move from branch 02 to branch 04 but have all now got a different customer number. small example below:
table.customers
branch
cust_code
post_code
email
tel
mob
02
1234
de5 1ac
fgfg#b.com
0178
0188
04
1432
de5 1ac
fgfg#b.com
0178
0188
02
8528
st4 3ad
thng#b.com
0164
1654
04
6132
st43 ad
thng#b.com
0164
1654
02
8523
de4 1ac
fgfg#b.com
0178
0188
04
7463
de4 1ac
fggf#b.com
0178
0188
So I need to now check that all data has been moved from branch 02 to branch 04 correct, with only the cust_Code being allowed to be different on the columns stated. I do have a list of branch 02 customer codes and the new corresponding branch 04 customer codes. so can tell the query a customer code at branch 02 and to check the customer code at branch 04 to see if the rest of the columns match.
As you can see above the first customer 1234 everything is fine and matches so this can pass the check.
But the customers in bold and italics have something typed incorrect.
I am wanting to write some T-SQL query to now help me identify which customers have non matching data.
Sorry, but you should not base your query in "hope".
First, make sure you make a table with the customer codes before and after the branch move. Let's assume a table named [pairs] with two columns, [branch02code] and [branch04code]. You make sure this has the correct data from excel. Then, you use that to join one copy of customers for each branch, and maybe use a case to figure differences:
select
p.*
,stats_query.records_match
from
pairs p
inner join customers b2 on p.branch02code = b2.cust_code
inner join customers b4 on p.branch04code = b4.cust_code
cross apply
(select case
when b2.post_code = b4.post_code and b2.email= b4.email and b2.tel=b4.tel and ......
then 1
else 0
end as records_match
) as stats_query
order by stats_query.records_match desc

Crystal Reports record selection

Is there a way in Crystal Reports where I can select the correct record based on multiple rows of a dataset?
I have a contacts table that links to an address table. In the address table there is a field that defines the address type. The address table may contain multiple addresses for the same contact that might be the type of business, home or mailing addresses.
When selecting my dataset I pull multiple records but my report only needs one. How can I select the appropriate address record depending on what records are there? For example if business address is there I want that, if not I want mailing, if not there I want home.
I need to filter these records within Crystal Reports unless I can modify the sql select.
The output of the sql looks like this:
ABC Company, Main Street, Location
ABC Company, First Street, Mailing
ABC Company, Second Street, Business
Your question should include some relevant data, tables schema and desired output. The following should get you started.
SELECT C.ContactId, C.ContactName
COALESCE(BA.Address, MA.Address, HA.Address) AS Address
FROM Contact C
LEFT JOIN Address BA ON BA.ContactId = BA.ContactId AND BA.AddressTypeId = 1 -- your business address type
LEFT JOIN Address MA ON MA.ContactId = MA.ContactId AND MA.AddressTypeId = 2 -- your mail address type
LEFT JOIN Address HA ON HA.ContactId = HA .ContactId AND HA .AddressTypeId = 3 -- your home address type

New Moodle requirement

I need to include these fields in my Moodle site
There must be:
· Learner Personal Details which will also include disability, municipality, ward
· Classroom Training with
I. Name of the Provider
II. Name of the facilitator
III. Name of the moderator
IV. Start and end date
V. Name or number of the Unit standard
VI. Results that is competent or not yet competent
· Workplace Training with
I. Name of the employer
II. Address
III. Name of the mentor or supervisor
IV. Start and end date
V. Name of the Unit standard
VI. Final results
· Stipend
I. Money received per month for the duration of the project
We must also be able to report the drop outs and the pregnancy, bear in mind that they take maternity leave and come back so we must be able to report that
There are custom fields for the user profile - http://docs.moodle.org/25/en/User_profile_fields
I would suggest using the facetoface module for the classroom and workplace training - you can use custom fields too.
https://moodle.org/plugins/view.php?plugin=mod_facetoface
You can record attendance and there are a few reports with it.
It is used extensively in Totara (a distribution of Moodle)
http://help.totaralms.com/Trainer_Led_Courses.htm
You will need to write a local plugin to report on the costs though.
http://docs.moodle.org/dev/Local_plugins

Cross tab report in Crystal Report

I am quite new to cross tab type reports in crystal report and I want to show multiple users multiple details.
So that I have columns as username and row containing details of the same.
Like:
User1 User2 User3 User4 User5
Details1: aaa bbb ccc dddd eeee
Details2: 123 345 534 566 87667
Details3: geg dhrth htrhytr ghdf ytryr
But I am unable to get the interface as total, subtotal summary etc fields are quite confusing.
Also I am not interested in grouping my rows on the basis of one field and then showing details in it.
Create a cross tab report and in Row area you put Your details and in column are you put your user, and don't forgot to put the Summarized fields. It works fine. No need to do any coding all the things should manage from your stored procedure.

SQL Server Reporting Services - Custom security module

Take the following two scenarios:-
Developer A has created a set of reports:-
Report A shows details of Audi car sales
Report B shows details of Mercedes car sales
Report C shows details of Volvo car sales, and so on for each of 30+ manufacturers.
So we have 30 report files (.rpt).
Developer A has done this so he can assign different security permissions to each AD group of users:-
Group A can only see Audi car sales,
Group B can only see Mercedes car sales,
Group C can only see Volvo car sales, and so on.
Developer B has taken a different approach:-
She has created a single report (one .rpt file) that accepts a 'manufacturer' parameter in order to display the data for any manufacturer.
In both scenarios the reports are loaded from a report 'menu'. In the first scenario a hyperlink for each manufacturer takes you to the relevant report. In the second scenario the same hyperlink supplies the manufacturer name to the single report as a parameter.
The downside with this scenario is the single report file cannot be locked down to a specific set of users. If the report was locked down to Group A, then Group B or C could not view it at all.
Onto the question:-
In order for us to make the second scenario viable we would need a way of checking to see if the current user, or the current users group has access to view the data they are requesting.
I was thinking of using a custom function, something like CheckAccess(Username,Manufacturer) that returns a true or false, and depending on the return value either redirect the user to load the report, or to an error page respectively.
Another option would be to set up roles for each manufacturer, then assign the roles to each group of people. Could a custom function then be used to check if 'Bill' has the 'Audi' role ??
Looking for ideas here as to the best approach.
I suggest you:
Create a table with the userid and report parameter in it. This way the security of the user access can be managed.
Then use the ssrs User!UserID reference as a parameter in your query.
As an added benefit you can create a query to only populate the manufacturers the active user is allowed to see.