Newbies TM1 Posted June 6 Newbies Posted June 6 We have our images as PDFs stored on google drive and the container field is linked to pull these PDFs based on the item#. recently we have converted all our PDfs to JPGs and uploaded everything to google drive and changed the container type to .jpg and the images are not linking up. What am I doing wrong? I am not a programmer but just trying to get this simple thing to work. Below is the code where I have changed the $fileExt to PDF to JPG. BE_ConvertContainer ( PRODUCT_IMAGE::photo ; If( $fileExt = "jpg" ; "JPG" ; $fileExt ) ) Any help is appreciated on this.
comment Posted June 8 Posted June 8 I don't understand your description at all. You seem to be saying that you had a container field displaying PDFs stored on Google Drive. I don't know how that's possible, but let's suppose it is. And you say that "the container field is linked to pull these PDFs based on the item#". I think that means the field is actually a calculation field, and it calculates the path and filename of the PDF file it is supposed to display. In such case, all you would need to do make the field display a JPG file instead of PDF (with the same name, at the same location) is change the calculation formula so that it returns a result with an extension of ".jpg" instead of ".pdf". I don't see how BE_ConvertContainer() function would be relevant here; I believe it is designed to deal with container fields that embed the file. All of this is just speculation upon speculation, so please clarify.
Newbies TM1 Posted June 9 Author Newbies Posted June 9 Photo is the name of the container object. the syntax to get the file extension - removeRemotePrefix( GetValue( GetAsText( photo ) ; 1 ) ) If the image is .pdf it shows up - But if only .jpg extension is available I get this Hope these screenshots help with what I am trying to get to.
comment Posted June 9 Posted June 9 I am afraid we're not making any progress here. Please clarify: is the Photo field defined as a Calculation field? If yes, what is the calculation formula? If not, please pick a record where the field successfully displays a PDF file, and show us the exact result of calculating GetAsText ( Photo ). Keep in mind that the result may contain several lines; make sure you show us all of them.
Newbies TM1 Posted June 9 Author Newbies Posted June 9 No photo is not defined as calculation as far as I know. ZctFileName Container and FileNameExt are the 2 fields that I am referring to where the extension is gotten from .
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now