Posted Thu, 09 Apr 2020 23:59:50 GMT by Chris McFarland
Hello Everyone:

I was working with the Platform.NETClient sample in Visual Studio, and I was unzipping a new copy every once in a while to give myself a fresh start then out of the blue the package from a fresh unzip loads in with a bunch of errors.

Basically saying that a bunch of things don't exist in the current context.

Cannot figure out how to get back to a stable base package so that I can continue to try to figure out how to make it work.

What do you think?

 
Posted Fri, 10 Apr 2020 19:07:14 GMT by Chris McFarland
OK, update here.

Past that and on to the next thing that has me stumped.

To get rid of the errors after having them come back after a restart helped once I found that setting the project to an older .NET version and then back again did the trick.

Now what I'm looking at is that the elements I'm after in the PlatformClient are not being called up when I run(debug) the project.

I've inserted Console.Write lines in a few places and can see that the GetFIleCabinet element is called up and executes, but no other calls from Program.cs to PlatformClient elements are being triggered.

Probably missing something super simple here...

What do you think?

Thanks!
Posted Tue, 14 Apr 2020 07:40:17 GMT by Simon H. Hellmann Toshiba TGIS GmbH | IT-Consultant - Document Management Solutions
Hi Chris, 

can you post some of your code which errors out for you here? 
Hard to say anything about it if we do not know error messages or the methods called. 

Greetings from Germany,
Simon H. Hellmann
DocuWare System Consultant
Posted Tue, 14 Apr 2020 11:34:29 GMT by Chris McFarland

Hello Simon:

Thank you for taking a look with me here.

Some interesting developments and I've attached my Program.cs and PlatformClient.cs files so that you can see what I have going.

While the condition persists where only things in the entry point call and execute their assemblies, I was able to get a successful 'move item from document tray to file cabinet' action by placing an instance of that code into the entry point itself.  

This shows that the code works on a basic level (not surprised since it was already in the project...) and that it would probably work if things outside the entry point were calling their assemblies.

You'll find that I've set the access modifiers to public in my Project.cs file for things after the entry point, but really a blind stab that didn't work so I'll be changing those back to their defaults.

Having the code to move from document tray to file cabinet in the entry point works in an experimental way, but carries real problems.  For one it seems to be pretty far out from best practices and maybe even more important is a functional limitation where I have to specify the DocID for it to fire off.  In the real world I'd need for this to be dynamic and I didn't have any luck bringing the dynamic search elements in the code up into the entry point to deliver full functionality even if the construction was pretty far out from standard.

I really appreciate you taking a look with me and look forward to getting your opinion on what you see.

Thanks!

Chris McFarland

Posted Wed, 15 Apr 2020 07:52:23 GMT by Simon H. Hellmann Toshiba TGIS GmbH | IT-Consultant - Document Management Solutions
Hi Chris, 

first of all, please remove the information about your cloud system from the attachments. 

Second, you created a console application in C# - console applications always just do what is defined in the method "main" and then quit - this is just how the C# logic works. 
To be able to call other methods defined in the same class "Program", you would need to call the following code in your main method:
static void Main(string[] args)
        {
            Program program = new Program();
            //call whatever methods you need
            program.GetDocumentById("Inbox",true,123);
        }
However, this is not really best practice. If possible, you should aim to put your methods into a new class and create an instance of the new class which contains all the logic. 
For example, I recently created a test application with this Main method (don't call your productive class like that though):
        static void Main(string[] args)
        {
            DoThings doThings = new DoThings();
            doThings.CheckForNewDocuments();
        }
If you want to have dynamic search criteria, you might want to think about building a WPF or Windows Forms application instead so the user can input their criteria into a GUI. 
If it is something which should run automatically, you should either stay with the console application and have it start through task planning or switch over to a windows service with a timer. 

In any case, you might want to use a configuration file to set your search criteria - have a look at how the App.config works, that is probably the easiest way in C#. 


Greetings from Germany, 
Simon H. Hellmann
DocuWare System Consultant
Posted Wed, 15 Apr 2020 11:16:01 GMT by Chris McFarland
Hello Simon:

Yes, I guess that makes sense to wipe out the system info...

First, thank you for spending some time working through this with me.

That gives me some angles to work down so I'm going to roll up my sleeves and report back after I cover some more ground.

You must be signed in to post in this forum.