Add Prompt screen to multi document upload process

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Add Prompt screen to multi document upload process

Post by Jhstephenson »

Sorry for this being long.

First the, ‘what is working part’...

I have a process where I do a batch upload of documents to a BO.

In the Panel Operations of a Query for my Documents BO, I have an operation that Starts a ‘BatchUpload’ process and has ‘Implements multi-file upload’ checked.

In the ‘BatchUpload’ process it runs the following:

If FILE_EXISTS(SystemSettings.DefaultDocumentFilePath+'\'+CaseMaster.CaseID)='No' Then MAKE DIRECTORY SystemSettings.DefaultDocumentFilePath+'\'+CaseMaster.CaseID

CREATE Documents FOR EACH FileItem WITH Documents.CreatedBy=LoggedInRegularUser,Documents.CreatedDate=CURRENT_TIMESTAMP,Documents.Document=FileItem.Doc,Documents.DocumentFilePath=SystemSettings.DefaultDocumentFilePath+'\'+CaseMaster.CaseID+'\'+FILE_NAME(FileItem.Doc)+'.'+FILE_EXTENSION(FileItem.Doc) INSERT CaseMaster IN Documents.parent_CaseMaster

Basically it is just checking for the existence of a folder, if it isn’t there it creates it. Then it takes the FileItem.doc BO’s and creates a record in my Documents BO for each of them.

This process works great.

Now the ‘not working part’...

I want to add a Prompt screen that runs either before the File selection screen comes up or immediately after it.

First option (preferred) - show prompt screen before ‘Select File(s)’ is done….

When I change the operation in my Panel Operations on the Query to open my prompt form (I change it to ‘Create Object’), which is attached to a Non-Persistent BO, I can pull up the form just fine.

However, the only option that shows up is ‘Create’ on the screen. If I tell the Form to Start the 'BatchUpload' process after Saving the record there is no ‘Implements multi-file upload’ option for that process.

If I change the ‘Save’ option to ‘Start a Process’ and have it start the ‘BatchUpload’ process, the ‘implements multi-file upload’ option is there. But the ‘Create’ option disappears from the form and there is only a ‘Close’ button, which if clicked on says there is unsaved data, asks for it to be saved, and then when ‘Yes’ is clicked just clears the screen and never runs the process.

If I add a Panel Operation to Start the 'BatchUpload' process, the button never appears on the screen to run it.

So, I try option two - have the prompt screen show up after the files are selected.

I change my process to look like this:

ENTER NEW DocumentUploadPromptScreen

If FILE_EXISTS(SystemSettings.DefaultDocumentFilePath+'\'+CaseMaster.CaseID)='No' Then MAKE DIRECTORY SystemSettings.DefaultDocumentFilePath+'\'+CaseMaster.CaseID

CREATE Documents FOR EACH FileItem WITH Documents.CreatedBy=LoggedInRegularUser,Documents.CreatedDate=CURRENT_TIMESTAMP,Documents.Document=FileItem.Doc,Documents.DocumentFilePath=SystemSettings.DefaultDocumentFilePath+'\'+CaseMaster.CaseID+'\'+FILE_NAME(FileItem.Doc)+'.'+FILE_EXTENSION(FileItem.Doc) INSERT CaseMaster IN Documents.parent_CaseMaster

Now when I run it I get the ‘Select Files’ screen, I select my files, hit submit and get the following:

com.bas.connectionserver.server.LongServiceException

I know I am missing something really simple here, but am not sure what.

Can somebody point in the right direction, or to an example of how to call Non-Persistent BO forms to start processes?
Post Reply