Forum Discussion

team_aras_meupe_com's avatar
2 years ago
Solved

BOM Structure. Add a field

Good morning companions,
I am trying to add a field to the "BOM Structure", impossible, I can't find the key.

In the form "Part MultiLevel BOM Grid" in "HTML Code" there is the function:

[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3fbbcb4d-8d06-46f4-8d00-30ad50e94e3a:type=javascript&text=function%20getItemTree%28itemID%2C%20queryLevel%29%20%7B%0D%0Adebugger%3B%0D%0A%09%09var%20treeLoadXml%20%3D%20top.aras.createXMLDocument%28%29%3B%0D%0A%09%09treeLoadXml.load%28xmlFileBase%20%2B%20%22query.xml%22%29%3B%0D%0A%09%09if%20%28treeLoadXml.parseError.errorCode%20%21%3D%200%29%20%7B%0D%0A%09%09%09var%20loadError%20%3D%20treeLoadXml.parseError%3B%0D%0A%09%09%09top.aras.AlertError%28%22You%20have%20error%3A%5Cn%22%20%2B%20loadError.reason%29%3B%0D%0A%09%09%09return%3B%0D%0A%09%09%7D%0D%0A%09%09var%20partBom%20%3D%20treeLoadXml.selectSingleNode%28%22Item%2FRelationships%2FItem%5B%40repeatTimes%5D%22%29%3B%0D%0A%09%09partBom.setAttribute%28%22repeatTimes%22%2C%20queryLevel%29%3B%0D%0A%0D%0A%09%09var%20query%20%3D%20innovator.newItem%28%29%3B%0D%0A%09%09query.loadAML%28treeLoadXml.xml%29%3B%0D%0A%09%09query.setID%28itemID%29%3B%0D%0A%09%09var%20results%20%3D%20query.apply%28%29%3B%0D%0A%09%09if%20%28results.isError%28%29%29%20%7B%0D%0A%09%09%09top.aras.AlertError%28results.getErrorString%28%29%29%3B%0D%0A%09%09%09return%3B%0D%0A%09%09%7D%0D%0A%09%09return%20results%3B%0D%0A%09%7D%0D%0A]

Which loads the Query.xml file. In that file is the AML that loads the data:

[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3bffcd32-7ca6-48b5-ad8f-da4c4139543f:type=xml&text=%3CItem%20type%3D%22Part%22%20select%3D%22name%2Citem_number%2Clocked_by_id%2Cmajor_rev%2Cstate%2Cmake_buy%22%20action%3D%22GetItemRepeatConfig%22%3E%0A%09%3CRelationships%3E%0A%20%20%20%20%20%09%09%3CItem%20type%3D%22Part%20BOM%22%20select%3D%22related_id%2Cquantity%2Csort_order%2Creference_designator%22%20repeatProp%3D%22related_id%22%20repeatTimes%3D%220%22%3E%0A%09%09%09%3Crelated_id%3E%0A%09%09%09%09%3CItem%20type%3D%22Part%22%3E%3C%2FItem%3E%0A%09%09%09%3C%2Frelated_id%3E%0A%09%09%3C%2FItem%3E%0A%09%3C%2FRelationships%3E%0A%3C%2FItem%3E]

It seems simple, but no. The function that loads the XML file with the AML code never enters it. I have even deleted the file from the server and it continues to show the same data.

I have managed to add the column to the grid, but I don't know where to add the field from which the value should be taken.

Any ideas?. Keep in mind that I use Version 11.0 SP9 which does not have TGV or anything at all.

This is the code of the method "PE_GetMultilBom":

