I just attach CSV file in note section form an entity. Then after attached csv file in note section , whatever the data in csv file just insert in to entity fields using plugin.
*This post is locked for comments
I have a doubt about to get id of attached file in note section.
Share with u code details , at the time click on ribbon button the attached csv file from note section carry data and insert it into entity fields.
$('#infg.infg_mta.Button2.Button').on("click",function(e){
e.preventDefault();
$('#files').parse({
config: {
delimiter: "auto",
complete: buildTable,
},
before: function(file, inputElem)
{
//console.log("Parsing file...", file);
error: function(err, file)
//console.log("ERROR:", err, file);
complete: function()
//console.log("Done with all files");
}
});
function buildTable(results){
var markup = "<table class='table'>";
var data = results.data;
for(i=0;i<data.length;i++){
markup+= "<tr>";
var row = data[i];
var cells = row.join(",").split(",");
for(j=0;j<cells.length;j++){
markup+= "<td>";
markup+= cells[j];
markup+= "</th>";
markup+= "</tr>";
markup+= "</table>";
$("#app").html(markup);
You might actually try to re-use import functionality. There is an example here:
https://msdn.microsoft.com/en-us/library/hh547396.aspx
I think Aric has already provided you a link explaining the document attachments..
https://msdn.microsoft.com/en-us/library/gg328429.aspx
Here are some links to help you start, but as Pawel mentioned, there are a lot of links your can search online:
// Reading CSV file. You will have to modify reading for directory to reading from stream
stackoverflow.com/.../reading-csv-files-using-c-sharp
// MSDN Upload Retrieve and Download attachment
msdn.microsoft.com/.../gg328429.aspx;MSPPError=-2147217396
// MSDN Use Entity class for create update and delete
msdn.microsoft.com/.../gg309731.aspx
As I said - there are thousands of links. Just copy paste to Google search each of the step that I posted and choose whichever you will find suitable and clear enough for you.
Ok,
Can you please share some referral link.
Do you already have some code for a starting point? Which part are you having problem with? There are thousands examples on google on
1) How to create a plugin in CRM 2016
2) How to read document from an Annotation in CRM 2016
3) How to read CSV file
4) How to update record in CRM 2016
Just put it all together and you will have your solution. Don't expect others to do all the job for you, how fun is it if you don't try to figure something out for yourself at first? If you already have and it's not working then post your code, we will be happy to help you make it work.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Aric Levin - MVP 2 Moderator
MA-04060624-0 1