• Amack Dawg
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies
I have been researching this for the last few months and I understand there isn't an API endpoint I can call per se that will allow me this functionality, but does anyone know of any kind of App (either third party or developed by Salesforce's Labs) that exposes an Endpoint that I can effectively send Contact Ids that will then make the required Apex/DML operations to then merge the Contacts?

Use case- I download and gather a list of Contact Ids, group them by identical Email, then join that Email back into the group to get the Unique Ids and batch them in sets that I want to then merge and send to an endpoint

Anyone have any recommended solutions? Is this a simple app where the code already exists for this?
Hi there, I am trying to update existing Opportunity History records by migrating them to a new Opportunity through the Salesforce API, does anyone know of a way to achieve this?

Salesforce is rejecting my Update operation where I attempt to change the OpportunityId value to the Opportunity I am attempting to migrate the values to. I also have 'Set Audit Fields upon Record Creation' and 'Modify All Data' permissions for the user I am attempting this operation for
Scenario: Users need to be able to insert n-number of child records to the selected Parent record where n-number is determined by the integer difference of a Ceiling on two Date fields in the record.

Challenge: How can I retrieve an integer value by subtracting the record's 2 date values in Javascript? I am not even sure the value being returned is a date value (is it a string value)?

Specific code string: 
var weekCount = Math.ceil( (crtvtracker.Creative_End_Date__c - crtvtracker.Creative_Start_Date__c) );

Code block:
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")}

//Retrieve and store the selected accounts
var CrtvTrackerIds = {!GETRECORDIDS( $ObjectType.Creative_ID__c )};

//Do a deeper query selecting required Parent fields
var CrtvTrackers = sforce.connection.retrieve("Id,Name,Creative_Start_Date__c,Creative_End_Date__c","Creative_ID__c",CrtvTrackerIds);

//Creating an array to store insertedCrtvScheds
var insertedCrtvScheds = [];

//... skipping some code checking here

CrtvTrackers.forEach(function(crtvtracker){        

        alert(crtvtracker.Creative_End_Date__c);
        
        var CreativeEndDay = crtvtracker.Creative_End_Date__c.day();
        
        alert(crtvtracker.Creative_End_Date__c.day());

        var weekCount = Math.ceil( (crtvtracker.Creative_End_Date__c - crtvtracker.Creative_Start_Date__c) );
        alert(weekCount);

        var schedToInsert = new sforce.SObject("Creative_Schedule__c");
        alert( crtvtracker.Creative_Start_Date__c.daysBetween(crtvtracker.Creative_End_Date__c) );

        for (weeknum = 0; weeknum < 0 ; weeknum++ ) {
        schedToInsert.Creative_ID__c = crtvtracker.Id;             
        schedToInsert.Traffic_Status_updated__c = "On";
        schedToInsert.Creative_Start_Date_updater__c = crtvtracker.Creative_Start_Date__c + (weeknum * 7);
        
        insertedCrtvScheds.push(schedToInsert);
        }
        //alert(crtvtracker.Creative_Start_Date__c);

        //Pass in the 'Creative Start Date' of the Creative ID    
        //schedToInsert.Creative_Start_Date_updater__c = crtvtracker.Creative_Start_Date__c;
        
        
    });

How can I converte my Creative End Date and Creative Start Date fields to be date fields to achieve the mathematical operation I need?

 
I have a Salesforce javascript List-View Button that I am trying to compile but I keep encountering a Syntax Error. The Code area highlights the '=' in this Statement:
var dayOfWeekVal = {!MOD( ({!TODAY()} - {!DATE(1900,1,8)} ), 7)};

This variable precedes a switch statement. I was able to successfully compile previously, but I had to introduce Salesforce Function-specific syntax.

Does anything in this line of code look syntatically incorrect?

Here is the entire Button code block for context:
 
{!REQUIRESCRIPT("/soap/ajax/36.0/connection.js")} 

var recordIds = {!GETRECORDIDS( $ObjectType.Creative_ID__c )};
var updatedTrackers = [];

