Solved

Document Management file size

  • 25 February 2020
  • 27 replies
  • 1276 views

Userlevel 3
Badge +7

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

icon

Best answer by Mathias Dahl 6 April 2020, 10:32

View original

27 replies

Userlevel 7
Badge +30

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.

 

 

Badge +2

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

Userlevel 7
Badge +30

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.

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.

Badge +2

Hi,

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

 

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

 

Thank you,

Eleazar

Userlevel 7
Badge +30

It should work in Aurena as well I think, but if this is on Apps 10, we don't run macros in that many places. Also, getting hold of the local file can be a bit different in a macro that's running in Aurena. What did you try, what happened?

Badge +2

Hi Mathias,

 

I was able to get this sorted, and it worked as shown below.

 

However, I was trying to get this on Aurena Client but it didn’t work in the same environment. are there any basic conditions and data, that I have to setup, to get this sorted in the Aurena client? 

 

Thank you and Best Regards,

Chamuditha

Userlevel 7
Badge +30

It looks like there is something in your macro that says "IFS_EXEC" which it's not happy about. 

Badge +2

Hi @Mathias Dahl,

 

I was trying this and experiencing the below error in one of our reference environments. Could you please help me here and guide me on what is the mistake done by me?

 

 

Thank you and Best Regards,

Chamuditha

Userlevel 7
Badge +30

I can see a number of options, if they don't want to or cannot use macros or a custom event to solve this:

1. Educate the users 🙂
2. Create an idea here on IFS Community such that we can consider this for future development.
3. Do a modification.
4. Run a quick report at regular intervals, looking for documents with large PDF files, and then ask the creators to upload smaller versions of those files.

I have some questions of my own:

1. Why do they want to do this in the first place?
2. Why can't they rely on a macro or custom event?

Thanks!
 

Badge +1

Hi @Mathias Dahl,

One of the customer needs to limit the upload PDF file size to 5 MB in general(ex : attaching a document to customer order). Is there any other way to limit the file size except check in macros and custom events? Also, what should be the most suitable according to this customer  requirement?

Userlevel 7
Badge +30

Thanks!

What I can say is that there are certainly limitations when using macros to implement a file size check and you seem to have found some of them.

I recommend a proper modification instead of using a macro, if a file check is important to you and sing you have hit limitations in the macro functionality.

 

Userlevel 2
Badge +6

Hello @Mathias Dahl , 

I am referring to the IFS10 EE . 

First issue is that macro does not execute when you drag and drop more than one file into the attachments section. It just ignores any macro, independently what it does.

 

Second issue is that if for example macro prevents attaching large files than as the result we have shortuct created with no file linked to it. So we would like not to see that as users could understand it in a different way as a success case.

 

Thank you.

Userlevel 7
Badge +30

Hello @Mathias Dahl , 

Thanks for the script example but it seems it does not work if you attach 2 or more files simultaneously (by drag and drop for example).

Could anyone confirm?

At the same time Macro works perfectly for single attachment. Now I am searching for the way how to delete shortcut created without any connection to the file in this case. IFS EE 10.

Are you referring to drag and drop in Aurena or IEE? In Aurena, macro execution is not possible to combine with drag and drop. If this is IEE, let us know some more details about what you tried.

Userlevel 2
Badge +6

Hello @Mathias Dahl , 

Thanks for the script example but it seems it does not work if you attach 2 or more files simultaneously (by drag and drop for example).

Could anyone confirm?

At the same time Macro works perfectly for single attachment. Now I am searching for the way how to delete shortcut created without any connection to the file in this case. IFS EE 10.

 

Thanks.

Userlevel 7
Badge +30

Did you want to add a comment, @tahir.ali ?

Badge +2

 

@Mathias Dahl  Can you please mention the steps to use this macro. I am also having the same requirement 

Have a look at the official end-user documentation about macros. It explains how the macro for IFS 10

Userlevel 7
Badge +30

@Mathias Dahl  Can you please mention the steps to use this macro. I am also having the same requirement 

Have a look at the official end-user documentation about macros. It explains how the macro configuration works and the steps needed to setup a macro.

Let us know if there are details there that are not clear.

Good luck!

 

Userlevel 5
Badge +9

@Mathias Dahl  Can you please mention the steps to use this macro. I am also having the same requirement 

Userlevel 3
Badge +8

 

Please send me the macro configuration screenshots. 

Userlevel 7
Badge +30

Hi Mathias,

I tested it recently and it worked really well. Thank you so much for your help.

 

Kind Regards,

Anne-Sophie

Glad to hear it worked, thanks for replying back!

 

Userlevel 3
Badge +7

Hi Mathias,

I tested it recently and it worked really well. Thank you so much for your help.

 

Kind Regards,

Anne-Sophie

Userlevel 7
Badge +30

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

 

Userlevel 3
Badge +7

Mathias,

Thank you very much for the reply. I don’t know why but I did not get a notice of your answer and just seen it today. 

I tried the macro but it looks like it does not know the file size at check in point.

Thanks for taking the time, we might just stick to educating :).

Userlevel 7
Badge +30

A check in macro could probably do something here, but it would need to be tested. The macro, for sure, could check the file size, but I am unsure if it could stop the check in from happening in a good way. Or, well, it might be able to move the file away such that, when IFS tries to upload it, it will not find it, or perhaps raise an error and hope the error in the macro stops the whole check in process. It might cause some bad side effect though (file status being stuck in some bad status).

A custom event might be able to do something on the database server (check the file that was just checked in, and delete it), but it would happen “after the fact”, so the network/bandwidth would still be “consumed”. This would require some careful testing also to make sure the database does not end up in a bad state.

It would be better with a proper support for this, if you want something stable. For IEE, it should not be a problem, technically, to do it. For Aurena it would be harder, at least on all platforms (I don’t think the JavaScript code in web client is allowed to check the file size, but I have not researched it).

Or, you could educate your users :)

 

Userlevel 5
Badge +10

Probably worth raising a question with IFS Support, as I think this is a fair request/feature. Of course this does not help you immediately.

Of course there may be a way to do this that we have not discovered. Will be interesting to see if anyone else comments.

Mike

Reply