Below are the most common Import Export PowerTool integration events.

OnBeforeSetFieldValue()

Runs before the field value is set to the data in the file.

Syntax

OnBeforeSetFieldValue(prrRecRef: RecordRef, pfrFieldRef: FieldRef, var ptxtData: Text, pbDoValidate: Boolean, var pbHandled: Boolean)

Parameters

Parameter Type Description
prrRecRef RecordRef Record for the field.
pfrFieldRef FieldRef Field that will be updated.
ptxtData Text Data for the field from the file.
pbDoValidate Boolean Whether the field is set to be validated or not.
pbHandled Boolean Set to true if you do not want the base processing to run.

OnBeforeInsertUpdateRecord()

Runs before a record is inserted or updated. Will only run once, not once before insert and once before update.

Syntax

OnBeforeInsertUpdateRecord(prrRecRef: RecordRef, var pbHandled: Boolean)

Parameters

Parameter Type Description
prrRecRef RecordRef Record to be inserted/updated. All fields will have final data.
pbHandled Boolean Set to true if you do not want the base processing to run.

OnBeforeDeleteRecords()

Runs before records are deleted.

Syntax

OnBeforeDeleteRecords(prrRecRef: RecordRef, var pbHandled: Boolean)

Parameters

Parameter Type Description
prrRecRef RecordRef The filtered list of records to be deleted.
pbHandled Boolean Set to true if you do not want the base processing to run.

OnBeforeExportRecord()

Runs before a record is exported.

Syntax

OnBeforeExportRecord(prrRecRef: RecordRef, var pbHandled: Boolean)

Parameters

Parameter Type Description
prrRecRef RecordRef The record to be exported.
pbHandled Boolean Set to true if you do not want the base processing to run.

OnAfterImportRecordLink()

Runs after a record link has been imported using the special RECORDLINK field on a standard table. This event will not fire if importing data into the Record Link table directly. This will also run if a record note has been imported but runs before the note has been imported.

Syntax

OnAfterImportRecordLink(var precRecordLink: Record “Record Link”)

Parameters

Parameter Type Description
precRecordLink Record “Record Link” The record link that was created. This will not contain any note data yet; see OnBeforeImportRecordNote().

OnBeforeImportRecordNote()

Runs after a record link has been imported but before the note has been imported into the Record Link record. This event will not fire if importing data into the Record Link table directly.

Syntax

OnBeforeImportRecordNote(var precRecordLink: Record “Record Link”, var ptxtNote: Text, var pbHandled: Boolean)

Parameters

Parameter Type Description
precRecordLink Record “Record Link” The Record Link record the note will be loaded into.
ptxtNote Text The note text.
pbHandled Boolean Set to true if you do not want the base processing to run.

OnBeforeImportBlobField()

Runs before an unknown BLOB field is imported.

Syntax

OnBeforeImportBlobField(prrRecRef: RecordRef, pfrFieldRef: FieldRef, var ptxtData: Text, var pbHandled: Boolean)

Parameters

Parameter Type Description
prrRecRef RecordRef The record the BLOB field belongs to.
pfrFieldRef FieldRef The BLOB field.
ptxtData Text The text for the BLOB.
pbHandled Boolean If false, the default behavior is that an error is generated.