Hi Anitha,
I had similer requirement for one the integration where third party system was looking the specific file naming convention.
Please find below sample code
/// <summary>
/// This class used for extension of DmfDataPopulation.
/// </summary>
[ExtensionOf(classStr(DmfDataPopulation))]
final class NPCDmfDataPopulation_Extension
{
/// <summary>
/// This method used for get blob contents and finally the custom logic will replace the file name by applying date time and counter to rename the file as an unique file name
/// </summary>
/// <param name = "_fileId">guid</param>
/// <param name = "_localFilePath">str</param>
/// <param name = "_category">str</param>
public static void getBlobContents(guid _fileId, str _localFilePath, str _category)
{
VendParameters vendParameters = VendParameters::find();
MyFileCountTable fileCount;
str filePath = _localFilePath;
select firstonly GenerationCount from fileCount order by RecId desc
where fileCount.GenerationDate == today(); // get latest value from counter table
str dateStr = date2Str(today(),
123,
DateDay::Digits2,
DateSeparator::None,
DateMonth::Digits2,
DateSeparator::None,
DateYear::Digits4); //Use current date and time in file name
filePath = strReplace(_localFilePath, '[data entity label]', strFmt("%1-%2%3", vendParameters.ExportFileName, dateStr, fileCount.GenerationCount));
next getBlobContents(_fileId, filePath, _category);
}
}