Christa Posted June 25, 2019 Share Posted June 25, 2019 Hi, Is it possible to set the state variable of the parent entity in a batch equal to the sum of state variables of all member entities in the batch? Context of the case; a truck (parent) is loaded with x number of orders (members). These orders have a specific value for the state variable 'NumberOfRollContainers'. The truck has the state variable 'TotalRollContainers', which should equal the sum of the 'NumberOfRollContainers' in that batch. Kind regards, Christa Link to comment Share on other sites More sharing options...
jzhou Posted June 25, 2019 Share Posted June 25, 2019 Is this what you are looking for? As attached! Best regards/Jeff Model_totalRollContainer_JZ.spfx 1 Link to comment Share on other sites More sharing options...
gocken Posted June 25, 2019 Share Posted June 25, 2019 You can sum the "NumberOfRollContainers" whenever a member entity enters the combiner object by using "on member entering" property under "state assignments" section. Then, set this total to the "TotalRollContainers" state variable of the parent objet by using "before exiting" property of combiner object. 1 Link to comment Share on other sites More sharing options...
Christa Posted June 26, 2019 Author Share Posted June 26, 2019 23 hours ago, jzhou said: Is this what you are looking for? As attached! Best regards/Jeff Model_totalRollContainer_JZ.spfx 153.17 kB · 0 downloads I applied your suggestion. It seems to work! Thanks Link to comment Share on other sites More sharing options...
Recommended Posts