0 votes

Hello,

I'm using datasync to parse directory and upload all email in it to Efficy. I've tried to use the usual way of insertAttachment to newly created Mail

ImportFiles.prototype.ImportFile = function(EditMail, FilePath, FileName) {
        Database.InsertAttachment(EditMail, 1, FilePath);
        var AttachmentText = StrLoadBinaryFile(FilePath); 
        var FileDS = Database.GetDetailDataSet(EditMail, ntFile);  
        FileDS.Edit;
        FileDS.FieldByName('STREAM').AsString = AttachmentText;
        Database.UpdateDetail(EditMail, ntFile, 0, 0, 'FILESIZE', AttachmentText.length); 
        Database.UpdateDetail(EditMail, ntFile, 0, 0, 'PATH', FilePath); 
        Database.UpdateDetail(EditMail, ntFile, 0, 0, 'COMMENT', FileName);
        Database.CommitChanges(EditMail, false);
        Database.CloseContext(EditMail);
    }

but i'm getting error:

Error during CommitChanges on "Mail": Could not convert variant of
type (Null) into type (Double)

Please advise.
thank you.
Best Regards.

asked in WorkFlow / Serverscript by (559 points)

1 Answer

+1 vote
Best answer

Hello,

The problem was in not setting field "D_RECIEVED",it should be set manually. that's it , it works :)

Thanks.
Best Regards.

answered by (559 points)
1,226 questions
1,495 answers
1,831 comments
328 users