• Mazlow Cohen 12
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
I am trying to write a trigger to update a field(Field_A) on record(Object_A) when Object_A is created or updated with the value from a field(Field_B) on its Parent(Object_B). The relationship is master detail. Object_B is the master.

 I want to make sure the code is bulkified. I am having a bit of trouble figuring it out. I know it should be simple. 

Any ideas on how to do this best?
Can you help me with this? I am trying to put the following javascript. I want to update a field on a custom object, by clicking a hyperlink text field, that I willl put in a report. So the users can update the field without leaving the report. I want the hyperlink to execute the following or someway to update the record. I have a custom buttom on the layout, but I can't put a custom button in a report. Only fields. Thanks!

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
var ProcTask = new sforce.SObject("FSTR__Process_Task__c"); 
ProcTask.Id = '{!FSTR__Process_Task__c.Id}'; 
ProcTask.FSTR__Status__c = 'Completed'; 

var result = sforce.connection.update([ProcTask]); 
location.reload(true);
I would like to update a field in a record using a hyperlink text field, so it updates the record without having to go in and save it. I am able to do this using a custom button- that executes javascript onclick. But I need a field, to put in report.
I am trying to write a trigger to update a field(Field_A) on record(Object_A) when Object_A is created or updated with the value from a field(Field_B) on its Parent(Object_B). The relationship is master detail. Object_B is the master.

 I want to make sure the code is bulkified. I am having a bit of trouble figuring it out. I know it should be simple. 

Any ideas on how to do this best?

Can I create a hyperlink formula field that will execute javascript?  I have a custom detail page button on tasks that marks a task complete with the following code:

 

{!requireScript("/soap/ajax/10.0/connection.js")};
sforce.connection.session = "{!$Api.Session_ID}";

function updateTask( )
{
try
{
var task = new sforce.SObject("Task");
task.Id = "{!Task.Id}";
task.Status = "Completed";
var result = sforce.connection.update([task]);
if (result[0].getBoolean("success") == false ) {
alert(result[0].errors.message);
return;
}
window.top.location.href=window.top.location.href;
}
catch (e) {
alert(e);
}
}

updateTask();

 

 

I'm trying to show this function in a list view.  I couldn't get a list button to work with this code so I was hoping if I could create a formula field to display a link that would do the same thing as the button, I could just add the field to my related list.

 

I'm trying to give my users the ability to mark tasks complete in a list view with one click (similar to home page functionality, but on opportunties).

 

Has anyone done this before?  Is it even possible?