Attachments
Closed this issue · 3 comments
How can the c# wrapper be used to post Attachments to Xero
Also, does the c# Wrapper support getting Attachments for Invoices? I can't see that it does at this moment and I want to use them.
Also, I have latest version from NuGet (1.1.0.31) which doesn't seem to have been updated recently...
Hi, I found some code to answer my question above. Seems like the API Invoice object doesn't have Attachment properties (but it probably could have?). Instead you do another call using the Attachments object to get them...
This code might help someone:
Attachment objFirstInvoiceAttachment = objFranchise.m_repoXero.Attachments.GetAttachmentFor(objInvoiceFromXero);
string strAttachmentURL_Accounting = null;
if (objFirstInvoiceAttachment != null)
{
strAttachmentURL_Accounting = objFirstInvoiceAttachment.AttachmentID.ToString();
strAttachmentURL_Accounting = objFirstInvoiceAttachment.FileName;
}
The only Attachments at this stage is Journals. The C# wrapper needs to be
approved my Xero before changes is submitted to NuGet. First a change in
the API then coded to Wrapper then Approved then only will it
be available on NuGet
Regards,
Henzard Kruger
*Some are born great others achieve *
http://about.me/henzardkruger
*greatness throughout their lifetime but only
*0711304241
- a Few have Greatness Trusted upon them.
Fax : 0865011267
*John 14:12-14
On Mon, Jan 6, 2014 at 6:08 AM, David Coster notifications@github.comwrote:
Hi, I found some code to answer my question above. Seems like the API
Invoice object doesn't have Attachment properties (but it probably could
have?). Instead you do another call using the Attachments object to get
them...This code might help someone:
Attachment objFirstInvoiceAttachment =
objFranchise.m_repoXero.Attachments.GetAttachmentFor(objInvoiceFromXero);
string strAttachmentURL_Accounting = null;
if (objFirstInvoiceAttachment != null)
{
strAttachmentURL_Accounting =
objFirstInvoiceAttachment.AttachmentID.ToString();
strAttachmentURL_Accounting = objFirstInvoiceAttachment.FileName;
}—
Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-31626354
.