Skip to main content

Hello,

 

In Apps9, is it possible to stop checking in some documents over a certain file size?

 

Does it need to create a macro?

 

Many Thanks,

 

Anne-Sophie

Hi @Mathias Dahl ,

Hi,

the macro is applied  everywhere in IFS where we have the possibility to attach a document?

Hi Eleazar,

No, the macro runs in screens where macros has been enabled in Apps 10 Aurena (not all places) or IFS Cloud (all places in the web client where a document can be checked in) and if the Aurena Agent is installed and enabled for the environment. The Aurena Agent, and therefore document macros, only works on Windows.

 

Ok, this means wherever we have the macro enabled it’s possible to use the same macro to check the size of the file, therefore to block it before saving.

Do you have documentation about configuration, development of macros, enabling macro in the screen? I’m new with Document Management in IFS.

PS. in APP EE it works too? I’m assuming yes because of the screenshots of the first replies

 

I found there is a Max File Size, using this could be Ok too? Document Classes (ifs.com)

I'm not sure what you mean, sorry. Do you want to fetch the size there, and use that in the macro? That would require some special coding since the document macro would not have access to those values.

For the attribute it says: Max Document Size (MB): The maximum size of a document that will be downloaded to the mobile application.

This means, it’s possible to set a maximum size per Document per Document Class, so I was thinking maybe instead of doing a macro I just can set a max here for the Document Class; but also here, I’m not sure if per each attachment in the screen is possible to change the Document Class and how this impacts IFS.

 

The macro solutions seems to be the best solution but I would also to know more about the Document classes. Do you have any documentation about this?

 

Thank you very much


Search our documentation for document macros and you will find what we have there. This post on IFS Community can also help:

https://community.ifs.com/document-management-docman-248/a-basic-document-macro-to-build-from-27411

As for the max size setting, as that screen suggest, it's for mobile work order and it's not a setting that's used globally in all IFS clients.

 

 


Hi again,

I made a quick test, and the macro approach works in IEE in Apps 9. I created a simple macro that checks the file size when checking in and which raise an error if it is too large. Here is what how it looks:

After the user has clicked OK, the process stops. He can try to check in another file.

Here is the macro code. You need to read up in the documentation about macros on how to define the macro:

 

Public Sub SizeCheck ()

  Const maxFileSize = 10000      strFile = ClientScriptValues.Item("LOCAL_FILE_1").Value

  Set objFSO = CreateObject("Scripting.FileSystemObject")   Set objFile = objFSO.GetFile(strFile)

  If objFile.Size > maxFileSize Then     Err.Raise 1000, "File size check", "File is larger (" & objFile.Size & ") than the maximum specified file size (" & maxFileSize & "). Try again and select a smaller file."   End If

End Sub

 

This might work in IEE in Apps 10 as well. Perhaps not in Aurena, not sure.

Good luck!

/Mathias

 

Hi all!

has anyone tried to use this macro in IFS Cloud? Because it doesn't work for me.


Change the macro to only show a message box (our documentation have an example of that) with the file name and make sure it is correct.


Change the macro to only show a message box (our documentation have an example of that) with the file name and make sure it is correct.

Yes, it’s correct and a simple macro works, but your example for “File size check” doesn’t. That’s why I asked.


Okay, so you have got the correct file name - great! What you can do then is to create a simple .vbs file on your PC, and paste the file size check code above, together with a hard coded file name and run that file. Then debug the macro step by step (by adding MsgBox calls in certain places) until it works.


Reply