Count the total related records and then count how many related records have a serial number. If they are equal, your order is Ready.
Either way it looks like you are looking at a calculated field or a script to process any non Ready orders to see if they are ready.
1 of 1 people found this helpful
Count() only counts non-empty fields.
You can use this with the following formula:
Count ( Goods::primaryKey ) = Count ( Goods::serial )
It probably does not make difference in your scenario, but be aware that this works on the relationship level, and would not be consistent with the display of a filtered portal.
I would suggest you use the info erolst provided which is a more detailed explanation of what I mentioned.
You could add a calc field that is Case ( Count ( Goods::primaryKey ) = Count ( Goods::serial ); "Ready"; "Whatever you say when it's not Ready")
Thank you bigtom and erolst. All works.
I know the original question is been answered. I got another very similar question.
Is there an possible way base the order status on items status. For example, if all items have pending status, make the order status as pending. And of I change all the items orders to "arrived", than change the order status to arrived.
For example, in below image, the order has 2 items and both have have "pending" status. I would like Order status to be Pending.
If both of the order item status = "Arrived", change the Order status = "Arrived"
You can use the following generic formula:
ValueCount ( Filtervalues ( List ( Goods::status ) ; "statusToBeCounted" ) )
and compare the result with that of
Count ( Goods::primaryKey )
Let ( [
acountAlll = Count ( Goods::primaryKey ) ;
countPending = ValueCount ( Filtervalues ( List ( Goods::status ) ; "Pending" ) ) ;
countArrived = ValueCount ( Filtervalues ( List ( Goods::status ) ; "Arrived" ) )
countAll = countPending ; "Pending" ;
countAll = countArrived ; "Arrived"