function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Does anyone know of a way to mass attach documents that are in content to multiple accounts?
Thanks,
ckellie
hi ckellie,
follow the steps to mass attach to multiple accounts,
Step 1:-
.
global class MassNoteInsert{
WebService static Integer insertNotes(String iTitle,
String iBody,
Id[] iParentIds) {
Note[] notes = new Note[0];
iBody = String.escapeSingleQuotes(iBody);
for (Id iParentId : iParentIds) {
notes.add(new Note(parentId = iParentId,
title = iTitle, body = iBody));
}
insert notes; //Bulk Insert
return notes.size();
}}
Create that class.
Then
Step:2
SetupàappsetupàcoustomiseàAccountàButton&linkàcreate new
Select following
Button type:list button
Required javascript
Onclick
Then paste this code
{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}
var idsToInsert= {!GETRECORDIDS( $ObjectType.Account )};
var noteTitle = prompt("Please enter the title of the note");
var noteBody = prompt("Please enter the body of the note");
if (idsToInsert.length) {
// Now make a synchronous call to the Apex Web service
// method
var result = sforce.apex.execute(
"MassNoteInsert", // class
"insertNotes", // method
{iTitle : noteTitle, // method arguments
iBody: noteBody,
iParentIds: idsToInsert });
alert(result[0] + " notes inserted!"); //response
} else if (idsToInsert.length == 0) {
alert("Please select the accounts to which" +
" you would like to add notes.");
Then save
Step 3:-
Goto Account search layout add new button to Account page.
Then click on Account tab u can find button on Account page by using that we can add mass notes to selected Accounts.
Thank you for the code, but I am looking to mass attach content from my content library. Is there any way to do that?
Thank you
hi ckellie,
follow the steps to mass attach to multiple accounts,
Step 1:-
.
global class MassNoteInsert{
WebService static Integer insertNotes(String iTitle,
String iBody,
Id[] iParentIds) {
Note[] notes = new Note[0];
iBody = String.escapeSingleQuotes(iBody);
for (Id iParentId : iParentIds) {
notes.add(new Note(parentId = iParentId,
title = iTitle, body = iBody));
}
insert notes; //Bulk Insert
return notes.size();
}}
Create that class.
Then
Step:2
SetupàappsetupàcoustomiseàAccountàButton&linkàcreate new
Select following
Button type:list button
Required javascript
Onclick
Then paste this code
Then save
Step 3:-
Goto Account search layout add new button to Account page.
Then click on Account tab u can find button on Account page by using that we can add mass notes to selected Accounts.
Thank you for the code, but I am looking to mass attach content from my content library. Is there any way to do that?
Thank you