The Available field is not displayed in the "Select fields to display" window
In the ProductSelectionQueryUtilitiesMixin module there is a function _addAvailableQuantityColumn which adds the column "Available".
I can't understand why this field is not in the "Select fields to display" window.
Please tell me where to look for the problem.
Thank you.
Like
It's available. Just drill into the "Product in stock (by column Product)" and there you will be able to select the "Available" column.
Just like the
esq.addAggregationSchemaColumn("[ProductStockBalance:Product:Id].AvailableQuantity",
this.Terrasoft.AggregationType.SUM, "Available");
code states - we need to search for this "Available" column in a separate "ProductStockBalance" object.
Oleg Drobina,
Thanks for the answer. But this is not right. I replace the Available field with the value of the quantity of products in the current warehouse:
esq.addColumn("[ProductStockBalance:Product:Id].AvailableQuantity", "Available");
esq.filters.addItem(
this.Terrasoft.createColumnFilterWithParameter(
this.Terrasoft.ComparisonType.EQUAL,
'[ProductStockBalance:Product:Id].Warehouse.Id',
this.sandbox.publish("GetStockId", null, ['product-get-stock'])
)
);
and the value is inserted correctly into GridData, but it is not displayed
Eugene Demchuk,
yes, it won't be displayed. By default this column is not listed in the product selection schema. What happens if the column is added to the selection schema?
Oleg Drobina,
I have a task that if Warehouse is selected, then only products from this warehouse and the remaining stock in the warehouse are displayed.
To do this, I replaced the addMainQueryColumns and getMasterEntityProductsEsq functions in the ProductSelectionSchema module, where if a warehouse is selected, then in Available I enter the remaining stock in the warehouse.