Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Quinton Bernhardt Super Contributor.
Super Contributor.
102 views

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.

 

clipboard_image_0.png

Regards,
Quinton Bernhardt
Meniko Records Management Services
0 Likes
1 Reply
Quinton Bernhardt Super Contributor.
Super Contributor.

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.

Regards,
Quinton Bernhardt
Meniko Records Management Services
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.