How can I modify the LoadCustomTableUsingExcel function to prevent it from adding duplicates?
Hi Everyone.
Is there a way to prevent the insertion of duplicate information using that function?
Dim selectionChangedTaskResult As New XFSelectionChangedTaskResult()
selectionChangedTaskResult.ShowMessageBox = True
Try
Dim loadResults As New List(Of TableRangeContent)
Dim fileInfo As XFFileEx = BRApi.FileSystem.GetFile(si, FileSystemLocation.ApplicationDatabase, strFilePath, True, False, False, SharedConstants.Unknown, Nothing, True)
If strFilePath.XFContainsIgnoreCase("xlsx") Then
loadResults = BRApi.Utilities.LoadCustomTableUsingExcel(si, SourceDataOriginTypes.FromFileUpload, "Temp.xlsx", fileInfo.XFFile.ContentFileBytes)
selectionChangedTaskResult.Message = "File [" & strFilePath & "] Loaded"
selectionChangedTaskResult.IsOK = True
Else
selectionChangedTaskResult.Message = "File [" & strFilePath & "] NOT Loaded"
selectionChangedTaskResult.IsOK = False
End If
'Delete the temp file
If boolDeleteTempFile Then BRApi.FileSystem.DeleteFile(si, FileSystemLocation.ApplicationDatabase, strFilePath)
Return selectionChangedTaskResult
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
