How to create a new Part TOC menu item that does a custom search?

Hi, On the ACE 2017 Europe conference, a technique that utilized Federated Data to add a TOC menu item that did a custom search was showcased. In my case, I want to add a new TOC menu item, besides the Part menu item, that searches among Released Parts. I.e., the menu item should be called "Parts Released", clicking it and then clicking the "Run Search" button should return a list of parts that are released. On the conference, they said that I should create a new dummy ItemType, and redirect its requests to the real Part by modifying the onBeforeGet to server event. Apparently this is related to data federation according to the presenter. However, I do not remember the exact steps to implement this. I got the impression that there should example code demonstrating this on Aras' GitHub page. However, I have browsed through several pages of Aras' repositories on GitHub, and I cannot find any project that sounds to be what I am looking or. Does anybody know how to achieve what I am asking for? Or where sample code can be found? Please tell me if you want me to clarify anything in my description. Thanks,
Parents
  • My PLM tactic is to wait long enough for things to solve themselves. The following code can be used for custom buttons for Lock, Unlock and SaveAs:
    var inn = this.getInnovator();
    
    var topWindow = aras.getMostTopWindowWithAras(window); 
    if (topWindow.work && topWindow.work.grid) { 
        var workFrame = topWindow.work; 
    
        var id = workFrame.grid.getSelectedID();
        
        var item = inn.getItemById("Part", id);
        item.setAction("copy");
        // item.setAction("lock"); 
        // item.setAction("unlock");
        item.setAttribute("doGetItem", "0");
        item = item.apply();
        if (item.isError()) {
    	 return aras.AlertError(item.getErrorString());
        }
        main.work.searchContainer.runSearch();
    }
    
    return item;
    
    Works without error messages and also the grid is updated. The rest should be just some CUI configuration.
Reply
  • My PLM tactic is to wait long enough for things to solve themselves. The following code can be used for custom buttons for Lock, Unlock and SaveAs:
    var inn = this.getInnovator();
    
    var topWindow = aras.getMostTopWindowWithAras(window); 
    if (topWindow.work && topWindow.work.grid) { 
        var workFrame = topWindow.work; 
    
        var id = workFrame.grid.getSelectedID();
        
        var item = inn.getItemById("Part", id);
        item.setAction("copy");
        // item.setAction("lock"); 
        // item.setAction("unlock");
        item.setAttribute("doGetItem", "0");
        item = item.apply();
        if (item.isError()) {
    	 return aras.AlertError(item.getErrorString());
        }
        main.work.searchContainer.runSearch();
    }
    
    return item;
    
    Works without error messages and also the grid is updated. The rest should be just some CUI configuration.
Children
No Data