Change detail in related field

In short: I need to change the default field used between two modules in a relationship.

In more detail:
I’ve created two custom modules and a relationship between them. One module is Order and the other is Bookings. One order can contain multiple Bookings so I’ve created Order One-To-Many Bookings relationship.

I created the Orders module based on Cases features. I don’t use the Subject field but I do need to use the Number field to create a unique identifier for each Order.

When I open a Order there is a Bookings subpanel just as expected.

When I’m in my Booking EditView I have the search field as expected. When I click the arrow a popup opens and I can search for the Order to connect to the Booking and this is where my problem is: The field will show empty in both editview and detailview as the field is most likely linked to show the NAME field from Order rather than the NUMBER field.

How can I change which field is the one that should be default in the relationship?

I appreciate the help.

Try by adding this to your vardefs:

$dictionary['Cases']['fields']['parent_case_c']['rname']='NUMBER';  // here you enter your field

More info here:

https://community.sugarcrm.com/thread/18783