Jump to content

VARIABLE BATCH QUANTITIES


DavidSowers
 Share

Recommended Posts

Alright - I am going to try to phrase a previous question differently and see if anyone can help because I am still having difficulty with this...


In the attached, simplified version of what I am attempting, I have a Parent Entity created. And for every Parent Entity, Math.Round((Random.Uniform(1,4)) number of Member Entities are created.


Please help me if possible, to set an expression for the Batch Size that waits for each of the created members and batches them. I have the logic for how they match, but I can't seem to get the Batch Quantity to change based on how many of the Members were created each time.


Any help appreciated!

BatchingLogic.spfx

Link to comment
Share on other sites

I looked at this example and your other posting, so I have a general idea of what you are trying to do. I hestiate to spend too much time on a specific solution because I know that both of these were just examples of your real problem.


The key is that the BatchQuantity is determined by (or in the context of) the parent entity. The easiest way to approach this problem is to set a state on the parent entity for its batch size.


Here is one way to do that... have the Source object that creates the parents record that value and then create the members.BatchSize.JPG.4fbf4cef409d50a58e2c5d550ce5432b.JPG

 

BatchingLogic.spfx

Link to comment
Share on other sites

This is a big help! Thank you!


The one thing that I still can't figure out, is that when I create a state, for instance "BatchQuantity" like you did... I can't attach it to an Entity as you did in the drop down menu for the state Variable name.


For example:


State Variable Name Dropdown reads: "BatchQuantity" Instead of "ModelEntity.BatchQuantity"


Am I doing something wrong?


David

Link to comment
Share on other sites

×
×
  • Create New...