Skip to content

Commit a170e5a

Browse files
committed
Merge remote-tracking branch 'origin/master' into sama-zaki-athena-updates
2 parents 37b6a1e + 83faeeb commit a170e5a

File tree

5 files changed

+61
-3
lines changed

5 files changed

+61
-3
lines changed

powerapps-docs/developer/data-platform/best-practices/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
items:
3636
- name: Service Protection API Limits
3737
href: ../api-limits.md
38+
- name: Manage invalid characters
39+
href: work-with-data/invalidcharactersinfield.md
3840
- name: Work with metadata using code
3941
href: work-with-metadata/index.md
4042
items:

powerapps-docs/developer/data-platform/best-practices/work-with-data/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This list below contains all of the best practices and guidance around integrati
3030
|Best Practice |Description |
3131
|---------|---------|
3232
|[Service protection API limits (Dataverse)](../../api-limits.md) |Understand the limits for API requests. |
33+
|[Manage invalid characters](invalidcharactersinfield.md)| Manage invalid characters |
3334

3435
### See Also
3536

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: "Manage invalid characters | Microsoft Docs"
3+
description: Describes how to manage invalid characters.
4+
5+
ms.date: 08/09/2021
6+
ms.reviewer: "pehecke"
7+
ms.service: powerapps
8+
ms.topic: "article"
9+
author: "JimDaly"
10+
ms.subservice: dataverse-developer
11+
ms.author: "pehecke"
12+
manager: "kvivek"
13+
search.audienceType:
14+
- developer
15+
search.app:
16+
- PowerApps
17+
- D365CE
18+
---
19+
20+
# Manage invalid characters
21+
22+
There are a set of characters that cannot be saved in string or memo columns. When an application saves data containing these characters to Dataverse, the following error will occur:
23+
24+
Name: `InvalidCharactersInField`<br />
25+
Hexadecimal error code : `80040278`<br />
26+
Error Number: `-2147220872`<br />
27+
Description: `The field '{0}' contains one or more invalid characters.`<br />
28+
29+
Dataverse uses the [System.Xml.XmlConvert.VerifyXmlChars(String) Method](/dotnet/api/system.xml.xmlconvert.verifyxmlchars) for every string value passed to these columns. This error is thrown on the first invalid character encountered.
30+
31+
You may encounter these characters in email content that includes replies or when text is copied from another source which may have characters to control presentation.
32+
33+
To prevent this error you can:
34+
35+
- HTML encode the content before saving.
36+
37+
- Remove the individual invalid characters, use the [System.Xml.XmlConvert.IsXmlChar(Char) Method](/dotnet/api/system.xml.xmlconvert.isxmlchar) as shown in the following example:
38+
39+
```csharp
40+
static string RemoveInvalidXmlChars(string text) {
41+
var validXmlChars = text.Where(ch => XmlConvert.IsXmlChar(ch)).ToArray();
42+
return new string(validXmlChars);
43+
}
44+
```
45+
46+
47+
### See Also
48+
49+
[Work with data using code in Dataverse (Power Apps)](../../work-with-data.md)<br />
50+
51+
[!INCLUDE[footer-include](../../../../includes/footer-banner.md)]
52+

