Fullname control is not working in Dynamics 365 Unified interface - dynamics-crm

We've recently enabled the Unified Interface on our Dynamics 365 CE web client and noticed that the fullname is missing from the Contact forms and several views. It is there when we open the Form editor, but when we're running formContext.getAttribute("fullname") it returns a null.
It's causing us a big headache as we're using the fullname basically everywhere: in forms, views, Document templates, JavaScripts etc.
Has anyone come across this problem or knows a workaround without having to replace the fullname with first and last name everywhere in our environment?
According to Microsoft it's officially not ready before April 2020 (https://learn.microsoft.com/en-us/power-platform/admin/about-unified-interface#capabilities-not-yet-on-unified-interface), but we need to start testing before that.
Many thanks in advance

Composite control is not available in UCI yet. So the popup will not be showing up to do data entry. That means the Full name field will display as the child individual fields, ie. First name & Last name. The data changes in any of the First name or Last name will replicate to Full name field.
Only changes needed is in form scripting. Whenever/wherever you are accessing the Full name field like formContext.getAttribute("fullname") just switch it to formContext.getAttribute("firstname") + " " + formContext.getAttribute("lastname") if the script is executing in UCI.
I just tested this quickly in my UCI. Also views showing the Full name field without issues. Templates should not be a problem if data is there. Only problem is in form, so the above script will solve the issue.

Related

Getting the appid included in the Record URL(Dynamic) in a Dynamics 365 email workflow

I've been tasked with creating a workflow in Dynamics 365 which can send emails (the easy bit). However, the email has a link to the record (also easy using the Record URL(Dynamic) attribute). However, we use Apps in our Dynamics instance and the link generated by the workflow using Record URL(Dynamic) doesn't include the app id and so when users click the link they are taken to Dynamics but are now outside the app.
My question is, is there a supported way to appending the App Id to the Record URL(Dynamic) attribute?
I've already searched for answers to this and cant find any. My solution was to create an Action which takes as input the Record and app ID, appends them and outputs them as an output parameter. This works to be honest, but I'm wondering if I'm reinventing the wheel and there is an easier way to achieve this.
Thanks and hope this helps anyone else with the same issue.
We can get the Application ID from Xrm.Utility.getGlobalContext();
The application ID is one of the properties that returned
var globalContext = Xrm.Utility.getGlobalContext();
globalContext.getCurrentAppProperties().then(
function success(app) { console.log(app.appId); }, function errorCallback() { console.log("Error"); });
For more details refer to Here
While we are waiting for MS to give the OOB option to choose Model driven app Id & embed in Record url of WF, I recommend you to follow Andrew Butenko’s workaround using Ultimate Workflow Toolkit to achieve it with no code.
This is basically using UWT custom step to append App Id with Record url on the fly.

Dynamics CRM - How to get the Message default display string

Does anyone know how to use C# to get the Default Display String for a Message?
The Default Display String is the first column displayed when you open a Solution, select an Entity (such as Case), and then select Messages. It contains values like "A Parent Case cannot have more than {0} child cases. Contact your administrator for more details."
The DisplayString Entity seems like the right place, but it only has the CustomDisplayString and the PublishedDisplayString, and not the default display string. Microsoft have confirmed that the Default Display String is not in the DisplayString Entity, but they don't say where it can be found...
I have tried searching the Metadata Browser, and even went trawling through the Organisation and Config databases, but no luck.
Any help greatly appreciated ...
While this doesn't answer your question directly, it's a clue.
I checked a bit in the database, then searched for the Account entity message "Existing Account?" in the file system.
It's in this DLL:
C:\Program Files\Microsoft Dynamics CRM\CRMWeb\bin\Microsoft.Crm.Application.Components.Strings.dll
As far as accessing strings in that DLL from C# goes, I'm currently at a loss. You might want to create a MSFT ticket to see if they have any further suggestions. Another thought is that if you're targeting a particular entity, or a few entities, maybe copy the default message to the CustomDisplayString for the messages you're interested in.

Exporting Sonarqube reports into Excel - based on major, minor and critical categories

Is there a way to export Sonarqube reports into Excel - based on major, minor and critical categories?
You can use the REST API, to query the data into JSON text and then export that JSON to a CSV file.
I used the command below to get a JSON response:
http://xxxxx.xx.xxxx.com:9000/api/issues/search?componentRoots=test_xxx_xx&statuses=OPEN,REOPENED&pageSize=500&pageIndex=1
Where componentRoots is the your sonar project name.
It gave all the issues in JSON and then I converted it in to a CSV.
The only way is to use the api/issues/search web service
Yes you can use the REST APIs provided with SonarQube to query. The documentation of APIs is also embedded into every Sonar instance as different versions expose different APIs.
We use Python for similar work as response will be in JSON and it will be easier to manipulate. Once you have arrived extracted issues of your liking, write them into .CSV or excel.
Link to web services will be in footer of Sonar Instance.
PS: Expanded answer to offset short-sighted answering. What is provided here is only abstract and not complete answer with query details.
Not recommended by community
With DB:- If you have been using Sonar for long and if you won't upgrade SQ too often you can choose to study table structure and understand how data is organised. We have done this too, but it gets messier with every passing upgrade (more inner queries). Cost of querying will be saved on bulk process of data as ES is not involved
Please try the following command to get all issues in JSON format. Then you may consider to parse output by using jason parser programs.
Replace "XXX:XXX" with Sonar Key defined in "sonar.projectKey" variable on "sonar-project.properties.txt" file
http://localhost:9000/api/issues/search?componentKeys=XXX:XXX
I used F12 developer tools to create the report. Here is step by step solution:
Before opening Sonar report, press F12 to open developer tools in the browser tab (Refer screenshot). Click on Network tab. Initially it'll be empty:
Open Sonar report in the same browser tab.
Now you have to select a request in URL column (Refer screenshot in point # 4). You've to select that request whose URL is of the format - https://sonar:8443/api/issues/search?. Base URL might be different depending upon the name of the server where you have hosted Sonar website.
Click on Response tab (Refer screenshot):
Copy the entire JSON data to clipboard. First press Ctrl + A and then Ctrl + C to copy the contents.
JSON data that you got is in below format:
Data of all the issues is present inside issues key. It is of array type as it contains a list of issues. Paste the entire JSON data into any notepad editor and get the value of issues node. A sample issues node data is shown below:
[
{
"key":"AYMBNpviy48WWZHdsU1Z"
,"rule":"OWASP:UsingComponentWithKnownVulnerability"
,"severity":"MAJOR"
,"component":"B91661CE-50F8-45CB-8F54-29CD044EF32D"
,"project":"B91661CE-50F8-45CB-8F54-29CD044EF32D"
,"flows":[]
,"status":"OPEN"
,"message":"Filename: jquery-ui-1.10.3.custom.js | Reference: CVE-2021-41184 | CVSS Score: 6.1 | Category: CWE-79 | jQuery-UI is the official jQuery user interface library. Prior to version 1.13.0, accepting the value of the `of` option of the `.position()` util from untrusted sources may execute untrusted code. The issue is fixed in jQuery UI 1.13.0. Any string value passed to the `of` option is now treated as a CSS selector. A workaround is to not accept the value of the `of` option from untrusted sources."
,"author":""
,"tags":["cve","cwe","cwe-937","owasp-a9","vulnerability"]
,"transitions":["confirm"]
,"actions":["set_tags","comment","assign"]
,"comments":[]
,"creationDate":"2022-08-18T06:35:49+0100"
,"updateDate":"2022-08-18T06:35:49+0100"
,"type":"VULNERABILITY"
,"branch":"sonarqubepr"
,"scope":"MAIN"
,"quickFixAvailable":false
},
{
"key":"AYMBNpviy48WWZHdsU1_"
,"rule":"OWASP:UsingComponentWithKnownVulnerability"
,"severity":"MAJOR"
,"component":"B91661CE-50F8-45CB-8F54-29CD044EF32D"
,"project":"B91661CE-50F8-45CB-8F54-29CD044EF32D"
,"flows":[]
,"status":"OPEN"
,"message":"Filename: jquery.ui.datepicker-ml.min.js | Reference: CVE-2021-41183 | CVSS Score: 6.1 | Category: CWE-79 | jQuery-UI is the official jQuery user interface library. Prior to version 1.13.0, accepting the value of various `*Text` options of the Datepicker widget from untrusted sources may execute untrusted code. The issue is fixed in jQuery UI 1.13.0. The values passed to various `*Text` options are now always treated as pure text, not HTML. A workaround is to not accept the value of the `*Text` options from untrusted sources."
,"author":""
,"tags":["cve","cwe","cwe-937","owasp-a9","vulnerability"]
,"transitions":["confirm"]
,"actions":["set_tags","comment","assign"]
,"comments":[]
,"creationDate":"2022-08-18T06:35:49+0100"
,"updateDate":"2022-08-18T06:35:49+0100"
,"type":"VULNERABILITY"
,"branch":"sonarqubepr"
,"scope":"MAIN"
,"quickFixAvailable":false
}
]
The JSON array data obtained in previous step is of real use. Convert this JSON array data into an EXCEL file using any online converter. I used the following website - https://www.convertcsv.com/json-to-csv.htm
What if my report has more than one page?
Sonar loads 100 records per page. To get the next page you've to click on Show More button at the bottom:
Every time you click on the Show More button, a new request goes to the Sonar server which will show up in the F12 developer tool's Network tab. So for all subsequent pages, repeat same set of steps to create a new Excel sheet per page. Then merge all the Excel sheets manually to create single master report.
Note: While merging the Excel files, remember that every Excel file will have a header row at the top. While merging the files, you'll have to keep the header row from from the first Excel sheet and ignore from the rest.

Crystal Reports/Windows 7: Crystal reports asks for a default email client, and posts an error

Crystal Reports 11 (craxdrt.dll 11.5.7.1048)
Windows 7
I'm using Crystal Reports to export to a PDF document, using CRYSTALCRAXDRT::IReport::Export, and am getting an error, Windows 7 only.
"There is no email program associated to perform the requested action. Please install an email program or, if one is already installed, create an association in the Default Programs control panel."
Again, I'm not trying to send email, just create a document.
I've put forth a little debugging effort into this, and what seems to be happening is this:
I call into craxdrt.dll via the IReport interface, function Export(...), and then, monitoring with procmon, I find that there are several hundred registry queries for default mailer, contacts, etc.
It would seem that craxdrt.dll is building a large-ish data structure ahead of the task with whatever info it might need for a family of functions.
There's an error posted when the program can't find a default email client
Problems with this:
Windows 7 does not ship with a default email client, and early investigation seems to indicate that installing one does not necessarily ameliorate the problem. In any case, I do not expect all of our clients to have one installed, nor do our clients expect to have one installed by us.
Absent the actual need for an email client (i.e., in the above case), we're still getting this error message pop-up.
Note:
Interestingly, this doesn't actually prevent the user from pressing the export button again, and in fact if the user does this, the error does not show up, as the registry queries are apparently done only once per load or use of craxdrt.dll.
I think you are missing setting the ExportOptions before exporting:
Dim crxReport As Report
Set crxReport = Prepare()
crxReport.ExportOptions.FormatType = crEFTPortableDocFormat
crxReport.ExportOptions.DestinationType = crEDTDiskFile
crxReport.ExportOptions.DiskFileName = "C:\temp\Report.PDF"
crxReport.Export (False)

Lookup site column not saving/storing metadata for Office 2007 documents?

I'm having this issue on several server environments.
We have a list at the site collection root. There is a site column created as a multi-value lookup on that list's Title field. This site column is used in document libraries in subsites as a required field. When we upload anything but an Office 2007 document, the user is presented with the document metadata fill-in screen (EditForm.aspx?Mode=Upload), the user fills in the appropriate data (including picking a value(s) for this lookup), and clicks "check in" - the document is checked in as expected, with the lookup field's value filled in.
With an Office 2007 document, this fails. The user selected values for the lookup field do not ever make it to the server - no errors are thrown, but the field is not saved with the document. We have an event listener on these document libraries, and if we inspect the incoming SPListItem on the event listener method before a single line of our code has run, we see that the value for the lookup field is null.
It smells like a SharePoint bug to me - but before I go calling Microsoft, has anyone seen this & worked around it?
Edit: the only entry I see in the SP trace logs relating to the problem:
CMS/Publishing/8ztg/Medium/Got List Item Version, but item was null
Wound up having to open a ticket with Microsoft for this one, and found a bug in the MSDN documentation to boot.
In order to get a multiselect lookup, we had been setting the "Mult" attribute in our lookup field CAML to "true" in the XML we passed to SPFieldCollection.AddFieldAsXml. However, even though the API will throw no errors & appear to work in the UI, this clashes with how Office 2007 & 2010 documents & their SharePoint integration works.
The official, supported way to add a multiselect lookup field is to use the LookupMulti field type in the Field CAML. Doing this, and setting the "Mult" attribute to "true" gives the result I was looking for.
The MSDN documentation for "Mult" has still not been updated for the SP 2007 documentation, and can safely be ignored as it is completely wrong.

Resources