Is it possible to import the contents of a BO Document Attribute?
For example
BO called ImportObject has a single attribute "ImportObject.CSVFile"
Is it possible to import the contents of that CSV file or does it have to be imported from the file system.
IMPORT from a BO Document Attribute
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: IMPORT from a BO Document Attribute
You can use URL_CONTENTS to do this
example:
Object.CsvContent=URL_CONTENTS('file:///C:/Folder/<<Object.ID>>.csv')
example:
Object.CsvContent=URL_CONTENTS('file:///C:/Folder/<<Object.ID>>.csv')
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: IMPORT from a BO Document Attribute
Rereading I realise my original post wasn’t clear.
The user creates ImportObject and uploads a file from their local file store.
I then have a BO with a document in it. I’d like to just IMPORT xyz From ImportObject.DocumentAttribute
I’ve tried downloading the document to the server file store but I’m having very poor results (ie none).
Then I thought I’d not store the CSV file in the database and instead specify a file location for it but read that Jaymer had had problems with relative file positions.
Then I stopped and went back to more productive work...
The user creates ImportObject and uploads a file from their local file store.
I then have a BO with a document in it. I’d like to just IMPORT xyz From ImportObject.DocumentAttribute
I’ve tried downloading the document to the server file store but I’m having very poor results (ie none).
Then I thought I’d not store the CSV file in the database and instead specify a file location for it but read that Jaymer had had problems with relative file positions.
Then I stopped and went back to more productive work...
Re: IMPORT from a BO Document Attribute
Yeah, I dont know about from within an Object
But why can't you export the CSV file in the Document Attribute to a location and then use URL_CONTENTS to extract the contents to another Object.CSV attribute ( I do this a lot in one of my apps)
make it part of the same process e.g.
EXPORT ....C:/Folder/<<Object.ID>>
Object.CsvContent=URL_CONTENTS('file:///C:/Folder/<<Object.ID>>.csv')
But why can't you export the CSV file in the Document Attribute to a location and then use URL_CONTENTS to extract the contents to another Object.CSV attribute ( I do this a lot in one of my apps)
make it part of the same process e.g.
EXPORT ....C:/Folder/<<Object.ID>>
Object.CsvContent=URL_CONTENTS('file:///C:/Folder/<<Object.ID>>.csv')
Re: IMPORT from a BO Document Attribute
The relative paths were reported and acknowledged as a bug - that Vlad resolved.
I have not tried it since - having worked around it.
As usual, the Server/Tomcat windows are your friend - as are Logger and the new LOG2 for debugging.
And I think people too often forget about doing a browser "Inspect" AND examining the console for a JS error.
jaymer...
I have not tried it since - having worked around it.
As usual, the Server/Tomcat windows are your friend - as are Logger and the new LOG2 for debugging.
And I think people too often forget about doing a browser "Inspect" AND examining the console for a JS error.
jaymer...
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL