HOME DOCUMENTATION DOWNLOADS BLOG

How to show the parameter in the screen

I have SD pre-filtered form by a date. Data are filtered by is less then this parDate.
I’d like to show the value from input parameter like a column of the final form. Is it possible?
(That’s because user will export the form into Excel finally, and the Date should be visible there).
If not, what possibilities do I have?

There are some more problems in this use case. First I will describe it:

There it is Inventory entity, connecting Product and Warehouse.
It has a child entity InventoryBalance, where are saved final daily amounts by Inventory (QuantityBalance and Date fields).
If there it is a movement on partitucular day, the InventoryBalance row is created and continuously updated all the day. Another day another row is created, etc.
By this way works Inventory form, that shows ACTUAL state per Inventory.

What I need is to show HISTORICAL state by Inventory and particular parDate, given by user.

I tried several ways, but finally I’m not able to finish it.

I have the Menu Item and the form filtered by parameter parDate on Inventory entity,

based on its own DataStructure,

I have a master/detail relation Inventory/InventoryBalance,

I have the filter LookupLastBalance on InventoryBalance by parDate and parInventoryId:

  1. Aggreation field:
    I can’t see suitable aggregation type for this case. The “None” aggregation gives me an error message like “not supported”.
    Every other aggregation type takes bad values: e.g. Sum really sums all InventoryBalance amounts, Max takes really max from them, etc. - of course.
    If there would be something like Top (1), it would help :slight_smile:

  2. Lookup field:
    I have created lookup based on the mentioned filter. But:
    There are TWO parameters - parDate and parInventoryId, needed for it.
    And how to pass them into the lookup?
    As well as my first question - how to show the value of the parameter in the grid, ideally in column?

  3. Field by DataStructure: it can’t work, because I dont’ know way, how to get the only one row from InventoryBalance.

  4. View:
    I tried to create view, but I don’t know, if (how) can I pass the Origam parameter into View?

  5. Now I’m thinking about regular copying of inventory states to another table InventoryHistory by workflow or procedure. But this solution is such ugly solution :frowning:

Any better idea?
Which of points 1-4 are total nonsense and which have a chance to work?
All 1-4 answers will be useful for me for another use cases.
Thank you.

I think the only way to achieve this is to create your own SQL function that you will map as a field in your entity.

So you can define a function in Functions that will have two parameters – inventory id (which you will map from the entity) and date which you will map from an entity parameter. When using this field a date parameter will be automatically required in the data structure.

Please note that you should mark this field as ExcludeFromAllFields otherwise the date parameter will be required in all queries on this entity.

1 Like

Yes, finally I used two database functions, one for mapping a date parameter into the screen, the second one for searching of corresponding InventoryBalance values. It was quite easy then.
If somebody needed to show Inventory form by historical date in Simplicor, I have it finished :slight_smile: