CRM 2011 - Dashboards Slide Show For on a TV - slider

My customer want to have a "Slide Show" of all the "Dashboards" that are in the CRM. He wants to be able to hang a TV out and then show a slide with some "Dashboards" that will change every 10 seconds. The data needs to be up to date, so taking screenshots and putting them in a Powerpoint isn't enough. I was thinking about the following :
Create a custom Page with an Iframe and update the iframe every 10 seconds with a new "Dashboard" in it. I know you can do the following => /OrganizationName/dashboards/dashboard.aspx?dashboardId=%7b16a69a12-105a-e011-bd7f-000c29198df7%7d&dashboardType=1030&pagemode=iframe, but there is no way where I can find the ID. "The Copy A Link" functionality when "Right"-clicking on a view isn't there anymore.
I remember at the "Tech Days" of CRM, that there was a possiblity to immediatly connect to the "Report"-server for showing the "Dashboards"... Or is there a table in the "Database" who has all the "Names" + "IDs" of the dashboards?? I can't seem to find it in the Database...
How would you guys make a cool "Dashboard"-slid for on TV (PC connected to TV is what I mean by that).

I have a few screens in my office building showing dashboards from CRM, mainly Service Desk/call centre statistics.
I used this 'copy link' method to obtain a URL to the full screen dashboard (without any sidebars) then I installed a plugin/extension for IE to auto-refresh and cycle through various dashboard tabs (can't remember what it's called, but if you Google I'm sure you'll find it). This is always up to date and creates a slideshow effect.

System Dashboards are System Forms and Personal Dashboards are User Forms so it cab be retrieved from dbo.SystemFormBase and dbo.UserFormBase tables respectively.
If any Personal dashboard is shared then that details can be retrieved from PrincipalObjectAccess table.
Use below sp to retrieve dashboard id, name and type for the specific user.
Create PROCEDURE [dbo].[GetDashboardIds]
(
#SystemUserID uniqueidentifier
)
AS
BEGIN
select FormId as 'DashboardID',Name as 'Name', 'System' as DashboardType
from dbo.SystemFormBase
where Type = 0
Union
select UserFormId as 'DashboardID',Name as 'Name', 'Custom' as DashboardType
from dbo.UserFormBase
where Type = 0 and OwnerId = #systemUserID
union
select UserFormId as 'DashboardID',Name as 'Name', 'Custom' as DashboardType
from dbo.UserFormBase UFB inner join PrincipalObjectAccess POA on UFB.UserFormId = ObjectId
where Type = 0 and POA.PrincipalId = #systemUserID
end
Happy Coding

Related

Categorization column based on text contained in 2 other columns within T-SQL query

I'm building a report in Power BI and could setup a Power Query custom column using Text.Contains to solve this problem but the M Code would be very long and I'd rather perform this upstream in the SQL query. I have very little SQL experience.
I'm working with website data from Adobe Analytics. We have our website URLS and web pages grouped into categorical segments based on the product/service the URL/webpage corresponds to. A segment is defined by a list of URL paths and/or web page names, sometimes 1 path/page, sometimes over 30.
My result needs to be the following table:
Page URL Path
Page Name
Page Category
varchar(255)
varchar(255)
varchar(255)
Page URL Path examples:
/careers/starting-your-career/scholarships.html
/services/technology/ecommerce.html
Corresponding Page Name Examples:
Career & Scholarships | Company Name
Digital Transformation | E-Commerce | Company Name
There are a total of 76 page categories/segments to define. This screenshot shows an example of some categories and their definition.
Can anyone help me get started in writing this query?
I tried using CONTAINS but I believe this only works within a WHERE statement and I don't think it can be scaled to the needed extent:
SELECT
post_evar3 as 'Page URL Path',
post_evar4 as 'Page Name',
CASE
WHEN post_evar3 CONTAINS ('/services/assurance' or 'services/audit' or 'insights/financial-reporting')
AND (post_evar3 CONTAINS 'asc-842' OR post_evar4 CONTAINS 'asc 842')
THEN 'Audit Services'
WHEN post_evar3 CONTAINS '/services/strategy-and-management-consulting'
THEN 'Business Stratgegy Operations'
ELSE 'Other'
END AS 'Page Category'
FROM
Marketing.WebAnalytics.WebData
WHERE
exclude_hit = 0
AND hit_source = 1
I've read about Full-Text Search and Index solutions that are over my head in developing and I don't know that this method can be used within the Power BI SQL query environment. I've wondered if I need to declare the definition values into their own table, then join with the WebData table, though defining using both Page URL Path AND Page Name for the same category throws me for a loop.
The M code for this kind of matching is not large, though execution time can can vary
let BufferedTable2=Table.Buffer(Table2),
Source = Table.AddColumn(Table1,"Match",(i)=>try Table.SelectRows( BufferedTable2, each Text.Contains(i[Column1],[Match1], Comparer.OrdinalIgnoreCase) and Text.Contains(i[Column2],[Match2], Comparer.OrdinalIgnoreCase) ) [Return]{0} otherwise null, type text)
in Source

Device assembly management

I have a db of parts in an Access db.
Now I wish to create a kind of construction management.
Imagine to have in warehouse some pieces, and you have to assembly devices starting from them.
I wish to create a query in which I introduce group name and I get a kind of bill of material with available and requested quantities to assembly.
Example:
Warehouse table (already existing)
[code]¦[Quantity]
A¦3
B¦4
C¦0...
Device "Alpha" is made by (I don't know how to declare these devices composition)
[code of which _Alpha_ is made]¦[Quantity for mounting _Alpha_]
A¦2
B¦0
C¦1
I launch the query (as Input I'm going to pass "Alpha", the name of the device) and I get a table like
Device name: Alpha
[code]¦[warehouse qty]¦[required qty to be picked from warehouse]
A¦3¦2
B¦4¦0
C¦0¦1==> error: I can't assembly because 1 piece is missing
Are you looking for something like this:
SELECT w.Code, w.Quantity,a.Quantity,
WHEN w.Quantity < a.Quantity THEN "Not enough in warehouse" ELSE "" AS Error
FROM Warehouse w
INNER JOIN Alpha a ON a.Code = w.Code

MS Access 2010: Automatically Filters all the records depending on the user logged in

I am creating a database in Microsoft Access 2010 where when a user logged in the database, the user will only see records that is related to him or her. I've put a criteria in the record's query specifically in IssuingManager field which is [Forms]![frm_Home]![txtUser] but I always get enter parameter value when I run it. txtUser is an invisible text box in my main form so the records will have a reference on which records to filter. My main goal is to limit the user's data to their own records and hide or block them to others. I am new to access and still learning it. Any help or other ways I can filter the data or limit it to the records that is only related to the current user logged in is a big help.
This is my SQL code:
SELECT AdditionalFields.Status, tbl_NTE.CaseIDNo, tbl_NTE.EmployeeName,
tbl_PAH.DPosition, tbl_NTE.Function, tbl_NTE.IssuingManager,
tbl_NTE.ApprovingManager, tbl_NTE.ObjectOfViolation, tbl_NTE.Offense,
tbl_NTE.ClassPenalty, tbl_NTE.CorrectiveActionPenalty,
tbl_NTE.ObjectOfViolation2, tbl_NTE.Offense2, tbl_NTE.ClassPenalty2,
tbl_NTE.ObjectOfViolation3, tbl_NTE.CorrectiveActionPenalty2,
tbl_NTE.Offense3, tbl_NTE.ClassPenalty3, tbl_NTE.ObjectOfViolation4,
tbl_NTE.CorrectiveActionPenalty3, tbl_NTE.Offense4, tbl_NTE.ClassPenalty4,
tbl_NTE.CorrectiveActionPenalty4, tbl_NTE.DatesWhenActsWasWereCommited,
tbl_NTE.DatesWhenActsWasWereDiscovered, tbl_NTE.NTEDate,
tbl_NTE.NTELastDateModified, tbl_NTE.NTELastTimeModified,
tbl_NTE.NTELastUser, tbl_PAH.PAHDate, tbl_PAH.PAHLastDateModified,
tbl_PAH.PAHLastTimeModified, tbl_PAH.PAHLastUser, tbl_NCA.NCADate,
tbl_NCA.NCALastDateModified, tbl_NCA.NCALastTimeModified,
tbl_NCA.NCALastUser, tbl_NTE.EndorsedNTENoticeToHR,
tbl_NTE.EndorsementOfNTEToIS, tbl_NTE.DateReceivedNTEByTheEmployee,
tbl_NTE.SubmissionOfWEtoIS, tbl_NTE.SubmissionOfWEtoHRER,
tbl_NTE.InitialDecision, tbl_PAH.ScheduleForPAH, tbl_PAH.Recommendation,
tbl_PAH.EndorsementOfDecisionNoticeFromPAHCommitteeChairToHR,
tbl_PAH.EndorsementOfFinalizedPAHRecommendationToIS,
tbl_NCA.EndorsementOfDA2ToHRForReview, tbl_NCA.EndorsementOfReviewedDA2ToIS,
tbl_NCA.EmployeeAcceptanceOfDecision,
AdditionalFields.DescriptionOfPenaltyFinalDecision,
AdditionalFields.ApplicableDatesofEffectivity, AdditionalFields.Remarks,
AdditionalFields.RunningTAT, AdditionalFields.TAT, tbl_NTE.EHRID,
tbl_NTE.IssuingManagerEmailAddress, tbl_NTE.WrittenExplanationDueDate,
tbl_NTE.OffenseNo5, tbl_NTE.Offense5, tbl_NTE.ObjectOfViolation5,
tbl_NTE.ClassPenalty5, tbl_NTE.CorrectiveActionPenalty5, tbl_NTE.OffenseNo6,
tbl_NTE.Offense6, tbl_NTE.ObjectOfViolation6, tbl_NTE.ClassPenalty6,
tbl_NTE.CorrectiveActionPenalty6, tbl_NTE.OffenseNo7, tbl_NTE.Offense7,
tbl_NTE.ObjectOfViolation7, tbl_NTE.ClassPenalty7,
tbl_NTE.CorrectiveActionPenalty7
FROM (tbl_Worker INNER JOIN ((tbl_PAH INNER JOIN tbl_NCA ON tbl_PAH.
[CaseIDNo] = tbl_NCA.[CaseIDNo]) INNER JOIN AdditionalFields ON
tbl_NCA.CaseIDNo = AdditionalFields.CaseIDNo) ON tbl_Worker.WorkerID =
tbl_NCA.NameOfIssuingManager) INNER JOIN tbl_NTE ON (tbl_NTE.CaseIDNo =
tbl_PAH.CaseIDNo) AND (tbl_Worker.WorkerName = tbl_NTE.IssuingManager)
WHERE (((tbl_NTE.IssuingManager)=[Forms]![frm_Home]![txtUser]));
I would recommend to avoid using form's field references in queries at all. If form closed, the query will request parameter, like most likely in your case.
Replace the reference by global function created in standard module. This function can store the name, for instance, in static/global variable or retrieve it from table. Main or login form can set this variable/table record once, then the form can be closed without affecting queries functionality
Add another column and put the username. So when selecting the records, there's a condition where user='username'. They look all the data base on what the username has.
your method is fine & correct; you just have some sort of cockpit implementation error
the criteria in the query should be: Forms!frm_Home.txtUser
you could have a spelling error in your form name or text box name
make the textbox visible and enter a valid entry and run the query manually
what you are getting appears to be a parameter prompt that means it cannot find the object i.e. form named frm_Home

Is there a way to get the OpenText Content Server node id using a word macro

I'm after getting the OpenText Content Server node id using a word macro after a Content Server user creates a word doc by opening word on their pc and saves (using the enterprise connect dialog) and before the word doc is closed - I'm building a macro to hook the item number and pull some metadata into the doc, allowing the user to insert/update a document footer.
Is there some aspect of the various APIs or SDKs that will allow a word macro to access its own node id (and possibly other metadata) in this scenario?
I've found the file C:\Users[username]\AppData\Roaming\OpenText\OTEdit\sync.fedb which seems to hold a mapping between the file location/name and the document in content server, but interrogating this directly seems like a bit of a hack as OTEdit.exe always has a lock on the file, and I wonder if there is a supported way to do this.
I've investigated DPS as a way to stamp the content server node id into the word doc properties, and while this works if the user closes and re-opens the doc, the properties are not available before the doc is closed and so it is not useful in this situation.
I found a different approach because sync.fedb is locked by the OTEdit process, and there doesn't seem to be any way to access the document metadata via the SDK using a word macro. It's a bit of a hack, but I've put the details here in case anyone else is interested in doing this.
Edited documents are stored under a folder in a path like: C:\Users\[username]\AppData\Roaming\OpenText\OTEdit\EC_[servername]\[folder]\[current document name]
[folder] might match a folder in Content Server, or might not - it is better to check the ~otdirinfo.ini file and parse the parent folder id out of the Browse url.
From here we can do a database search using something like:
SELECT
t.DataID AS NodeId,
CAST(t.CreateDate AS DATE) AS CreateDate,
CASE WHEN k.FirstName IS NULL
AND k.LastName IS NULL THEN k.Name
ELSE LTRIM(RTRIM(( ISNULL(k.FirstName, '') + ' ' + ISNULL(k.LastName, '') )))
END AS CreatedByFullName,
CASE WHEN kr.FirstName IS NULL
AND kr.LastName IS NULL THEN kr.Name
ELSE LTRIM(RTRIM(( ISNULL(kr.FirstName, '') + ' ' + ISNULL(kr.LastName, '') )))
END AS ReservedByFullName,
t.CreatedBy,
t.ReservedBy,
t.ParentID,
t.Name AS Title,
v.FileName
FROM
DTree t
INNER JOIN KUAF k
ON t.CreatedBy = k.ID
LEFT OUTER JOIN KUAF kr
ON t.ReservedBy = kr.ID
INNER JOIN DVersData v
ON t.DataID = v.DocID AND t.VersionNum = v.Version
In practice, I have written an API to wrap the database lookup that returns the results of interest in JSON, which is slightly easier deal with than managing database connections and returns results faster than CWS at my site. I use the handy VBA-Web macros to make the call and handle parsing, place the results of the call into the word doc properties, and then call our existing footer-generation macro.
Note: I'm using Content Server 10.5 for this, apparently the approach for extracting parent id sometimes differs per version.

How to handle Zim Error "The ZIM tree pool has overflowed"

I have the following code:
set output spoole
select * from displays where displayname='dsp020a'
select * from forms where formname in (select formname from displayforms where displayname='dsp020a')
select * from formfields where formname in (select formname from displayforms where displayname='dsp020a')
The third select is crashing ZIM with the following error:
*** ZIM System Error *** The Zim tree pool has overflowed. Type BYE to exit from Zim.
What am I doing wrong and how can I fix it?
When trying to use SQL in ZIM, I also saw problems and unexpected errors. You should always try to use the native ZIM 4GL commands to access data as well as object definitions.
ZIM Data Dictionary contains some predefined internal relations which can help analyse the data model. For example, you could say:
list all Displays DispDispForms DisplayForms where Displays.DisplayName = "dsp020a"
to find out which forms are contained in the given display. Likewise you could do:
list all Forms FormFormFields FormFields where Forms.FormName in ("f020a", "f020b", "f020c")
to list all form fields which belong to the given forms. Unfortunately, there is no relation between DisplayForms and Forms, so you cannot achieve directly what you tried in your example using SQL.
OR (added after your comment):
You can achieve that using a small program. For this example, it would be:
set output output_file
find Displays DispDispForms DisplayForms where Displays.DisplayName = "dsp020a"
while $setcount > 0
let vStr = DisplayForms.FormName
list all Forms FormFormFields FormFields where Forms.FormName = vStr
let $setcount = $setcount - 1
next
endwhile
set output terminal
Now you have all form fields which belong to all forms of the given display listed in the output_file.
There probably already is a relationship between dfs and forms in the db schema but the documentation is poor. However, you can create your own. Note that dfs is a role for displayforms.
add 1 rels let relname = 'dfsforms' relcondition = 'dfs.formname = forms.formname' reltype = 'ZIM' dirname = 'ZIM'
create rel dfsforms
Now you can find forms related to displays using:
find all displays dispdispforms dfs dfsforms forms formformformfields wh displays.displayname = 'dsp020a'