How to create _FILE and FORM fields in OBJE record
Posted: 17 Jan 2012 18:14
If I create a new OBJE record from within a plugin I either get duplicate FORM and _FILE fields or blanks.
e.g. If I do:
local objFILE=fhCreateItem('TITL',objOBJE) fhSetValueAsText(objFILE, 'mytestfile.jpg')
... the record is created with 2 FILEs - one blank and one with the test file in it.
I thought it might be because the FILE and FORM were mandatory and so pre-set so tried this instead:
local objFILE=fhGetItemPtr(objOBJE,'_FILE')
fhSetValueAsText(objFILE, 'mytestfile.jpg')
That gets rid of the duplicate FILE but doesn't set the test file at all.
I even tried deleting it and re-creating or re-setting it in the code but no joy.
Is this a bug or am I doing something wrong?
ID:5822
e.g. If I do:
local objFILE=fhCreateItem('TITL',objOBJE) fhSetValueAsText(objFILE, 'mytestfile.jpg')
... the record is created with 2 FILEs - one blank and one with the test file in it.
I thought it might be because the FILE and FORM were mandatory and so pre-set so tried this instead:
local objFILE=fhGetItemPtr(objOBJE,'_FILE')
fhSetValueAsText(objFILE, 'mytestfile.jpg')
That gets rid of the duplicate FILE but doesn't set the test file at all.
I even tried deleting it and re-creating or re-setting it in the code but no joy.
Is this a bug or am I doing something wrong?
ID:5822