//create variable to store the new Creative Start Date
var broadcastCrtvStart;

if (recordIds[0] == null) { 
	alert("Please select at least one Creative ID.") } 
else { 

	var dayOfWeekVal = {!MOD( ({!TODAY()} - {!DATE(1900,1,8)} ), 7)};

	switch( dayOfWeekVal ) {
		case 0: 
			broadcastCrtvStart = {!TODAY()} + 7;
			break;
		case 1:
			broadcastCrtvStart = {!TODAY()} + 6;
			break;
		case 2:
			broadcastCrtvStart = {!TODAY()} + 5;
			break;
		case 3:
			broadcastCrtvStart = {!TODAY()} + 4;
			break;
		case 4:
			broadcastCrtvStart = {!TODAY()} + 3;
			break;
		case 5:
			broadcastCrtvStart = {!TODAY()} + 2;
			break;
		case 6:
			broadcastCrtvStart = {!TODAY()} + 1;
		default:
			broadcastCrtvStart = {!TODAY()};
	}	

	var errors = [];


	for (var i = 0; i < recordIds.length; i++) { 
			var ctracker = new sforce.SObject("Creative_ID__c");
			ctracker.id = recordIds[i];		
			
			ctracker.Creative_Start_Date__c = broadcastCrtvStart;
			updatedTrackers.push(ctracker);
	}


	result = sforce.connection.update(updatedTrackers);

	if (result && result.length){ 
		var numFailed = 0; 
		var numSucceeded = 0;

		for(var i = 0; i < result.length; i++) {		
			var res = result[i]; 
			if (res && res.success == 'true'){ 
				numSucceeded++; 
			} else { 
				var es = res.getArray("errors"); 
				if (es.length > 0) { 
					errors.push(es[0].message); 
				} 
				numFailed++; 
				} 
			}
		} 
	if (numFailed > 0){ 
		alert("Failed: " + numFailed + "\nSucceeded: " + numSucceeded + " \n Due to: " + errors.join("\n")); 
	} else { 
		alert("Number of Creative IDs turned on: " + numSucceeded); 
		} 
	window.location.reload();
}



 
I am trying to send specific dashboard components in regular html emails, and doing some basic reading suggests this certainly isn't an overtly offered feature by Salesforce (yet) but I was wondering if any one had any workarounds?

I noticed each component can be opened as a PNG, is there someway to create a visualforce page that flattens the latest refreshed Component into a PNG and then links that back into an HTML/VF email?
Our sales team will clone opportunities with the same accounts for new upsell opps, but there is a critical Checkbox Field with a Validation Rule that we need to default as "FALSE" (unchecked) however, when the SR clones the record, the checkbox defaults as 'TRUE' which "lets" the rep unwittingly bypass the correct sales step that the Checkbox/validation rule is designed to guide against.  

I am trying to create some business logic that resets a cloned Opportunity check-box field to FALSE if that Opportunity record is cloned. 

Here is what I have tried:
IF (ISCLONE(), Example_Checkbox_field1__c = FALSE, Example_Checkbox_field1__c = TRUE)
I figured out that this rule is only accepted by the syntax checker if the Eval Criteria is set to "Created, and every time it's edited.'

However, this WFR does not work (I made sure it was Activated), cloning the opportunity still results with this Checkbox defaulted as TRUE in the record edit page. 

Is there a way to create a formula that sets the 'Example_Checkbox_field1__c' field to FALSE right after 'Clone' button was clicked and BEFORE the record is actually saved for the first time?
Hi there, I am trying to update existing Opportunity History records by migrating them to a new Opportunity through the Salesforce API, does anyone know of a way to achieve this?

Salesforce is rejecting my Update operation where I attempt to change the OpportunityId value to the Opportunity I am attempting to migrate the values to. I also have 'Set Audit Fields upon Record Creation' and 'Modify All Data' permissions for the user I am attempting this operation for
Scenario: Users need to be able to insert n-number of child records to the selected Parent record where n-number is determined by the integer difference of a Ceiling on two Date fields in the record.

