CandyWrapper: Attaching Files Programmatically

sugarcrmdevelopers —  September 5, 2011

Editor’s Note: Normally we don’t run posts on weekends or US Holidays ( such as today, which is Labor Day here in the US ), but I could hold back as I saw this great post that helped elevate a solution to a problem a poster on the forums was seeing.

This post comes from the blog of Sugar community member Angel Magana, who is also the creator of CandyWrapper, which is a .NET interface into Sugar web services. In this post, he answers a forums question on how to attach files using CandyWrapper.

A recent question on the SugarCRM Forums served as a reminder of a specific programming need whose steps are not immediately obvious. Before we go any further, let us discuss the scenario so we have a clear understanding of our intended goal.

In our example, we will assume we need to attach files to a Lead record using a custom application that we have built. We will focus on the part of the