[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:e657d17b-55bb-4818-b24a-018eca7a12ed:type=text&text=%09%09Innovator%20inn%20%3D%20this.getInnovator%28%29%3B%0A%09%09%0A%09%09if%20%28%21String.Equals%28this.getType%28%29%2C%20%22Part%22%2C%20StringComparison.Ordinal%29%29%0A%09%09%20%20%20%20return%20inn.newError%28%22Item%20of%20type%20Part%20required%22%29%3B%0A%09%09%0A%09%09string%20partId%20%3D%20this.getID%28%29%3B%0A%09%09if%20%28String.IsNullOrEmpty%28partId%29%29%0A%09%09%20%20%20%20return%20inn.newError%28%22Part%20ID%20not%20specified%22%29%3B%0A%09%09%0A%09%09DictsForMultiBom%20dictOfData%20%3D%20new%20DictsForMultiBom%28%29%3B%0A%09%09%0A%09%09GetDataForParsing%20getDataForParsing%20%3D%20new%20GetDataForParsing%28inn.getUserID%28%29%2C%20this%29%3B%0A%09%09getDataForParsing.SetDataToDict%28dictOfData%29%3B%0A%09%09%09%09%0A%09%09GetMultiBom%20ret%20%3D%20new%20GetMultiBom%28CCO%29%3B%09%09%0A%09%09string%20parsedData4Return%20%3D%20ret.GetCompleteBom%28dictOfData%29%3B%0A%09%09%0A%09%09return%20inn.newResult%28parsedData4Return%29%3B%0A%09%7D%0A%7D%0A%0Aclass%20DictsForMultiBom%0A%7B%0A%09public%20Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%20dictAllItems%3B%0A%09public%20List%3CInfoOfItem%3E%20zeroLevelItems%3B%0A%7D%0A%0Aclass%20InfoOfItem%0A%7B%0A%09public%20string%20level%3B%0A%09public%20string%20id%3B%0A%09public%20string%20item_number%3B%0A%09public%20string%20revision%3B%0A%09public%20string%20state%3B%0A%09public%20string%20sort_order%3B%0A%09public%20string%20quantity%3B%0A%09public%20string%20lockedId%3B%0A%09public%20string%20name%3B%0A%09public%20string%20brd%3B%0A%09%0A%09public%20string%20make_buy%3B%20%2F%2Ffer%0A%7D%0A%0Aclass%20GetDataForParsing%0A%7B%0A%09private%20string%20thisUserID%3B%0A%09private%20Item%20item%3B%0A%09%0A%09public%20GetDataForParsing%28string%20userId%2C%20Item%20part%29%0A%09%7B%0A%09%09this.thisUserID%20%3D%20userId%3B%0A%09%09this.item%20%3D%20part%3B%0A%09%7D%0A%09%0A%09public%20void%20SetDataToDict%28DictsForMultiBom%20dictOfData%29%0A%09%7B%0A%09%09Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%20dictItemProp%20%3D%20new%20Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%28%29%3B%0A%09%09List%3CInfoOfItem%3E%20zeroLevelItems%20%3D%20new%20List%3CInfoOfItem%3E%28%29%3B%0A%09%09Item%20itemList%20%3D%20this.GetAllItems%28%29%3B%0A%09%09%0A%09%09int%20itemsCount%20%3D%20itemList.getItemCount%28%29%3B%0A%09%09if%20%28itemsCount%20%3D%3D%200%29%20return%3B%0A%09%09%0A%09%09for%20%28int%20i%20%3D%200%3B%20i%20%3C%20itemsCount%3B%20i%2B%2B%29%0A%09%09%7B%0A%09%09%09Item%20itm%20%3D%20%20itemList.getItemByIndex%28i%29%3B%0A%09%09%09InfoOfItem%20infoOfItem%20%3D%20new%20InfoOfItem%28%29%3B%0A%09%09%09infoOfItem.level%20%3D%20itm.getProperty%28%22level%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.id%20%3D%20itm.getProperty%28%22related_id%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.item_number%20%3D%20itm.getProperty%28%22related_item_number%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.revision%20%3D%20itm.getProperty%28%22related_revision%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.state%20%3D%20itm.getProperty%28%22related_state%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.sort_order%20%3D%20itm.getProperty%28%22sort_order%22%2C%20%22%22%29%3B%0A%09%09%09%0A%09%09%09infoOfItem.make_buy%20%3D%20itm.getProperty%28%22make_buy%22%2C%20%22%22%29%3B%20%2F%2F%20fer%0A%09%09%09%0A%09%09%09infoOfItem.quantity%20%3D%20itm.getProperty%28%22quantity%22%2C%20%22%22%29%3B%0A%09%09%09string%20lockedBY%20%3D%20itm.getProperty%28%22related_locked_by_id%22%2C%20%22%22%29%3B%0A%09%09%09if%20%28lockedBY%20%21%3D%20%22%22%29%0A%09%09%09%09infoOfItem.lockedId%20%3D%20%28lockedBY%20%3D%3D%20this.thisUserID%29%20%3F%20%22%3Cimg%20src%3D%5C%22..%2Fimages%2FLockedByMe.svg%5C%22%20%2F%3E%22%20%3A%20%22%3Cimg%20src%3D%5C%22..%2Fimages%2FLockedByMe.svg%5C%22%20%2F%3E%22%3B%0A%09%09%09else%0A%09%09%09%09infoOfItem.lockedId%20%3D%20%22%3Cemptytag%20%2F%3E%22%3B%0A%09%09%09infoOfItem.name%20%3D%20itm.getProperty%28%22related_name%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.brd%20%3D%20itm.getProperty%28%22bom_ref_desg%22%2C%20%22%22%29%3B%0A%09%09%09%0A%09%09%09if%20%28infoOfItem.level%20%3D%3D%20%220%22%29%20zeroLevelItems.Add%28infoOfItem%29%3B%0A%09%09%09%0A%09%09%09string%20source_id%20%3D%20string.Empty%3B%0A%09%09%09source_id%20%3D%20itm.getProperty%28%22source_id%22%2C%20%22%22%29%3B%0A%09%09%09%0A%09%09%09if%20%28source_id%20%3D%3D%20%22%22%29%20continue%3B%0A%09%09%09%0A%09%09%09List%3CInfoOfItem%3E%20dataOfItemList%3B%0A%09%09%09%0A%09%09%09dictItemProp.TryGetValue%28source_id%2C%20out%20dataOfItemList%29%3B%0A%09%09%09if%20%28dataOfItemList%20%21%3D%20null%29%0A%09%09%09%7B%0A%09%09%09%09dataOfItemList.Add%28infoOfItem%29%3B%0A%09%09%09%7D%0A%09%09%09else%0A%09%09%09%7B%0A%09%09%09%09List%3CInfoOfItem%3E%20datList%20%3D%20new%20List%3CInfoOfItem%3E%28%29%3B%0A%09%09%09%09datList.Add%28infoOfItem%29%3B%0A%09%09%09%09dictItemProp.Add%28source_id%2C%20datList%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09dictOfData.dictAllItems%20%3D%20dictItemProp%3B%0A%09%09dictOfData.zeroLevelItems%20%3D%20zeroLevelItems%3B%0A%09%7D%0A%09%0A%09private%20Item%20GetAllItems%28%29%0A%09%7B%0A%09%09Item%20callframe%20%3D%20item.newItem%28%22SQL%22%2C%20%22SQL%20PROCESS%22%29%3B%0A%09%09callframe.setProperty%28%22name%22%2C%20%22MultiBom_GetCompleteBom1%22%29%3B%0A%09%09callframe.setProperty%28%22PROCESS%22%2C%20%22CALL%22%29%3B%0A%09%09callframe.setProperty%28%22ARG1%22%2C%20item.getID%28%29%29%3B%0A%09%09%0A%09%09return%20callframe.apply%28%29%3B%0A%09%7D%0A%7D%0A%0Aclass%20GetMultiBom%0A%7B%0A%09private%20const%20String%20InnovatorCCOUID%20%3D%20%22PE_GetRelatedParts_InnovatorCCO%22%3B%0A%09%0A%09public%20GetMultiBom%28Aras.Server.Core.CallContext%20CCO%29%0A%09%7B%0A%09%09HttpContext.Current.Items%5BInnovatorCCOUID%5D%20%3D%20CCO%3B%0A%09%7D%0A%09%0A%09private%20Aras.Server.Core.CallContext%20GetCCO%28%29%0A%09%7B%0A%09%09return%20%28Aras.Server.Core.CallContext%29HttpContext.Current.Items%5BInnovatorCCOUID%5D%3B%0A%09%7D%0A%09%0A%09public%20string%20GetCompleteBom%28DictsForMultiBom%20dictOfData%29%0A%09%7B%0A%09%09Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%20dictAllItems%20%3D%20dictOfData.dictAllItems%3B%0A%09%09List%3CInfoOfItem%3E%20zeroLevelItems%20%3D%20dictOfData.zeroLevelItems%3B%0A%09%09%0A%09%09StringBuilder%20itemStylesheet%20%3D%20new%20StringBuilder%28%29%3B%0A%09%09this.GetBaseTamplate%28itemStylesheet%29%3B%0A%09%09%0A%09%09if%20%28dictAllItems%20%21%3D%20null%20%26%26%20dictAllItems.Count%20%21%3D%200%29%0A%09%09%7B%0A%09%09%09foreach%28InfoOfItem%20parentItem%20in%20zeroLevelItems%29%0A%09%09%09%7B%0A%09%09%09%09this.GetParsedData%28parentItem%2C%200%2C%20itemStylesheet%2C%20dictAllItems%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09itemStylesheet.Append%28%22%3C%2Ftable%3E%22%29%3B%0A%09%09return%20itemStylesheet.ToString%28%29%3B%0A%09%7D%0A%09%0A%09private%20string%20Escape%28string%20data%29%0A%09%7B%0A%09%09return%20System.Security.SecurityElement.Escape%28data%29%3B%0A%09%7D%0A%09%0A%09private%20void%20GetParsedData%28InfoOfItem%20iof%2C%20int%20level%2C%20StringBuilder%20itemStylesheet%2C%20Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%20dictAllItems%29%0A%09%7B%0A%09%09List%3CInfoOfItem%3E%20dataOfItemList%3B%0A%09%09if%20%28level.ToString%28%29%20%21%3D%20iof.level%29%20return%3B%0A%09%09itemStylesheet.Append%28%22%3Ctr%20level%3D%5C%22%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.level%29%29%3B%0A%09%09itemStylesheet.Append%28%22%5C%22%20icon0%3D%5C%22..%2Fimages%2FPart.svg%5C%22%20icon1%3D%5C%22..%2Fimages%2FPart.svg%5C%22%3E%3Cuserdata%20key%3D%5C%22gridData_rowItemID%5C%22%20value%3D%5C%22%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.id%29%29%3B%0A%09%09itemStylesheet.Append%28%22%5C%22%20%2F%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.item_number%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.revision%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.state%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.sort_order%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.quantity%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09%0A%09%09itemStylesheet.Append%28Escape%28iof.make_buy%29%29%3B%20%20%2F%2Ffer%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%20%20%20%20%2F%2Ffer%0A%09%09%0A%09%09itemStylesheet.Append%28iof.lockedId%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.name%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.brd%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%22%29%3B%0A%09%09level%2B%2B%3B%0A%09%09if%20%28dictAllItems.TryGetValue%28iof.id%2C%20out%20dataOfItemList%29%29%0A%09%09%7B%0A%09%09%09foreach%20%28InfoOfItem%20childBom%20in%20dataOfItemList%29%0A%09%09%09%09GetParsedData%28childBom%2C%20level%2C%20itemStylesheet%2C%20dictAllItems%29%3B%0A%09%09%7D%0A%09%09%0A%09%09itemStylesheet.Append%28%22%3C%2Ftr%3E%22%29%3B%0A%09%7D%0A%09%0A%09private%20void%20GetBaseTamplate%28StringBuilder%20gridStyle%29%0A%09%7B%0A%09%09Aras.Server.Core.CallContext%20CCO%20%3D%20this.GetCCO%28%29%3B%0A%09%09gridStyle.Append%28%22%3C%3Fxml%20version%3D%5C%221.0%5C%22%20encoding%3D%5C%22utf-8%5C%22%3F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%3Ctable%22%29%3B%0A%09%09gridStyle.Append%28%22%20font%3D%5C%22Microsoft%20Sans%20Serif-8%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20sel_bgColor%3D%5C%22steelbue%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20sel_TextColor%3D%5C%22white%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20header_BgColor%3D%5C%22buttonface%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20expandroot%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20expandall%3D%5C%22false%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20treelines%3D%5C%221%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20editable%3D%5C%22false%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20draw_grid%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20multiselect%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20column_draggable%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20enableHtml%3D%5C%22false%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20enterAsTab%3D%5C%22false%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20bgInvert%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20xmlns%3Amsxsl%3D%5C%22urn%3Aschemas-microsoft-com%3Axslt%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20xmlns%3Aaras%3D%5C%22http%3A%2F%2Fwww.aras.com%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20xmlns%3Ausr%3D%5C%22urn%3Athe-xml-files%3Axslt%5C%22%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3Cthead%3E%22%29%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22item_number%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22major_rev%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22state%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%225E9C5A12CC58413A8670CF4003C57848%22%2C%20%22sort_order%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%225E9C5A12CC58413A8670CF4003C57848%22%2C%20%22quantity%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22make_buy%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%20%20%2F%2Ffer%0A%09%09%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%22450906E86E304F55A34B3C0D65C097EA%22%2C%20%22locked_by_id%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22name%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%225E9C5A12CC58413A8670CF4003C57848%22%2C%20%22reference_designator%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3C%2Fthead%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3Ccolumns%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%22220%5C%22%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22l%5C%22%20order%3D%5C%220%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2240%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%221%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2290%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%222%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2270%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%223%5C%22%20sort%3D%5C%22numeric%5C%22%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2270%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%224%5C%22%20sort%3D%5C%22numeric%5C%22%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2240%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%225%5C%22%20%2F%3E%22%29%3B%0A%20%20%20%20%20%20%20%20gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2240%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%226%5C%22%20%2F%3E%22%29%3B%09%09%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%22250%5C%22%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22l%5C%22%20order%3D%5C%227%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%22100%5C%22%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22l%5C%22%20order%3D%5C%228%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3C%2Fcolumns%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3Cmenu%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%09%3Cemptytag%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3C%2Fmenu%3E%22%29%3B%0A%09]

