Hello,
is there a way to retrieve Resx-Webresources over PCF.
I've tried to achieve this via the "getResourceString"-methode over the XRM object.
I have also added the following feature-usage configuration:
Solved! Go to Solution.
Hi @TheTruePowerDev ,
The feature for Utility is called only "Utility". Here are the examples: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/manifest-schema-reference...
If you do that, you get access to context.utils: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/context#utils, but you have only 3 methods there: getEntityMetadata, hasEntityPrivilege, lookupObjects: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/utility?WT.mc_i...
BUT, in PCF sdk there is a Resources namespace: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/resources?WT.mc...
You have there getResource and getString methods. This will work with the resources you've added to your PCF manifest, like resx, css, images, and that's the supported way: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/manifest-schema-reference...
So, for accessing resx packed inside your PCF, you can use these resources methods. The problem with that: you have to deliver the resx inside the PCF package. You can find more details about localizations for instance in Ivan's blog: https://dynamicsninja.blog/2020/01/21/pcf-localization/
If you try to access resx WebResources that are not part of the PCF, you'll need some hacks.In my opinion that's not really supported.
Using the Xrm object inside the PCF is not supported.
You may try to access the WebResource address on your own, but I'm not sure if that will work in all cases/devices/apps.
You could try to build the url on your own, but you probably won't be able to access the cached version of the WebResource.
Hope this helps!
Hi @TheTruePowerDev ,
The feature for Utility is called only "Utility". Here are the examples: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/manifest-schema-reference...
If you do that, you get access to context.utils: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/context#utils, but you have only 3 methods there: getEntityMetadata, hasEntityPrivilege, lookupObjects: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/utility?WT.mc_i...
BUT, in PCF sdk there is a Resources namespace: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/resources?WT.mc...
You have there getResource and getString methods. This will work with the resources you've added to your PCF manifest, like resx, css, images, and that's the supported way: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/manifest-schema-reference...
So, for accessing resx packed inside your PCF, you can use these resources methods. The problem with that: you have to deliver the resx inside the PCF package. You can find more details about localizations for instance in Ivan's blog: https://dynamicsninja.blog/2020/01/21/pcf-localization/
If you try to access resx WebResources that are not part of the PCF, you'll need some hacks.In my opinion that's not really supported.
Using the Xrm object inside the PCF is not supported.
You may try to access the WebResource address on your own, but I'm not sure if that will work in all cases/devices/apps.
You could try to build the url on your own, but you probably won't be able to access the cached version of the WebResource.
Hope this helps!
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |