• Artem Chernov
  • NEWBIE
  • 5 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hi there,

I'm using the below javascript in a cusom button to update two fields within an opportunity when clicked.
  • The field DIP_Accepted__c is a checkbox - This needs to be set to "True" when the button is clicked
  • The field Date_DIP_Accepted__c is a DateTime field - This need to populate with the current Date&Time when the button is clicked.
The button is executing but the datetime field and tick box are not populating at all.

Please can someone help let me know where I'm going wrong?

Thanks,
Ed
 
{!REQUIRESCRIPT("/soap/ajax/35.0/connection.js")}

var oppToUpdate = new sforce.SObject("Opportunity");
console.log(oppToUpdate.DIP_Accepted__c);

  oppToUpdate.DIP_Accepted__c = true;
  oppToUpdate.Date_DIP_Accepted__c = new Date().toISOString();

  sforce.connection.update([oppToUpdate]);

  window.location.reload();

 
public class Task{
    public Datetime Created_Date;
    public Date Completed_Date;
    public String Comments;
    public string Email;
    public string Amount;
}
 
Hi, 
I have a case record type called Client Ending with a field on it called reason for ending which is a multi pick list.
I then have a Contact record type of Client Contact which also has a field called reason for ending and is also a multi pick list. 
What I need to do is copy the data from the case reason for ending to the field from the client ending case to the client contact page but only if this is blank.
I have created the following process but it is not working any advice welcom. 
User-added image
User-added image
User-added image
User-added image
User-added image
Please help!