Too many thanks!!!!

  • angela's avatar
    angela
    2 years ago

    You are one the right track, there is just something missing for the actual data. Have you check the SQL procedure "MultiBom_GetCompleteBom1"? 

5 Replies

  • Hi Meupe,

    this question would be easy to answer - if it would not be Innovator 11 :).

    I cannot remember if the BOM structure was database or codetree based. But as far as I remembered I added a "minor_rev" column in the past.

    Can you make a screenshot of the Realtionship View tab? What is used there to render the view? You mentioned the Form "Part MultiLevel BOM Grid". Is this one linked? I expected something in the "Start Page" column.

    • team_aras_meupe_com's avatar
      team_aras_meupe_com
      Creator III

      Hello Angela, yes, here are some pics!!:

      Code of this HTML:

      [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:15fdd54c-8fe1-40d9-9d96-f43adb8f9239:type=xml&text=%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09%40import%20%22..%2Fpublic%2Fstyles%2Fcontrols.css%22%3B%0A%09%0A%09html%2C%20body%20%7B%0A%09%09overflow%3A%20hidden%3B%0A%09%09width%3A%20100%25%3B%0A%09%09height%3A%20100%25%3B%0A%09%09margin%3A%200px%3B%0A%09%09padding%3A%200px%3B%0A%09%7D%0A%09.sys_f_container%2C%20.sys_f_table%20%7B%0A%09%09width%3A%20100%25%3B%0A%09%09height%3A%20100%25%3B%0A%09%7D%0A%3C%2Fstyle%3E%0A%3Cscript%20type%3D%22text%2Fjavascript%22%20src%3D%22..%2Fjavascript%2Finclude.aspx%3Fclasses%3DXmlDocument%22%3E%3C%2Fscript%3E%0A%3Cscript%20type%3D%22text%2Fjavascript%22%3E%0A%09var%20grid%3B%0A%09var%20toolbar%3B%0A%0A%09var%20innovator%20%3D%20new%20top.Innovator%28%29%3B%0A%09var%20partItemType%20%3D%20top.aras.getItemTypeForClient%28%22Part%22%2C%20%22name%22%29%3B%0A%09var%20Part_rowIcon%20%3D%20partItemType.getProperty%28%22open_icon%22%29%3B%0A%09var%20xmlFileBase%20%3D%20top.aras.getScriptsURL%28%29%20%2B%20%22..%2FSolutions%2FPLM%2Fxml%2F%22%3B%0A%09var%20xmlParentBase%20%3D%20top.aras.getScriptsURL%28%29%20%2B%20%22..%2FSolutions%2FPLM%2F%22%3B%0A%09var%20currentUserID%20%3D%20top.aras.getCurrentUserID%28%29%3B%0A%0A%09top.aras.registerEventHandler%28%22ItemSave%22%2C%20window%2C%20ItemSaveListener%29%3B%0A%0A%09window.onresize%20%3D%20fixGridHeight%3B%0A%0A%09function%20ItemSaveListener%28params%29%20%7B%0A%09%09if%20%28%21document.thisItem%20%7C%7C%20document.thisItem.getId%28%29%20%21%3D%20params.itemID%29%20%7B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09initTree%28%29%3B%0A%09%7D%0A%0A%09var%20onload_handler%20%3D%20function%20%28%29%20%7B%0A%09%0A%09%09clientControlsFactory.createControl%28%22Aras.Client.Controls.Public.Toolbar%22%2C%20%7B%20id%3A%20%22bom_toolbar%22%2C%20connectId%3A%20%22toolbarContainer%22%20%7D%2C%20function%20%28control%29%20%7B%0A%09%09%09%09toolbar%20%3D%20control%3B%0A%09%09%09%09clientControlsFactory.on%28control%2C%20%7B%22onClick%22%3A%20onToolbarButtonClick%7D%29%3B%0A%09%09%09%09initToolbar%28%29%3B%09%0A%09%09%7D%29%3B%0A%09%09%09%0A%09%09clientControlsFactory.createControl%28%22Aras.Client.Controls.Public.TreeGridContainer%22%2C%20%20%7BconnectId%3A%20%22grid%22%2C%20canEdit_Experimental%3A%20function%20%28%29%20%7B%20return%20false%3B%20%7D%7D%2C%20function%28control%29%20%7B%0A%09%09%09grid%20%3D%20control%3B%0A%09%09%09grid.setMultiselect%28false%29%3B%0A%09%09%09clientControlsFactory.on%28grid%2C%20%7B%0A%09%09%09%09%22gridClick%22%3A%20onGridClick%2C%0A%09%09%09%09%22gridDoubleClick%22%3A%20onGridDoubleClick%2C%0A%09%09%09%09%22gridMenuInit%22%3A%20onGridMenuInit%2C%0A%09%09%09%09%22gridMenuClick%22%3A%20onGridMenuClick%0A%09%09%09%7D%29%3B%0A%09%09%09initTree%28%29%3B%0A%09%09%09fixGridHeight%28%29%3B%0A%09%09%7D%29%3B%0A%09%7D%0A%0A%0A%09function%20fixGridHeight%28%29%20%7B%0A%09%09var%20el%20%3D%20document.getElementById%28%22grid%22%29%3B%0A%09%09top.aras.fixLiquidContainerHeight%28document%2C%20el%29%3B%0A%09%7D%0A%0A%09window.addEventListener%28%22DOMContentLoaded%22%2C%20onload_handler%29%3B%0A%0A%09function%20initTree%28%29%20%7B%0A%09%09if%20%28%21document.item%29%20%2F%2FView%20form%20in%20FormTool%0A%09%09%7B%0A%09%09%09return%3B%0A%09%09%7D%0A%0A%09%09var%20resItem%20%3D%20innovator.newItem%28%22Part%22%2C%20%22PE_GetMultilBom%22%29%3B%0A%09%09resItem.setID%28document.item.getAttribute%28%22id%22%29%29%3B%0A%09%09resItem%20%3D%20resItem.apply%28%29%3B%0A%09%09if%20%28resItem.isError%28%29%29%20%7B%0A%09%09%09top.aras.AlertError%28resItem.getErrorString%28%29%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%0A%09%09grid.InitXML%28resItem.getResult%28%29%29%3B%0A%09%7D%0A%0A%09function%20getItemTree%28itemID%2C%20queryLevel%29%20%7B%0Adebugger%3B%0A%09%09var%20treeLoadXml%20%3D%20top.aras.createXMLDocument%28%29%3B%0A%09%09treeLoadXml.load%28xmlFileBase%20%2B%20%22query.xml%22%29%3B%0A%09%09if%20%28treeLoadXml.parseError.errorCode%20%21%3D%200%29%20%7B%0A%09%09%09var%20loadError%20%3D%20treeLoadXml.parseError%3B%0A%09%09%09top.aras.AlertError%28%22You%20have%20error%3A%5Cn%22%20%2B%20loadError.reason%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09var%20partBom%20%3D%20treeLoadXml.selectSingleNode%28%22Item%2FRelationships%2FItem%5B%40repeatTimes%5D%22%29%3B%0A%09%09partBom.setAttribute%28%22repeatTimes%22%2C%20queryLevel%29%3B%0A%0A%09%09var%20query%20%3D%20innovator.newItem%28%29%3B%0A%09%09query.loadAML%28treeLoadXml.xml%29%3B%0A%09%09query.setID%28itemID%29%3B%0A%09%09var%20results%20%3D%20query.apply%28%29%3B%0A%09%09if%20%28results.isError%28%29%29%20%7B%0A%09%09%09top.aras.AlertError%28results.getErrorString%28%29%29%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09return%20results%3B%0A%09%7D%0A%0A%09%2F%2F%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20Toolbar%20%26%20Menu%20%20Handlers%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0A%09function%20initToolbar%28%29%20%7B%0A%09%09document.toolbar%20%3D%20toolbar%3B%0A%09%09toolbar.loadXml%28top.aras.getI18NXMLResource%28%22MultiLevelBomToolbar.xml%22%2C%20%22..%2FSolutions%2FPLM%2F%22%29%29%3B%0A%09%09toolbar.show%28%29%3B%0A%09%7D%0A%0A%09function%20setControlEnabled%28ctrlName%2C%20b%29%20%7B%0A%09%09if%20%28%21toolbar%29%0A%09%09%09return%3B%0A%0A%09%09if%20%28b%20%3D%3D%3D%20undefined%29%0A%09%09%09b%20%3D%20true%3B%0A%09%09else%0A%09%09%09b%20%3D%20Boolean%28b%29%3B%0A%0A%09%09var%20AT%20%3D%20toolbar.getActiveToolbar%28%29%3B%0A%09%09var%20tbi%20%3D%20AT.getElement%28ctrlName%29%3B%0A%09%09if%20%28tbi%29%0A%09%09%09tbi.setEnabled%28b%29%3B%0A%09%7D%0A%0A%09function%20onToolbarButtonClick%28item%29%20%7B%0A%09%09var%20btnId%20%3D%20item.getId%28%29%3B%0A%09%09if%20%28%22expandall%22%20%3D%3D%20btnId%29%0A%09%09%09onExpandAll%28%29%3B%0A%09%09else%20if%20%28%22collapseall%22%20%3D%3D%20btnId%29%0A%09%09%09onCollapseAll%28%29%3B%0A%09%09else%20if%20%28%22refresh%22%20%3D%3D%20btnId%29%0A%09%09%09initTree%28%29%3B%0A%09%09else%20if%20%28%22open_row_item%22%20%3D%3D%20btnId%29%0A%09%09%09onOpenRowItem%28%29%3B%0A%09%7D%0A%0A%09function%20onGridMenuInit%28row%2C%20col%2C%20p%29%20%7B%0A%09%09var%20mnu%20%3D%20grid.getMenu%28%29%3B%0A%09%09mnu.removeAll%28%29%3B%0A%09%09mnu.add%28%22open_row_item%22%2C%20%22Open%20Item%22%29%3B%0A%09%09mnu.menu.startup%28%29%3B%0A%09%7D%0A%0A%09function%20onGridMenuClick%28menuChoice%2C%20rowId%2C%20col%29%20%7B%0A%09%09if%20%28%22open_row_item%22%20%3D%3D%20menuChoice%29%0A%09%09%09onOpenRowItem%28rowId%29%3B%0A%09%7D%0A%0A%09function%20onExpandAll%28%29%20%7B%0A%09%09grid.expandAll%28true%29%3B%0A%09%7D%0A%0A%09function%20onCollapseAll%28%29%20%7B%0A%09%09grid.expandAll%28false%29%3B%0A%09%7D%0A%0A%09function%20onGridDoubleClick%28rowId%29%20%7B%0A%09%09onOpenRowItem%28rowId%29%3B%0A%09%7D%0A%0A%09function%20onGridClick%28rowId%2C%20column%29%20%7B%0A%09%09setControlEnabled%28%22open%22%2C%20true%29%3B%0A%09%7D%0A%0A%09function%20onOpenRowItem%28rowId%29%20%7B%0A%09%09if%20%28%21rowId%29%0A%09%09%09rowId%20%3D%20grid.getSelectedId%28%29%3B%0A%0A%09%09if%20%28%21rowId%29%0A%09%09%09return%3B%0A%0A%09%09var%20partId%20%3D%20grid.GetUserData%28rowId%2C%20%22gridData_rowItemID%22%29%0A%09%09top.aras.uiShowItem%28%22Part%22%2C%20partId%29%3B%0A%09%7D%0A%3C%2Fscript%3E%0A%0A%3Ctable%20class%3D%22claro%22%20style%3D%22width%3A%20100%25%3B%20height%3A%20100%25%3B%20position%3A%20absolute%3B%20top%3A%200px%3B%20left%3A%200px%3B%22%20cellspacing%3D%220%22%20cellpadding%3D%220%22%3E%0A%09%3Ctr%20style%3D%22vertical-align%3A%20top%3B%22%3E%0A%09%09%3Ctd%20id%3D%22toolbarContainer%22%3E%0A%09%09%3C%2Ftd%3E%0A%09%3C%2Ftr%3E%0A%09%3Ctr%20style%3D%22vertical-align%3A%20top%3B%22%3E%0A%09%09%3Ctd%20id%3D%22grid%22%20style%3D%22width%3A%20100%25%3B%20height%3A%20100%25%3B%22%3E%0A%09%09%3C%2Ftd%3E%0A%09%3C%2Ftr%3E%0A%3C%2Ftable%3E]

      In the line 75 calls to method PE_GetMultilBom.

      Code of PE_GetMultilBom:

      [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:43e0ed40-d096-4880-b893-3b37a43521c0:type=xml&text=%09%09Innovator%20inn%20%3D%20this.getInnovator%28%29%3B%0A%0A%2F%2FSystem.Diagnostics.Debugger.Launch%28%29%3B%20%2F%2F%20fer%0A%0A%09%09if%20%28%21String.Equals%28this.getType%28%29%2C%20%22Part%22%2C%20StringComparison.Ordinal%29%29%0A%09%09%20%20%20%20return%20inn.newError%28%22Item%20of%20type%20Part%20required%22%29%3B%0A%09%09%0A%09%09string%20partId%20%3D%20this.getID%28%29%3B%0A%09%09if%20%28String.IsNullOrEmpty%28partId%29%29%0A%09%09%20%20%20%20return%20inn.newError%28%22Part%20ID%20not%20specified%22%29%3B%0A%09%09%0A%09%09DictsForMultiBom%20dictOfData%20%3D%20new%20DictsForMultiBom%28%29%3B%0A%09%09%0A%09%09GetDataForParsing%20getDataForParsing%20%3D%20new%20GetDataForParsing%28inn.getUserID%28%29%2C%20this%29%3B%0A%09%09getDataForParsing.SetDataToDict%28dictOfData%29%3B%0A%09%09%09%09%0A%09%09GetMultiBom%20ret%20%3D%20new%20GetMultiBom%28CCO%29%3B%09%09%0A%09%09string%20parsedData4Return%20%3D%20ret.GetCompleteBom%28dictOfData%29%3B%0A%09%09%0A%09%09return%20inn.newResult%28parsedData4Return%29%3B%0A%09%7D%0A%7D%0A%0Aclass%20DictsForMultiBom%0A%7B%0A%09public%20Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%20dictAllItems%3B%0A%09public%20List%3CInfoOfItem%3E%20zeroLevelItems%3B%0A%7D%0A%0Aclass%20InfoOfItem%0A%7B%0A%09public%20string%20level%3B%0A%09public%20string%20id%3B%0A%09public%20string%20item_number%3B%0A%09public%20string%20revision%3B%0A%09public%20string%20state%3B%0A%09public%20string%20sort_order%3B%0A%09public%20string%20quantity%3B%0A%09public%20string%20lockedId%3B%0A%09public%20string%20name%3B%0A%09public%20string%20brd%3B%0A%09%0A%09public%20string%20make_buy%3B%20%2F%2Ffer%0A%7D%0A%0Aclass%20GetDataForParsing%0A%7B%0A%09private%20string%20thisUserID%3B%0A%09private%20Item%20item%3B%0A%09%0A%09public%20GetDataForParsing%28string%20userId%2C%20Item%20part%29%0A%09%7B%0A%09%09this.thisUserID%20%3D%20userId%3B%0A%09%09this.item%20%3D%20part%3B%0A%09%7D%0A%09%0A%09public%20void%20SetDataToDict%28DictsForMultiBom%20dictOfData%29%0A%09%7B%0A%09%09Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%20dictItemProp%20%3D%20new%20Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%28%29%3B%0A%09%09List%3CInfoOfItem%3E%20zeroLevelItems%20%3D%20new%20List%3CInfoOfItem%3E%28%29%3B%0A%09%09Item%20itemList%20%3D%20this.GetAllItems%28%29%3B%0A%09%09%0A%09%09int%20itemsCount%20%3D%20itemList.getItemCount%28%29%3B%0A%09%09if%20%28itemsCount%20%3D%3D%200%29%20return%3B%0A%09%09%0A%09%09for%20%28int%20i%20%3D%200%3B%20i%20%3C%20itemsCount%3B%20i%2B%2B%29%0A%09%09%7B%0A%09%09%20%20%20%20%0A%09%09%20%20%20%20%0A%09%09%20%20%20%20%0A%09%09%09Item%20itm%20%3D%20%20itemList.getItemByIndex%28i%29%3B%0A%09%09%09InfoOfItem%20infoOfItem%20%3D%20new%20InfoOfItem%28%29%3B%0A%09%09%09infoOfItem.level%20%3D%20itm.getProperty%28%22level%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.id%20%3D%20itm.getProperty%28%22related_id%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.item_number%20%3D%20itm.getProperty%28%22related_item_number%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.revision%20%3D%20itm.getProperty%28%22related_revision%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.state%20%3D%20itm.getProperty%28%22related_state%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.sort_order%20%3D%20itm.getProperty%28%22sort_order%22%2C%20%22%22%29%3B%0A%09%09%09%0A%2F%2F%09%09%09infoOfItem.make_buy%20%3D%20itm.getProperty%28%22make_buy%22%2C%20%22%22%29%3B%20%2F%2F%20fer%0A%09%09%09%0A%09%09%09infoOfItem.quantity%20%3D%20itm.getProperty%28%22quantity%22%2C%20%22%22%29%3B%0A%09%09%09string%20lockedBY%20%3D%20itm.getProperty%28%22related_locked_by_id%22%2C%20%22%22%29%3B%0A%09%09%09if%20%28lockedBY%20%21%3D%20%22%22%29%0A%09%09%09%09infoOfItem.lockedId%20%3D%20%28lockedBY%20%3D%3D%20this.thisUserID%29%20%3F%20%22%3Cimg%20src%3D%5C%22..%2Fimages%2FLockedByMe.svg%5C%22%20%2F%3E%22%20%3A%20%22%3Cimg%20src%3D%5C%22..%2Fimages%2FLockedByMe.svg%5C%22%20%2F%3E%22%3B%0A%09%09%09else%0A%09%09%09%09infoOfItem.lockedId%20%3D%20%22%3Cemptytag%20%2F%3E%22%3B%0A%09%09%09%09%0A%09%09%09infoOfItem.name%20%3D%20itm.getProperty%28%22related_name%22%2C%20%22%22%29%3B%0A%09%09%09infoOfItem.brd%20%3D%20itm.getProperty%28%22bom_ref_desg%22%2C%20%22%22%29%3B%0A%09%09%09%0A%2F%2Fvamos%20con%20las%20pruebas%0A%2F%2FInnovator%20innovator%20%3D%20this.getInnovator%28%29%3B%0A%2F%2Fvar%20this_item%20%3D%20innovator.applyAML%28%22%3CAML%3E%3CItem%20type%3D%27Part%20BOM%27%20action%3D%27get%27%3E%3Cid%3E%22%2BinfoOfItem.id%2B%22%3C%2Fid%3E%3C%2FItem%3E%3C%2FAML%3E%22%29%3B%0A%2F%2FinfoOfItem.make_buy%20%3D%20this_item.getProperty%28%22make_buy%22%29%3B%0A%0A%09%09%0A%09%09%09if%20%28infoOfItem.level%20%3D%3D%20%220%22%29%20zeroLevelItems.Add%28infoOfItem%29%3B%0A%09%09%09%0A%09%09%09string%20source_id%20%3D%20string.Empty%3B%0A%09%09%09source_id%20%3D%20itm.getProperty%28%22source_id%22%2C%20%22%22%29%3B%0A%09%09%09%0A%09%09%09if%20%28source_id%20%3D%3D%20%22%22%29%20continue%3B%0A%09%09%09%0A%09%09%09List%3CInfoOfItem%3E%20dataOfItemList%3B%0A%09%09%09%0A%09%09%09dictItemProp.TryGetValue%28source_id%2C%20out%20dataOfItemList%29%3B%0A%09%09%09if%20%28dataOfItemList%20%21%3D%20null%29%0A%09%09%09%7B%0A%09%09%09%09dataOfItemList.Add%28infoOfItem%29%3B%0A%09%09%09%7D%0A%09%09%09else%0A%09%09%09%7B%0A%09%09%09%09List%3CInfoOfItem%3E%20datList%20%3D%20new%20List%3CInfoOfItem%3E%28%29%3B%0A%09%09%09%09datList.Add%28infoOfItem%29%3B%0A%09%09%09%09dictItemProp.Add%28source_id%2C%20datList%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09dictOfData.dictAllItems%20%3D%20dictItemProp%3B%0A%09%09dictOfData.zeroLevelItems%20%3D%20zeroLevelItems%3B%0A%09%7D%0A%09%0A%09private%20Item%20GetAllItems%28%29%0A%09%7B%0A%09%09Item%20callframe%20%3D%20item.newItem%28%22SQL%22%2C%20%22SQL%20PROCESS%22%29%3B%0A%09%09callframe.setProperty%28%22name%22%2C%20%22MultiBom_GetCompleteBom1%22%29%3B%0A%09%09callframe.setProperty%28%22PROCESS%22%2C%20%22CALL%22%29%3B%0A%09%09callframe.setProperty%28%22ARG1%22%2C%20item.getID%28%29%29%3B%0A%09%09%0A%09%09return%20callframe.apply%28%29%3B%0A%09%7D%0A%7D%0A%0Aclass%20GetMultiBom%0A%7B%0A%09private%20const%20String%20InnovatorCCOUID%20%3D%20%22PE_GetRelatedParts_InnovatorCCO%22%3B%0A%09%0A%09public%20GetMultiBom%28Aras.Server.Core.CallContext%20CCO%29%0A%09%7B%0A%09%09HttpContext.Current.Items%5BInnovatorCCOUID%5D%20%3D%20CCO%3B%0A%09%7D%0A%09%0A%09private%20Aras.Server.Core.CallContext%20GetCCO%28%29%0A%09%7B%0A%09%09return%20%28Aras.Server.Core.CallContext%29HttpContext.Current.Items%5BInnovatorCCOUID%5D%3B%0A%09%7D%0A%09%0A%09public%20string%20GetCompleteBom%28DictsForMultiBom%20dictOfData%29%0A%09%7B%0A%09%09Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%20dictAllItems%20%3D%20dictOfData.dictAllItems%3B%0A%09%09List%3CInfoOfItem%3E%20zeroLevelItems%20%3D%20dictOfData.zeroLevelItems%3B%0A%09%09%0A%09%09StringBuilder%20itemStylesheet%20%3D%20new%20StringBuilder%28%29%3B%0A%09%09this.GetBaseTamplate%28itemStylesheet%29%3B%0A%09%09%0A%09%09if%20%28dictAllItems%20%21%3D%20null%20%26%26%20dictAllItems.Count%20%21%3D%200%29%0A%09%09%7B%0A%09%09%09foreach%28InfoOfItem%20parentItem%20in%20zeroLevelItems%29%0A%09%09%09%7B%0A%09%09%09%09this.GetParsedData%28parentItem%2C%200%2C%20itemStylesheet%2C%20dictAllItems%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%09itemStylesheet.Append%28%22%3C%2Ftable%3E%22%29%3B%0A%09%09return%20itemStylesheet.ToString%28%29%3B%0A%09%7D%0A%09%0A%09private%20string%20Escape%28string%20data%29%0A%09%7B%0A%09%09return%20System.Security.SecurityElement.Escape%28data%29%3B%0A%09%7D%0A%09%0A%09private%20void%20GetParsedData%28InfoOfItem%20iof%2C%20int%20level%2C%20StringBuilder%20itemStylesheet%2C%20Dictionary%3Cstring%2C%20List%3CInfoOfItem%3E%3E%20dictAllItems%29%0A%09%7B%0A%09%09List%3CInfoOfItem%3E%20dataOfItemList%3B%0A%09%09if%20%28level.ToString%28%29%20%21%3D%20iof.level%29%20return%3B%0A%09%09itemStylesheet.Append%28%22%3Ctr%20level%3D%5C%22%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.level%29%29%3B%0A%09%09itemStylesheet.Append%28%22%5C%22%20icon0%3D%5C%22..%2Fimages%2FPart.svg%5C%22%20icon1%3D%5C%22..%2Fimages%2FPart.svg%5C%22%3E%3Cuserdata%20key%3D%5C%22gridData_rowItemID%5C%22%20value%3D%5C%22%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.id%29%29%3B%0A%09%09itemStylesheet.Append%28%22%5C%22%20%2F%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.item_number%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.revision%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.state%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.sort_order%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.quantity%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09%0A%09%09itemStylesheet.Append%28Escape%28iof.make_buy%29%29%3B%20%20%2F%2Ffer%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%20%20%20%20%2F%2Ffer%0A%09%09%0A%09%09itemStylesheet.Append%28iof.lockedId%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.name%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%3Ctd%3E%22%29%3B%0A%09%09itemStylesheet.Append%28Escape%28iof.brd%29%29%3B%0A%09%09itemStylesheet.Append%28%22%3C%2Ftd%3E%22%29%3B%0A%09%09level%2B%2B%3B%0A%09%09if%20%28dictAllItems.TryGetValue%28iof.id%2C%20out%20dataOfItemList%29%29%0A%09%09%7B%0A%09%09%09foreach%20%28InfoOfItem%20childBom%20in%20dataOfItemList%29%0A%09%09%09%09GetParsedData%28childBom%2C%20level%2C%20itemStylesheet%2C%20dictAllItems%29%3B%0A%09%09%7D%0A%09%09%0A%09%09itemStylesheet.Append%28%22%3C%2Ftr%3E%22%29%3B%0A%09%7D%0A%09%0A%09private%20void%20GetBaseTamplate%28StringBuilder%20gridStyle%29%0A%09%7B%0A%09%09Aras.Server.Core.CallContext%20CCO%20%3D%20this.GetCCO%28%29%3B%0A%09%09gridStyle.Append%28%22%3C%3Fxml%20version%3D%5C%221.0%5C%22%20encoding%3D%5C%22utf-8%5C%22%3F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%3Ctable%22%29%3B%0A%09%09gridStyle.Append%28%22%20font%3D%5C%22Microsoft%20Sans%20Serif-8%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20sel_bgColor%3D%5C%22steelbue%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20sel_TextColor%3D%5C%22white%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20header_BgColor%3D%5C%22buttonface%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20expandroot%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20expandall%3D%5C%22false%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20treelines%3D%5C%221%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20editable%3D%5C%22false%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20draw_grid%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20multiselect%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20column_draggable%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20enableHtml%3D%5C%22false%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20enterAsTab%3D%5C%22false%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20bgInvert%3D%5C%22true%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20xmlns%3Amsxsl%3D%5C%22urn%3Aschemas-microsoft-com%3Axslt%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20xmlns%3Aaras%3D%5C%22http%3A%2F%2Fwww.aras.com%5C%22%22%29%3B%0A%09%09gridStyle.Append%28%22%20xmlns%3Ausr%3D%5C%22urn%3Athe-xml-files%3Axslt%5C%22%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3Cthead%3E%22%29%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22item_number%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22major_rev%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22state%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%225E9C5A12CC58413A8670CF4003C57848%22%2C%20%22sort_order%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%225E9C5A12CC58413A8670CF4003C57848%22%2C%20%22quantity%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22make_buy%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%20%20%2F%2Ffer%0A%09%09%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%22450906E86E304F55A34B3C0D65C097EA%22%2C%20%22locked_by_id%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%224F1AC04A2B484F3ABA4E20DB63808A88%22%2C%20%22name%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Cth%20align%3D%5C%22c%5C%22%3E%22%20%2B%20CCO.Cache.GetPropertyFromCache%28%225E9C5A12CC58413A8670CF4003C57848%22%2C%20%22reference_designator%22%29.GetAttribute%28%22label%22%29%20%2B%20%22%3C%2Fth%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3C%2Fthead%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3Ccolumns%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%22220%5C%22%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22l%5C%22%20order%3D%5C%220%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2240%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%221%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2290%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%222%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2270%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%223%5C%22%20sort%3D%5C%22numeric%5C%22%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2270%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%224%5C%22%20sort%3D%5C%22numeric%5C%22%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2240%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%225%5C%22%20%2F%3E%22%29%3B%0A%20%20%20%20%20%20%20%20gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%2240%5C%22%20%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22c%5C%22%20order%3D%5C%226%5C%22%20%2F%3E%22%29%3B%09%09%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%22250%5C%22%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22l%5C%22%20order%3D%5C%227%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%20%3Ccolumn%20width%3D%5C%22100%5C%22%20edit%3D%5C%22NOEDIT%5C%22%20%20align%3D%5C%22l%5C%22%20order%3D%5C%228%5C%22%20%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3C%2Fcolumns%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3Cmenu%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%09%3Cemptytag%2F%3E%22%29%3B%0A%09%09gridStyle.Append%28%22%20%3C%2Fmenu%3E%22%29%3B%0A%09]

      i added the field "make_buy", it appears in the grid but without any data.

      In the HTML code of "Part MultiLevel BOM Grid" i see that call a xml file, in the line 89:

      treeLoadXml.load(xmlFileBase + "query.xml");

      Code of query.xml:

      [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:12aac45f-391e-444a-903c-12bd3f6efd41:type=xml&text=%3CItem%20type%3D%22Part%22%20select%3D%22name%2C%20item_number%2C%20locked_by_id%2C%20major_rev%2C%20state%2C%20make_buy%22%20action%3D%22GetItemRepeatConfig%22%3E%0D%0A%09%3CRelationships%3E%0D%0A%20%20%20%20%20%09%09%3CItem%20type%3D%22Part%20BOM%22%20select%3D%22related_id%2C%20quantity%2C%20sort_order%2C%20reference_designator%22%20repeatProp%3D%22related_id%22%20repeatTimes%3D%220%22%3E%0D%0A%09%09%09%3Crelated_id%3E%0D%0A%09%09%09%09%3CItem%20type%3D%22Part%22%3E%3C%2FItem%3E%0D%0A%09%09%09%3C%2Frelated_id%3E%0D%0A%09%09%3C%2FItem%3E%0D%0A%09%3C%2FRelationships%3E%0D%0A%3C%2FItem%3E]

      I added "make_buy" to the AML code.

      The problem in that never enters to the function that contain it, line 86.

      It never enters that function, so I can't load the data and of course, then I can't take that data.

      You must prepare the data elsewhere.

      Now that I'm thinking about it, I didn't restart the server when I made the changes to the XML file.

      PS: yes, my nightmare is not ARAS INNOVATOR; It's the version of ******* that I'm using, hahaha. I tried to update to version SP10 or SP11, but it gives errors and does not finish updating. We are talking to a company that will budget us for an update. But I don't have much faith.


      Thank you very much.

      • angela's avatar
        angela
        Catalyst II

        You are one the right track, there is just something missing for the actual data. Have you check the SQL procedure "MultiBom_GetCompleteBom1"?