
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
SDK, RecordAddIn and Communications
We have a FOLIO record type with the Communications page added onto the form (as mandatory).
The user has to add 1 communication to the record at the time of creation. Using a record add-in I want to check the communication Direction in the PreSave method.
So at this point, the record has not been saved yet and I want to interrogate the properties of the communication.
Does anybody know how to do this? I know you can use the search to check for communication objects linked to an existing record.
EDIT:
So I realized that the way to solve it is to create an AddIn for a Communication object instead of the Record, as these 2 are independently created and both AddIns get loaded when the user creates a new FOLIO - as in the screenshot below. The Communication AddIn works but..... any attempt to access the associated record throws an exception - remember that the Record and the Comminication are created at the same time or in one user operation.
The line of code:
var record = comm.Record;
The exception:
2019-11-26 12:48:34.8870 ERROR NARMS.RecordAddIn.CommunicationAddIn.ValidateRecord Could not find the Record with a unique row identifier of 3040. Possible causes are: no Record exists with the identifier supplied; the Record has recently been deleted; access to the specified Record is restricted. at HP.HPTRIM.SDK.Communication.get_Record()
at NARMS.RecordAddIn.CommunicationAddIn.ValidateRecord(Communication comm) in C:\Source\Repos\NARMS_Tools\RecordAddIn\CommunicationAddIn.cs:line 42
I understand that it is because the associated Record does not exist in the Dataset yet, but how do overcome this problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: SDK, RecordAddIn and Communications
I solved this by using static properties to share the required record values between the Communication and the Record Add-in.
It's not pretty but it works for my purpose.