• Lisa Selden
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
Hello, 
I need to create 2 fields:
1) The date the last task or event was logged and completed for contacts
2) How many patients (custom object- child record of contact) from 30 days since that last task was logged

The Salesforce Support team told me to post on here. They said that it requires custom coding. Please let me know if I need to add futher detail. Thank you!
Hello, I am trying to create a custom button for all contacts in an account. I have the code below but this is calling for apex which is not a feature for my organization. Can this be written for Javascript? Thanks in advance! 


01{!REQUIRESCRIPT("/soap/ajax/34.0/connection.js")}
02{!REQUIRESCRIPT("/soap/ajax/34.0/apex.js")}
03 
04var url = '/{!Account.Id}';
05 
06var myquery = "Select Id, Name from Contact Where AccountId = '{!Account.Id}'";
07result = sforce.connection.query(myquery);
08records = result.getArray("records");
09 
10var taskArr = [];
11for(var i=0; i < records.length;i++)
12{
13var task = new sforce.SObject("Task");;
14task.WhoId = records[i].Id;
15task.WhatId = '{!Account.Id}';
16taskArr.push(task);
17}
18 
19var results = sforce.connection.create(taskArr);
20if (results[0].getBoolean("success")) {
21window.parent.open(url, "_self");
22} else {
23alert("Failed to create Task " + results[0]);
24}
Can anyone help me create a button that will log activity for each member in the account? Thanks in advance!
Hello, I am trying to figure out how to write a JAVA script to create a button. I was hoping to add the same task to all contacts in the account. Any help would be appreciated. Thanks!
 
Hello, I am trying to figure out how to write a JAVA script to create a button. I was hoping to add the same task to all contacts in the account. Any help would be appreciated. Thanks!