Add support for count call in Custom Code

Get the number of objects that match specific conditions.