The barcode included on the sent fax represents the Salesforce ID of the sent fax record it was sent from. When the fax is received we read the barcode and get that salesforce id of the sent fax record then update the lookup field for the sent fax. Then if there is another relationship of the sent fax it will populate the same relationship on the matching lookup field.