Skip to content

Commit 17b851b

Browse files
authored
Merge pull request #11 from durgaprasadkatari/master
Fixed the issue while loading related entity lookup.
2 parents cd9ac7b + ab06bbb commit 17b851b

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Solution/SAB.XrmPowerControls.XrmMetadataAutoComplete/src/Other/Solution.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<LocalizedName description="SAB.XrmPowerControls.XrmMetadataAutoComplete" languagecode="1033" />
99
</LocalizedNames>
1010
<Descriptions />
11-
<Version>2.0.8</Version>
11+
<Version>2.0.13</Version>
1212
<!-- Solution Package Type: Unmanaged(0)/Managed(1)/Both(2)-->
1313
<Managed>2</Managed>
1414
<Publisher>

XrmMetadataAutoComplete/ControlManifest.Input.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest>
3-
<control namespace="SAB.XrmPowerControls" constructor="XrmMetadataAutoComplete" version="0.0.3" display-name-key="XrmMetadataAutoComplete" description-key="XrmMetadataAutoComplete description" control-type="standard">
3+
<control namespace="SAB.XrmPowerControls" constructor="XrmMetadataAutoComplete" version="0.0.6" display-name-key="XrmMetadataAutoComplete" description-key="XrmMetadataAutoComplete description" control-type="standard">
44
<!-- property node identifies a specific, configurable piece of data that the control expects from CDS -->
55
<property name="selectedValue" display-name-key="Selected Vaue" description-key="Selected field Value" of-type="SingleLine.Text" usage="bound" required="true" />
66
<property name="autoCompleteMetaDataType" display-name-key="AutoCompleteMetaDataType" description-key="AutoComplete MetaData Type" of-type="Enum" usage="input" required="true">

XrmMetadataAutoComplete/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class XrmMetadataAutoComplete implements ComponentFramework.StandardContr
117117

118118
var namefield = "LogicalName";
119119
var idField = "MetadataId";
120-
if(metadataType != "Entity" && relatedEntityName != this.entity)
120+
if((metadataType != "Entity" && relatedEntityName != this.entity) || (metadataType == "Entity" && (filterEntityFieldByEntitiesAssociatedTo != undefined || filterEntityFieldByEntitiesAssociatedTo != null)))
121121
{
122122
this.entity = relatedEntityName||"";
123123
ReactDOM.unmountComponentAtNode(this._divContainer);
@@ -163,7 +163,7 @@ export class XrmMetadataAutoComplete implements ComponentFramework.StandardContr
163163
//First sort the array and then run through it and then see if the next (or previous) index is the same as the current.
164164
const sortedArr = data.slice().sort();
165165
for (var i = 0; i < data.length - 1; i++) {
166-
if (sortedArr[i] === stringToSearch) {
166+
if (sortedArr[i].searchValue === stringToSearch) {
167167
return true;
168168
}
169169
}
@@ -272,7 +272,7 @@ export class XrmMetadataAutoComplete implements ComponentFramework.StandardContr
272272
}
273273
else
274274
{
275-
if(dataJson[i]["DisplayName"]["LocalizedLabels"].length>0)
275+
if(dataJson[i]["DisplayName"]!=undefined && dataJson[i]["DisplayName"].length>0 && dataJson[i]["DisplayName"]["LocalizedLabels"].length>0)
276276
{
277277
results.push({ key: i, displayValue: dataJson[i]["DisplayName"]["LocalizedLabels"][0]["Label"]+" ("+dataJson[i][namefield]+")",searchValue:dataJson[i][namefield] });
278278
}

0 commit comments

Comments
 (0)