Challenge: How can I retrieve an integer value by subtracting the record's 2 date values in Javascript? I am not even sure the value being returned is a date value (is it a string value)?

Specific code string: 
var weekCount = Math.ceil( (crtvtracker.Creative_End_Date__c - crtvtracker.Creative_Start_Date__c) );

Code block:
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")}

//Retrieve and store the selected accounts
var CrtvTrackerIds = {!GETRECORDIDS( $ObjectType.Creative_ID__c )};

//Do a deeper query selecting required Parent fields
var CrtvTrackers = sforce.connection.retrieve("Id,Name,Creative_Start_Date__c,Creative_End_Date__c","Creative_ID__c",CrtvTrackerIds);

//Creating an array to store insertedCrtvScheds
var insertedCrtvScheds = [];

//... skipping some code checking here

CrtvTrackers.forEach(function(crtvtracker){        

        alert(crtvtracker.Creative_End_Date__c);
        
        var CreativeEndDay = crtvtracker.Creative_End_Date__c.day();
        
        alert(crtvtracker.Creative_End_Date__c.day());

        var weekCount = Math.ceil( (crtvtracker.Creative_End_Date__c - crtvtracker.Creative_Start_Date__c) );
        alert(weekCount);

        var schedToInsert = new sforce.SObject("Creative_Schedule__c");
        alert( crtvtracker.Creative_Start_Date__c.daysBetween(crtvtracker.Creative_End_Date__c) );

        for (weeknum = 0; weeknum < 0 ; weeknum++ ) {
        schedToInsert.Creative_ID__c = crtvtracker.Id;             
        schedToInsert.Traffic_Status_updated__c = "On";
        schedToInsert.Creative_Start_Date_updater__c = crtvtracker.Creative_Start_Date__c + (weeknum * 7);
        
        insertedCrtvScheds.push(schedToInsert);
        }
        //alert(crtvtracker.Creative_Start_Date__c);

        //Pass in the 'Creative Start Date' of the Creative ID    
        //schedToInsert.Creative_Start_Date_updater__c = crtvtracker.Creative_Start_Date__c;
        
        
    });

How can I converte my Creative End Date and Creative Start Date fields to be date fields to achieve the mathematical operation I need?

 
I am looking for a way to access the Notes and Attachments section on a custom object called Assets__c. I am using the Force.com REST API to access the platform, and on the UI, there is a notes and attachment section that lists the files that have been uploaded using Chatter. I want to know the URL and method by which I can access these files and how/if I will get a direct link to those attachments that I can then use client side.

Any help would be incredible! Thanks!
Our sales team will clone opportunities with the same accounts for new upsell opps, but there is a critical Checkbox Field with a Validation Rule that we need to default as "FALSE" (unchecked) however, when the SR clones the record, the checkbox defaults as 'TRUE' which "lets" the rep unwittingly bypass the correct sales step that the Checkbox/validation rule is designed to guide against.  

I am trying to create some business logic that resets a cloned Opportunity check-box field to FALSE if that Opportunity record is cloned. 

Here is what I have tried:
IF (ISCLONE(), Example_Checkbox_field1__c = FALSE, Example_Checkbox_field1__c = TRUE)
I figured out that this rule is only accepted by the syntax checker if the Eval Criteria is set to "Created, and every time it's edited.'

However, this WFR does not work (I made sure it was Activated), cloning the opportunity still results with this Checkbox defaulted as TRUE in the record edit page. 

Is there a way to create a formula that sets the 'Example_Checkbox_field1__c' field to FALSE right after 'Clone' button was clicked and BEFORE the record is actually saved for the first time?

Hi Everyone,

 

What we are trying to achieve is to have a checkbox return a value other than "0" and "1", whether it be the field name, or a custom string of text, either would work. Does anyone know if this is possible? As far as I know, operators cannot be used in email templates?

 

Thanks for any advice