Skip to content

Commit c9d01f3

Browse files
fixed polylookup in readonly form (#74)
* Bump postcss from 8.4.29 to 8.4.31 in /LookdownComponent (#71) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.29 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.29...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump postcss from 8.4.21 to 8.4.31 in /PolyLookupComponent (#70) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.21 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.21...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fixed selected items not loaded in readonly form. fixed displaying controls in form editor. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent afad699 commit c9d01f3

8 files changed

Lines changed: 42 additions & 32 deletions

File tree

LookdownComponent/Lookdown/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="DCEPCF" constructor="Lookdown" version="1.0.0" display-name-key="Lookdown v1.0.0" description-key="Display a lookup control as a dropdown" control-type="virtual" >
3+
<control namespace="DCEPCF" constructor="Lookdown" version="1.0.1" display-name-key="Lookdown v1.0.1" description-key="Display a lookup control as a dropdown" control-type="virtual" >
44
<external-service-usage enabled="false">
55
<!--UNCOMMENT TO ADD EXTERNAL DOMAINS
66
<domain></domain>

LookdownComponent/Lookdown/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class Lookdown implements ComponentFramework.ReactControl<IInputs, IOutpu
4444
return React.createElement(LookdownControl, {
4545
lookupViewId: isAuthoringMode ? undefined : context.parameters.lookupField.getViewId(),
4646
lookupEntity: isAuthoringMode ? undefined : context.parameters.lookupField.getTargetEntityType(),
47-
selectedId: context.parameters.lookupField.raw?.at(0)?.id,
47+
selectedId: context.parameters.lookupField?.raw?.at(0)?.id,
4848
customFilter: context.parameters.customFilter?.raw,
4949
groupBy: context.parameters.groupByField?.raw,
5050
showIcon: context.parameters.showIcon?.raw

LookdownComponent/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PolyLookupComponent/PolyLookup/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="DCEPCF" constructor="PolyLookup" version="1.1.3" display-name-key="PolyLookup v1.1.3" description-key="Multi-select lookup supporting different type of many-to-many relationships." control-type="virtual" >
3+
<control namespace="DCEPCF" constructor="PolyLookup" version="1.1.4" display-name-key="PolyLookup v1.1.4" description-key="Multi-select lookup supporting different type of many-to-many relationships." control-type="virtual" >
44
<!--external-service-usage node declares whether this 3rd party PCF control is using external service or not, if yes, this control will be considered as premium and please also add the external domain it is using.
55
If it is not using any external service, please set the enabled="false" and DO NOT add any domain below. The "enabled" will be false by default.
66
Example1:

PolyLookupComponent/PolyLookup/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ export class PolyLookup implements ComponentFramework.ReactControl<IInputs, IOut
4545
const props: PolyLookupProps = {
4646
currentTable: context.page.entityTypeName,
4747
currentRecordId: context.page.entityId,
48-
relationshipName: context.parameters.relationship.raw ?? "",
49-
relationship2Name: context.parameters.relationship2.raw ?? undefined,
48+
relationshipName: context.parameters.relationship?.raw ?? "",
49+
relationship2Name: context.parameters.relationship2?.raw ?? undefined,
5050
relationshipType: Number.parseInt(context.parameters.relationshipType.raw) as RelationshipTypeEnum,
5151
clientUrl: clientUrl,
52-
lookupView: context.parameters.lookupView.raw ?? undefined,
53-
itemLimit: context.parameters.itemLimit.raw ?? undefined,
54-
pageSize: context.userSettings.pagingLimit ?? undefined,
52+
lookupView: context.parameters.lookupView?.raw ?? undefined,
53+
itemLimit: context.parameters.itemLimit?.raw ?? undefined,
54+
pageSize: context.userSettings?.pagingLimit ?? undefined,
5555
disabled: context.mode.isControlDisabled,
5656
formType: typeof Xrm === "undefined" ? undefined : Xrm.Page.ui.getFormType(),
5757
outputSelectedItems: !!context.parameters.outputField.attributes?.LogicalName,
5858
onChange:
5959
context.parameters.outputSelected.raw === "1" || context.parameters.outputField.attributes?.LogicalName
6060
? this.onLookupChange
6161
: undefined,
62-
onQuickCreate: context.parameters.allowQuickCreate.raw === "1" ? this.onQuickCreate : undefined,
62+
onQuickCreate: context.parameters.allowQuickCreate?.raw === "1" ? this.onQuickCreate : undefined,
6363
};
6464
return React.createElement(PolyLookupControl, props);
6565
}

PolyLookupComponent/PolyLookup/services/DataverseService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function useSelectedItems(
100100
enabled:
101101
!!metadata?.intersectEntity.EntitySetName &&
102102
!!metadata?.associatedEntity.EntitySetName &&
103-
formType === XrmEnum.FormType.Update,
103+
(formType === XrmEnum.FormType.Update || formType === XrmEnum.FormType.ReadOnly),
104104
});
105105
}
106106

PolyLookupComponent/package-lock.json

Lines changed: 24 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

solution/src/Other/Solution.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<LocalizedName description="DCE PCF Components" languagecode="1033" />
99
</LocalizedNames>
1010
<Descriptions />
11-
<Version>1.0.3.0</Version>
11+
<Version>1.0.3.1</Version>
1212
<!-- Solution Package Type: Unmanaged(0)/Managed(1)/Both(2)-->
1313
<Managed>2</Managed>
1414
<Publisher>
@@ -20,7 +20,7 @@
2020
</LocalizedNames>
2121
<Descriptions>
2222
<!-- Description of Cds Publisher in language code -->
23-
<Description description="DynamicsCrmExp PCF Components Library.&#xA;- PolyLookup v1.1.3&#xA;- Lookdown v1.0.0&#xA;&#xA;For feedback and report issues, please visit: https://github.com/khoait/DCE.PCF/issues" languagecode="1033" />
23+
<Description description="DynamicsCrmExp PCF Components Library.&#xA;- PolyLookup v1.1.4&#xA;- Lookdown v1.0.1&#xA;&#xA;For feedback and report issues, please visit: https://github.com/khoait/DCE.PCF/issues" languagecode="1033" />
2424
</Descriptions>
2525
<EMailAddress xsi:nil="true"></EMailAddress>
2626
<SupportingWebsiteUrl xsi:nil="true"></SupportingWebsiteUrl>

0 commit comments

Comments
 (0)