Yakutskenergo
Level 2

How import document in FMP Business Adapter Studion?

Jump to solution

Hello,

Can somebody tell how import document.

I have .xls files, where some devices PC, Laptops and i want attach document for them.

Yakutskenergo_0-1642035012371.png

 

1 Solution
ChrisG
Community Manager Community Manager
Community Manager

@mfranz is right that the data model available for use in business adapters does not cover importing document content.

You might consider doing this by directly manipulating relevant data in the compliance database of a FlexNet Manager Suite On-premises system. Document data is stored in the Document.DocumentFile and DocumentSize columns in the compliance database.

Something like the following (untested) SQL statement would store the contents of the file C:\Data\MyFile.xlsx (on the database server's filesystem) on the document record that has ID 1234:

UPDATE dbo.Document
SET
    DocumentFile = CAST(BulkColumn AS IMAGE),
    DocumentSize = DATALENGTH(BulkColumn)
FROM
    OPENROWSET(BULK 'C:\Data\MyFile.xlsx', SINGLE_BLOB) AS DATA
WHERE
    DocumentID = 1234

 

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

View solution in original post

2 Replies
mfranz
Level 16 Champion
Level 16 Champion

Hi,

I think the Business Adapter (Studio) will not allow to attach actual documents. I see 3 options:

  • store these documents somewhere else, like on a file share/SharePoint and just set a reference (see 2nd attribute)
  • upload the documents manually from the WebUI
  • do some SQL trickery to upload the files (FNMS on-premises only)

Best regards,

Markward

Softline Group is Europe's leading independent expert in Software Asset Management.
ChrisG
Community Manager Community Manager
Community Manager

@mfranz is right that the data model available for use in business adapters does not cover importing document content.

You might consider doing this by directly manipulating relevant data in the compliance database of a FlexNet Manager Suite On-premises system. Document data is stored in the Document.DocumentFile and DocumentSize columns in the compliance database.

Something like the following (untested) SQL statement would store the contents of the file C:\Data\MyFile.xlsx (on the database server's filesystem) on the document record that has ID 1234:

UPDATE dbo.Document
SET
    DocumentFile = CAST(BulkColumn AS IMAGE),
    DocumentSize = DATALENGTH(BulkColumn)
FROM
    OPENROWSET(BULK 'C:\Data\MyFile.xlsx', SINGLE_BLOB) AS DATA
WHERE
    DocumentID = 1234

 

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)