API – Linking Records
Linking PYXI Core Records to Existing Application Records
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.
Store the PYXI Record ID in the Existing Application
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.
Store the Existing Application’s Unique Record Identifier in a Field in PYXI
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:
- There is no need for any technical modification of the existing application code or database
- The existing application’s record ID is available within PYXI Core so can easily be included in any WebHooks or other communications between PYXI Core and the existing application (or other applications as necessary)
Other API Help Pages
ActionsRead a Record | Update a Record | Add a Record | List Records | Evaluate a Template | Execute an Action Script | Apply a Blueprint | Get a Blueprint | Add a File | Get a File | Get/Set a Config Value | Get Category Values | Get Group Memberships of a User | Get Members of a Group | Load Data | Get Metadata for a Record Type | Get Metadata on Calculation Functions | Trigger an Event | Get Usage Statistics | Validate a Calculation | Validate a Filter Expression
Discussion TopicsLinking Records | Automation – Rules and Events
Return to Developer Help