Tuesday 13 May 2014

Adding FileNameOpen Extended Data Type to a Form


After add EDT FileNameOpen to form using New -> stringEdit, 


add some form methods:

str fileNameLookupFilename()
{
    return '';
}

str fileNameLookupTitle()
{
    return "@SYS53008";
}

str fileNameLookupInitialPath()
{
    return '';
}
container fileNameLookupFilter()
{
    return ['All files','*.*'];
}

After get the file path, call insert method:

public void AvInsertAttachment(filename file, int i)
{    
    DocuRef docuRef;
    DocuActionArchive archive;
    ;           
    
    if(file)
    {
        ttsbegin;
        docuRef.clear();
        docuRef.RefRecId = DirPartyEntity.RecId;
        docuRef.RefTableId = tableNum(CustTable);
        docuRef.RefCompanyId = DirPartyEntity.dataAreaId;
        docuRef.Name = strFmt("Consultant Attachment %1", i);
        docuRef.TypeId = 'File';
        docuRef.insert();
        archive = new DocuActionArchive();
        archive.add(docuRef, file);
        ttsCommit;
    }
}
Result:

No comments:

Post a Comment

SQL/SSRS Interview questions I thought of blogging some SQL/SSRS interview questions.

Below are some. I will add more, when I complete the compilation 1. What is OLTP(Online Transaction Processing)? OLTP stands ...