Document History

Discussions concerning general integration topics.

Moderator: Phil Barton

ngillet
Posts: 40
Joined: Tue Apr 05, 2016 4:32 pm

Document History

Post by ngillet »

For some user when they drag and drop a document under attachment tab in an order that document also showed in document history tab but when I added documents in attachment it does not go under Document History tab.
I also find that some document source is "Attached" and some source is "Published" could you please explain how we can get these.
Attachments
Inkedpublish_LI.jpg
Inkedpublish_LI.jpg (131.53 KiB) Viewed 100806 times
InkedDocumentHistory_LI.jpg
InkedDocumentHistory_LI.jpg (105.75 KiB) Viewed 100806 times
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Document History

Post by BobRichards »

If a document is in the Attachment folders as "Published", then it was generated by selecting a document in the "Document Selection" dialog (in an open order, select "Documents" in ribbon at top). The user selected the "Publish" action for the document. Only documents that are generated then distributed in the "Document Selection" screen will appear in the "Document History".

If the document is in the Attachment folders, then it was added by manually adding the file (by right clicking on a folder) or by dragging the file into the file explorer area of the screen.
Bob Richards, Senior Software Developer, SoftPro
ngillet
Posts: 40
Joined: Tue Apr 05, 2016 4:32 pm

Re: Document History

Post by ngillet »

Could you please provide the database mapping of "Attachment" tab of SoftPro

Currently in our project if any new document goes to Document History tab then a information email goes for that newly added document to their corresponding users ,but if someone drag and drop the document in "Attachment" folder then they are not able to receive the emails because that document do not go to Document History because its source is attached

Now we want emails to be send for newly added document in "Attachment" folder but emails should not send for the documents which are automatic added in "Attachment" folder when a order is created

Please kindly suggest the way in which we can do this task
Attachments
attachment_tab.PNG
attachment_tab.PNG (111.52 KiB) Viewed 100791 times
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Document History

Post by BobRichards »

There is no database mapping from orders to attachments since all attachments are written to the blob database. The indexing information for the attachments is only in the order itself and not in SQL.

However, you can write an Automation Snippet that takes action when a file is "Attached" to the order by the user (Document is attached). In the snippet, you can do actions that are coded in Python but interact on a low level (think C# API interface) to do anything you want. I'm sorry but you would have to write the code yourself since we don't provide a user accessible email utility in Select but it is doable in .NET libraries.

Please be aware that working with snippets can be difficult since there is no debug IDE. If you want to see about SoftPro writing the snippet, please talk to the manager of the Custom Applications department - Elliott Potts (Elliott.Potts@softprocorp.com).

Take a look at the Automation Snippets forum for some ideas of its capability.
Bob Richards, Senior Software Developer, SoftPro
ngillet
Posts: 40
Joined: Tue Apr 05, 2016 4:32 pm

Re: Document History

Post by ngillet »

Potts has share SDK with us for that I installed vs 2015 and then SoftPro Select Client .
So to create a package, SDK is installed,then I select New -> Project from the VS2015 File menu. Under the Visual C# -> SoftPro -> Select node I do not find any "SoftPro Select Server Package".
Why I am not finding this please help me out with this.

And what should be the .Net Framework version .It should be same as our application .Net Framework version??
Attachments
packageIssue.PNG
packageIssue.PNG (44.03 KiB) Viewed 100766 times
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Document History

Post by BobRichards »

The new Select projects will not build in the displayed .NET version (4.5.2). I can't remember the framework number but it is 4.6.x or 4.7.x. The most recent release of Select required .NET 4.8 and that will require Visual Studio 2019 (among others).
Bob Richards, Senior Software Developer, SoftPro
ngillet
Posts: 40
Joined: Tue Apr 05, 2016 4:32 pm

Re: Document History

Post by ngillet »

I have written below code for package for AttachmentAdded event:
protected override void OnInitialize()
{
// Listen to the environment started event.
ISelectServerEnvironment environment = GetService<ISelectServerEnvironment>();
environment.Started += SelectServerEnvironment_Started;
}

// This method is called when the server is finished loading packages and services.
private void SelectServerEnvironment_Started(object sender, System.EventArgs e)
{
// Unhook this event as it is no longer needed.
ISelectServerEnvironment environment = GetService<ISelectServerEnvironment>();
environment.Started -= SelectServerEnvironment_Started;

//attachment event
System.EventHandler<SoftPro.OrderTracking.Client.Orders.AttachmentItemEventArgs> attachment
= GetService<System.EventHandler<SoftPro.OrderTracking.Client.Orders.AttachmentItemEventArgs>>();
attachment = new EventHandler<AttachmentItemEventArgs>(Attachment_added);

}

// This method is called when an attachment is added
private void Attachment_added(object sender, AttachmentItemEventArgs e)
{
IAttachmentItem item = e.Item;
System.Guid id = item.ID;
string attachment_name = item.Name;
string path = item.Path;
IAttachmentFolder parent_folder = item.Parent;
System.Collections.Generic.IDictionary<string,string> tag = item.Tags;
}

-----------------------------------------------------------------------------------------------------------------------------------------------------------
How could I debug this code and know what is coming in this item property and write further code
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Document History

Post by BobRichards »

You must register for the AttachmentAdded event after you have loaded an order (the IOrder object). You cannot register with Select at the beginning to get ALL AttachmentAdded events to all orders. The pseudocode is as follows:

Code: Select all

    IOrder order = {open an order}
    order.AttachmentAdded += Order_AttachmentAdded;
    ...
}

// Register to receive notification when an attachment has been added.
private static void Order_AttachmentAdded(object sender, AttachmentItemEventArgs e)
{
        IAttachmentItem item = e.Item;
        ....
}
Bob Richards, Senior Software Developer, SoftPro
ngillet
Posts: 40
Joined: Tue Apr 05, 2016 4:32 pm

Re: Document History

Post by ngillet »

When someone has published the document it goes to Document Histroy tab in SoftPro and is it 100% sure it also goes to Attachment ->folders ?????

I want to hit this " https://api.myventuretrac.ml:8443/escro ... eDocuments" with payload when document is added how could I achieve this?

and one dll is missing I do not find it under SoftPro folder how could I get that?????

please found below the code which I write for attachmentadded event:
using SoftPro.Accounting.Client;
using SoftPro.ClientModel;
using SoftPro.EntityModel.Packaging;
using SoftPro.OrderTracking.Client;
using SoftPro.OrderTracking.Client.Orders;
using SoftPro.Select.Client;
using SoftPro.Select.Service;
using SoftPro.ServerModel;
using System;
using System.Runtime.InteropServices;

namespace ServerPackage1
{
[Guid("026ae76b-5489-447a-bafe-63ca269b69c6")]
partial class MyPackage : Package
{
// This method is called when the package is loaded by the server.
protected override void OnInitialize()
{
// Listen to the environment started event.
ISelectServerEnvironment environment = GetService<ISelectServerEnvironment>();
environment.Started += SelectServerEnvironment_Started;
}

// This method is called when the server is finished loading packages and services.
private void SelectServerEnvironment_Started(object sender, System.EventArgs e)
{
// Unhook this event as it is no longer needed.
ISelectServerEnvironment environment = GetService<ISelectServerEnvironment>();
environment.Started -= SelectServerEnvironment_Started;

IOrder order = GetService<IOrderStore>();
order.AttachmentAdded += Order_AttachmentAdded;
//This below url is api of my project which should be hit when some document is added
//how this url hit with payload data?????????????????
https://api.myventuretrac.ml:8443/escro ... eDocuments
}

// This method is called when an attachment is added
private void Order_AttachmentAdded(object sender, AttachmentItemEventArgs e)
{
IAttachmentItem item = e.Item;
System.Guid id = item.ID;
string attachment_name = item.Name;
string path = item.Path;
IAttachmentFolder parent_folder = item.Parent;
System.Collections.Generic.IDictionary<string,string> tag = item.Tags;
}
}
}
Attachments
dll missing
dll missing
dllMissing.PNG (65.87 KiB) Viewed 100749 times
ngillet
Posts: 40
Joined: Tue Apr 05, 2016 4:32 pm

Re: Document History

Post by ngillet »

1)I have installed the SoftPro Select Server but I do not find the missing dlls.

2)In my package I have to made a api call when a document is added to order and send payload data which contain {ordenumber ,documents name}

3)I have write my question in bewteen code also

4)How could I store this document added information in a table in database?

private void SelectServerEnvironment_Started(object sender, System.EventArgs e)
{
// Unhook this event as it is no longer needed.
ISelectServerEnvironment environment = GetService<ISelectServerEnvironment>();
environment.Started -= SelectServerEnvironment_Started;

IOrder order = GetService<IOrderStore>();
order.AttachmentAdded += Order_AttachmentAdded
}
// This method is called when an attachment is added
private void Order_AttachmentAdded(object sender, AttachmentItemEventArgs e)
{
IAttachmentItem item = e.Item;
System.Guid id = item.ID;/////what is this ID ?
string attachment_name = item.Name;////Is this document name which is added?
string path = item.Path;
IAttachmentFolder parent_folder = item.Parent;
System.Collections.Generic.IDictionary<string,string> tag = item.Tags;
}
Attachments
path.PNG
path.PNG (24.86 KiB) Viewed 100739 times
Post Reply