Facing problem in exporting container field content
I have a container field for storing document files which is stored externally (open storage)
This file may be any file .pdf, .doc, .docx, .xls, .xlsx etc.
Now for opening container file, I am exporting it to temporary path. I am setting variable as:
$PATH = Get(TemporaryPath) & "/PO-" & Offer Detail::Customer Name
Export field contents ($PATH) (Automatic open file)
Now my question is every time the extension may be different and I have to add that extension at the end of my variable. For e.g. $PATH = Get(TemporaryPath) & "/PO-" & Offer Detail::Customer Name & ".pdf"
Is there any solution so that I automatically get extension of container field?