Standard fields are now supported when calling DescribeFieldResult.getRelationshipOrder method. The method will return 0 if the field is the primary relationship field or 1 if the field is the secondary relationship field
Previously: The method always returned null for standard fields
Integer locationRelationshipOrder = LocationGroupAssignment.LocationId.getDescribe().getRelationshipOrder();
Integer locationGroupRelationshipOrder = LocationGroupAssignment.LocationGroupId.getDescribe().getRelationshipOrder();
System.debug('Location relationship order : ' + locationRelationshipOrder);
System.debug('Location Group relationship order : ' + locationGroupRelationshipOrder);
