Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #36598 Back to Issue ]
Summary 0036598: Process Definition for multirecord sets only one organization in filter parameters
Revision 2017-08-04 09:36 by vmromanos
Steps To Reproduce Create a Process Definition for multirecord and standard ui.
Add a grid that shows Sales Invoices
Create a button in Sales Invoice window and link it to the process definition

In the onload function for the Process Definition add a similar code, replacing the necessary lines (mainly function name and grid name):

OB.OBAWO.onLoad = function (view) {
  var selection, paramGrid, parentGrid, criteria, gridCriteria;

  parentGrid = view.parentWindow.view.viewGrid;
  selection = parentGrid.getSelectedRecords();
  paramGrid = view.theForm.getItem('stock').canvas.viewGrid;

  criteria = [];
  selection.forEach(function (r) {
    criteria.push({
      fieldName: 'id',
      operator: 'equals',
      value: r.id
    });
  });
  gridCriteria = {
          operator: 'or',
    _constructor: 'AdvancedCriteria',
    criteria: criteria
  };

  paramGrid.dataSource.requestProperties.params.criteria = gridCriteria;
  
};


The idea is to select some records in Sales Invoice window, press the Process Definition button, and display only those records in the new popup grid.


In Sales Invoice window select 2 records, one for Norte and the other for Sur. Press the Process Definition button.
Verify just one record is shown.
Close the popup.

Repeat the selection, but this time selecting several records from the same org.
Verify all the records are now shown in the new grid.



Set a break point in AdvancedQueryBuilder.java, addWhereOrgParameters method.
And repeat the process.
Verify filterparameters contains a parameter _org with any of the organizations, that is used to add the natural tree filter. Example (in my case I work with storage details):

{@MaterialMgmtStorageDetail.storageBin@=4B413455BCE541C0AB80E18BFD7247B5, @MaterialMgmtStorageDetail.client@=A64C68776B544B0DB59C16456C43E608, @MaterialMgmtStorageDetail.product@=110D54D3A4214D3095008EC8F35D88B5, @MaterialMgmtStorageDetail.id@=DBB2E952074E47A5B4377B4115F03F02, whereAndFilterClause=e.qtyPutAway>0, @MaterialMgmtStorageDetail.organization@=3FF21930C89F4A8FAC60E7264BF96568, @MaterialMgmtStorageDetail.uOM@=100, _org=3FF21930C89F4A8FAC60E7264BF96568, @MaterialMgmtStorageDetail.attributeSetValue@=0}
Revision 2017-08-04 09:35 by vmromanos
Steps To Reproduce Create a Process Definition for multirecord and standard ui.
Add a grid that shows Sales Invoices
Create a button in Sales Invoice window and link it to the process definition

In the onload function for the Process Definition add a similar code, replacing the necessary lines (mainly function name and grid name):

OB.OBAWO.onLoad = function (view) {
  var selection, paramGrid, parentGrid, criteria, gridCriteria;

  parentGrid = view.parentWindow.view.viewGrid;
  selection = parentGrid.getSelectedRecords();
  paramGrid = view.theForm.getItem('stock').canvas.viewGrid;

  criteria = [];
  selection.forEach(function (r) {
    criteria.push({
      fieldName: 'id',
      operator: 'equals',
      value: r.id
    });
  });
  gridCriteria = {
          operator: 'or',
    _constructor: 'AdvancedCriteria',
    criteria: criteria
  };

  paramGrid.dataSource.requestProperties.params.criteria = gridCriteria;
  
};


The idea is to select some records in Sales Invoice window, press the Process Definition button, and display only those records in the new popup grid.


In Sales Invoice window select 2 records, one for Norte and the other for Sur. Press the Process Definition button.
Verify just one record is shown.
Close the popup.

Repeat the selection, but this time selecting several records from the same org.
Verify all the records are now shown in the new grid.



Set a break point in AdvancedQueryBuilder.java, addWhereOrgParameters method.
And repeat the process.
Verify filterparameters contains a parameter _org with any of the organizations, that is used to add the natural tree filter. Example (in my case I work with storage details):

{@MaterialMgmtStorageDetail.storageBin@=4B413455BCE541C0AB80E18BFD7247B5, @MaterialMgmtStorageDetail.client@=A64C68776B544B0DB59C16456C43E608, @MaterialMgmtStorageDetail.product@=110D54D3A4214D3095008EC8F35D88B5, @MaterialMgmtStorageDetail.id@=DBB2E952074E47A5B4377B4115F03F02, whereAndFilterClause=e.qtyPutAway>0, @MaterialMgmtStorageDetail.organization@=3FF21930C89F4A8FAC60E7264BF96568, @MaterialMgmtStorageDetail.uOM@=100, **_org=3FF21930C89F4A8FAC60E7264BF96568**, @MaterialMgmtStorageDetail.attributeSetValue@=0}


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker