It is a common requirement to have a PYXI Core Record that is an ‘extension’ of a record in an existing application. For example, an application with Customer records which is going to utilise enhanced functionality in PYXI Core, will typically need a PYXI Organisation record for each of its own customer records, as and when such functionality is triggered for that customer.
There are fundamentally two ways of linking the two records.
When the PYXI Organisation record is created (using the Add Record API call), its record ID is returned. Store this record ID in a new field in the existing application, then pass this record ID in all subsequent API calls relating to the record.
The disadvantage of this approach is that it requires technical modification of the existing application code (and probably database schema) to provide the additional field. Given that PYXI is often used to expand an existing application’s functionality because it is difficult, impossible, too expensive or too risky to modify the existing code, there must be a better way.
Alternatively, set-up a Field in PYXI – e.g. if your existing application is called MyApp, you might set-up a field called MyAppRecordID.
When creating the PYXI Organisation record (using the Add Record API call), include the existing record ID in MyAppRecordID in the data provided. This means the PYXI application now has a reference to the existing application’s record.
Now when making any subsequent API calls relating to the record, simply pass its record type (organisation) and a filter of MyAppRecordID=nnnn. This will still be as performant as providing the internal record ID, as all Field values are indexed in PYXI Core.
There are various advantages to this approach: