Thuy Tran
Thuy Tran

Reputation: 11

Acumatica API get all attachments

I have a problem while trying to get attachment from ACUMATICA through API service. As the example in http://acumaticaopenuniversity.com/pdf/T210_Acumatica_Web_Services.pdf page 36

Example code here

But I don't know how many files here and what are their names? How can I get all attachment of this entity?

Thank in advance.

Upvotes: 0

Views: 521

Answers (1)

Hugues Beauséjour
Hugues Beauséjour

Reputation: 8299

The contract based web service API has a straightforward GetFiles interface for getting all files of an entity. When you don't have special requirements that forces you to use the screen based web-service API, I'd recommend you use the contract based one.

Interface:

File[] GetFiles(Entity entity)

Usage pseudo-code:

using (DefaultSoapClient soapClient = new DefaultSoapClient())
{
    soapClient.Login("username", "password", "CompanyLoginName", null, null);

    File[] files = soapClient.GetFiles((Entity)soapClient.Get(new Entity { EntityIntField = new IntSearch { Value = 1 } }));
}

Contract based web service API reference:

http://acumaticaopenuniversity.com/courses/i210-contract-based-web-services/

Upvotes: 2

Related Questions