Hello,
Is there any way to customize the menu item icon for the custom EntityType?
The menu item is added automatically by enabling the Visible in Business Data flag in EntityType configuration, and it uses the icon-core-et-sm-generic icon class by default.
I’ve been fiddling with the metadata trying to override the menuItems() but with no luck.
Please help to confirm if it is possible to specify the MenuItem’s icon for custom EntityTypes that simply enable the Visible in Business Data flag, or it is essential to fully customize a page component to acheive this.
Thank you.
Timmy.
Hi Timmy,
Entity Types have a “Icon” property that I think you can set:
-
When creating your entity using master data.
-
Alternatively, using a DEE.
The dee should point to iconClass available on the application. You may see the list of icons available by default at:
https://help.criticalmanufacturing.com/11.1/Reference/DesignSystem/Icons
Best regards,
João Moreira
Ps. Try it and let us know the results.
Hello João,
Thank you for your response. I can’t paste images in the reply so please allow me to respond here.
I’ve managed to set the icon for the custom entity type, but only when creating a new entity type (i.e. specifying Icon in the CreateEntityTypeInput).
UPDATE:
After **deleting ****cache **by User Menu > About > Delete Cache, the icon in the Business Data is updated, and is changing dynamically **everytime **after executing the icon-updating-DEE.
I’ve tried to set the icon for an existing entity via the update entity type operation, the icon value in the database is updated, but the menu icon remains default.
entityTypeMaintenanceGroup.Icon = “icon-core-st-lg-group”;
UpdateEntityTypeInput updateInput = new (){
EntityType = entityTypeMaintenanceGroup
};
entityTypeOrchestration.UpdateEntityType(updateInput);
What’s the correct procedure to fully update an EntityType?
Another question related to the custom EntityType is the name localization.
The localized name can be displayed on the Business Data
But the entity type’s original name is displayed in the instance’s detail section, is this a expected result?
Hello João,Thanks for your reply, please see the details in another answer. Thank you.
Hi Timmy,
I think you are using the correct procedure to update the entity information. You are probably hitting cache issues.
To check if this is the case, follow these hints to identify the root cause, after updating your entity icon:
- Try accessing MES in incognito mode.
- Try restarting MEs message bus service. Then, try accessing MES again in incognito mode.
- Try regenerating the entity (this might refresh its metadata within the system). This is less likely to be the issue, but it’s worth a try if the other steps don’t work. This might be necessary if the entity’s definition itself is cached somewhere.
Regarding the type name localization in the “Details”, I can not assure you whether this is expected behavior or not, please open a support ticket to validate that.
Regards,
João Moreira
I think the cause is most likely the cache you have mentioned, but I can never reproduce the same issue, even not clearing the cache or browsing in incognito mode, the icon is updated right after the DEE execution. Thanks again for the idea of using MD or DEE to set/update the icon. Cheers.