We want to hide some acumatica screen from site map while published our customization package.
For this I have Write code in master data Plugin its working fine for single tenant but in case of multiple tenant it's not working.
I am Getting error PX.Data.PXLockViolationException Message "Error: Another process has updated the 'MUIScreen' record. Your changes will be lost." string
Below is code:--
SiteMapMaint graph = PXGraph.CreateInstance(); List siteNodeList = EWPMMasterDataHelper.GetSiteNodesData();
foreach(EWPMSiteMapDTO siteNodeDTO in siteNodeList) {
foreach(PX.SiteMap.DAC.SiteMap siteMap in PXSelect<PX.SiteMap.DAC.SiteMap,
Where<PX.SiteMap.DAC.SiteMap.screenID, Equal<Required<PX.SiteMap.DAC.SiteMap.screenID>>>>.Select(graph, siteNodeDTO.ScreenID)) {
// Check Screen is exits on site node or not.
if(siteMap != null && (siteMap.Workspaces == ProductionOrderworkSpaceID.ToString() || siteMap.Workspaces == BillOfMaterialWorkSpaceID.ToString())) {
siteMap.Workspaces = emptyWorkSpaceID.ToString();
graph.SiteMap.Update(siteMap);
}
}
} graph.Actions.PressSave();