powerapps-docs/developer/data-platform/powerapps-cli.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ Commands for working with [Dataverse solution projects](../../maker/data-platfor
218218
|upgrade|Command to upgrade the solution. It has the following parameters: <ul><li> *solution-name*: Name of the solution (alias:-sn).</li><li> *async*: Upgrades the solution asynchronously (alias: -a).</li><li>*max-async-wait-time*: Maximum asynchronous wait time in minutes. Default value is 60 minutes (alias: -wt).</li></ul>|`pac solution upgrade --solution-name SampleSolution --async --max-async-wait-time 60`|
219219
|add-license|Add license and plan info the solution. It has the following parameters: <ul><li>*planDefinitionFile*: License plan definition file in CSV format; expected columns: *Service ID, Display name, More info URL* (alias: -pd)</li><li>*planMappingFile*: License plan mapping file in CSV format; expected values: *Service ID, Component name* (alias: -pm)</li></ul>||
220220
|publish|Publishes all the customizations.|`pac solution publish`|
221+
|create-settings|Provides the ability to create a settings file that captures the environment variables and connection references in the setting. It has the following parameters: <ul><li>*solution zip*: Absolute path name or relative path name to the exported solution file (alias: -z).</li><li>*solution folder*: Folder ___location of the cloned solution on the filesystem, you can either use solution zip file or the solution folder ___location, not both together (alias: -f).</li><li> *settings file*: Location of the file to be created with the environment variable and connection reference information. The format of the created file is JSON (alias: -s).</li></ul>|`pac solution create-settings --solution-zip C:\SampleSolution.zip --settings-file .\SampleDeploymentSettingsDev.json`|
222+
|unpack|Provides the ability to unpack solution zip files after they have been exported to the filesystem. It has the following parameters: <ul><li>*zip file*: Absolute path name or relative path name to the exported solution file (alias: -z).</li><li>*folder*: The path to the root folder on the local filesystem. This will be the folder where the unpacked contents will be written (alias: -f).</li><li> *package type*: Use to specify dual managed and unmanaged operation (alias: -p).</li> <li> *log*: The path to the log file (alias: -l).</li><li> *error level*: Minimum logging level for log output. It has the following values: *Verbose, Info, Warning, Error, Off*. Default value is *Info* (alias: -e).</li><li> *single Component*: Performs the action on a single component type. It has the following values: *WebResource, Plugin, Workflow, None*. Default value is *None* (alias: -sc).</li><li> *allow Delete*: Specifies if the delete operations should occur or not. It has the following values: *Yes, No, Prompt*. Default is *Prompt* (alias: -ad).</li><li> *allow Write*: Specifies if the write operations should occur or not. Default value is false (alias: -aw).</li><li> *clobber*: Enables to delete or overwrite the files that are marked as read-only. Default value is false (alias: -c).</li><li> *map*: The full path to the mapping XML file that reads component folders to pack (alias: -m).</li><li> *sourceLoc*: Generates a template resource file. It has the following values: *auto, LCID, ISO code* of the language you wish to export. When set, this will extract the string resources from the given locale as a neutral resx file. If auto or just the long or short form of the switch is specified the base locale for the solution will be used (alias: -src).</li><li> *localize*: Extract or merge all string resources into `.resx` files (alias: -loc)</li><li> *use Lcid*: Use LCID's (1033) rather than ISO codes (en-US) for language files (alias: -lcid).</li><li> *use Unmanaged File for Missing Managed*: Use the same XML source file when packaging for managed and only unmanaged XML file is found. Applies to `AppModuleSiteMap`, `AppModuleMap`, `FormXml` files (alias: -same).</li></ul>|`pac solution unpack --solution-zip C:\SampleSolution.zip --folder .\SampleSolutionUnpacked\.`|
223+
|pack|Provides the ability to pack files on a filesystem into a solution zip file. It has the following parameters: <ul><li>*zip file*: Absolute path name or relative path name to the generated solution zip file (alias: -z).</li><li>*folder*: The path to the root folder on the local filesystem, this will be the folder from where the contents will be read from (alias: -f).</li><li> *package type*: Use to specify dual managed and unmanaged operation (alias: -p).</li> <li> *log*: The path to the log file (alias: -l).</li><li> *error level*: Minimum logging level for log output. It has the following values: *Verbose, Info, Warning, Error, Off*. Default value is *Info* (alias: -e).</li><li> *single Component*: Performs the action on a single component type. It has the following values: *WebResource, Plugin, Workflow, None*. Default value is *None* (alias: -sc).</li><li> *allow Delete*: Specifies if the delete operations should occur or not. It has the following values: *Yes, No, Prompt*. Default is *Prompt* (alias: -ad).</li><li> *allow Write*: Specifies if the write operations should occur or not. Default value is false (alias: -aw).</li><li> *clobber*: Enables to delete or overwrite the files that are marked as read-only. Default value is false (alias: -c).</li><li> *map*: The full path to the mapping XML file that reads component folders to pack (alias: -m).</li><li> *sourceLoc*: Generates a template resource file. It has the following values: *auto, LCID, ISO code* of the language you wish to export. When set, this will extract the string resources from the given locale as a neutral resx file. If auto or just the long or short form of the switch is specified the base locale for the solution will be used (alias: -src).</li><li> *localize*: Extract or merge all string resources into `.resx` files (alias: -loc)</li><li> *use Lcid*: Use LCID's (1033) rather than ISO codes (en-US) for language files (alias: -lcid).</li><li> *use Unmanaged File for Missing Managed*: Use the same XML source file when packaging for managed and only unmanaged XML file is found. Applies to `AppModuleSiteMap`, `AppModuleMap`, `FormXml` files (alias: -same).</li></ul>|`pac solution pack --solution-zip C:\SampleSolution.zip --folder .\SampleSolutionUnpacked\.`|
221224
222225
### Auth
223226

powerapps-docs/developer/model-driven-apps/clientapi/reference/Xrm-Utility/getGlobalContext/userSettings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ On success, returns a promise object containing the values specified in the desc
187187

188188
### Example
189189

190-
```
190+
```javascript
191191
userSettings
192192
.getSecurityRolePrivilegesInfo()
193193
.then(function success(rolePrivileges) {
@@ -198,8 +198,8 @@ userSettings
198198
var guid = privilegeGuids[0];
199199
console.log("Privilege Id: " + privilege[guid].id);
200200
console.log("Privilege Name: " + privilege[guid].privilegeName);
201-
console.log("Privilege Business Unit Id: " + privilege[guid].businessUnitId);
202-
console.log("Privilege depth: " + privilege[guid].depth);
201+
console.log("Privilege Business Unit Id: " + rolePrivileges[guid].businessUnitId);
202+
console.log("Privilege depth: " + rolePrivileges[guid].depth);
203203
});
204204
```
205205

0 commit comments

Comments
 (0)