after an index has been created in B I select A and issue command set relation to (common field) into B
There's nothing wrong with that, though you wouldn't necessarily create an index everytime. Once it exists you can SET ORDER to it (or a tag of it with a CDX, which is recommended).
If you start a relation in a child table to a parent, i.e. select orderitems and set relation to orderid into orders, you get a technically working relation, but it won't reflect the 1:n relationship of orders into orderitems.
With a relation set this way around traversing the orderitems, you'll always see the order an item belongs to in the orders browse. An orderitems obviously can't point to tw orders, it only belongs to one by its orderid and so that relation (it can be useful, too) will always only show one order, nothing wrong with that.
If you want to see all orderitems of an order, the relation has to be set the other way around, you select order and set relation into orderitems. Orderitems first need to be sorted with an index on orderid, of course, but you know that. The start/end poions of a relation makes a difference, though.
Of course, I don't know what data you have, I picked order/orderitems as a well known and - even if not known - easy to understand example where an order is stored into a main record of an order table and multiple orderitem records of an orderitem table that all point to their main order record by an orderid that's common to both tables, unique in orders, foreign key (able to repeat as many times as you have items) in orderitems.
There's a bit more that could play a role, like an index not in sync with the data (can happen with IDX easily) and filtered indexes and VFPs very special unique index type that's not disallowing double values but filters them. Llet's not start talking here, I don't assume you even have those special cases, but only say it could of course mend a broken relationship if you REINDEX or create indexes fresh, from that persepctive it's always good, just a waset of time for healthy situations and not the only way things can become ghastly. I'd always first look into whether you have your relations the right way, then, before index defects play a role, it can simply be filters set on the workareas, not only indirectly by filtered indexes, but by actual SET FILTER conditions, of course.
If you start from an empty datasession, create indexes freshly, don't set filters, don't set skip - then it can mainly be the wrong direction of the relations and the handling of the browse windows, i.e. the order in which you open and use them. The side from which a relation starts (let's say A) is unfiltered and picking a record in the full list triggers the relation mechanism to filter the records in the table into which the relation points, let's say B, that's the major mechanism of activities. This filtering also happens, if the table B is not yet browsed, but BROWSE then may still show you all records in B, better have B already open in a window before you pick a record in A and trigger the relation mechanism, then you're on the sure side of the relation acting.