Hi, I modified the file foreignkey.php, adding the ability to sort the field.
First add to JFormFieldForeignKey class and getInput function this:
$this->order_field = $this->getAttribute('order_field');
and modified the query:
$query
->select(
array(
$this->key_field,
$this->value_field
)
)
->from($this->table)
->order($this->order_field);
and in form xml filed generated add:
order_field="activity"
Maybe you can modify the component creator to add this feature
best regards
Francesco Reitano