• Harish D
  • NEWBIE
  • 80 Points
  • Member since 2017

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 15
    Replies

How do I define a Date field  in the class to call in a Constructor

Here is my  class - 

public class CustomFields {
            public String fieldName;
            public String stringValue;
           
            public CustomFields(String fieldName, String stringValue){
                this.fieldName = fieldName;
                this.stringValue = stringValue;
            }
 

Here is the constructor 

jo.customFields = new List<CustomFields>();
            jo.customFields.add(new CustomFields('CX.LEADS360ID', currentOpp.Opportunity_ID__c));
            jo.customFields.add(new CustomFields('CX.LEADS360CAMPAIGN', currentOpp.Lead_Source_Name__r.Name));
            jo.customFields.add(new CustomFields('Date.CX.LEAD.CREATE.DATE', currentOpp.Legacy_Lead_Date_Added__c));
            jo.customFields.add(new CustomFields('CX.CRM.OWNER.EMAIL', currentOpp.Owner.Email));
 

I cannot add 

jo.customFields.add(new CustomFields('Date.CX.LEAD.CREATE.DATE', currentOpp.Legacy_Lead_Date_Added__c));

Because Opp.Legacy_Lead_Date_Added__c is a date field . How do I add a date variable in my class and call it in the constructor
       

Error I am getting 

Constructor not defined: [CustomFields].<Constructor>(String, Date) 

Hi There!

I am trying to calculate the total number os days in a given month based on custom fields created at the Opportunity level:

Custom Fields:
  • Start Date
  • End Date
  • Start Month
  • Last Day EOM
IF( Start_Date__c > Last_Day_EOM__c ,0,
IF( End_Date__c < Start_Month__c ,0,
IF(AND(Start_Date__c < Start_Month__c ,End_Date__c > Last_Day_EOM__c), Last_Day_EOM__c - Start_Month__c +1,
IF(AND(Start_Date__c < Start_Month__c, End_Date__c <= Last_Day_EOM__c), End_Date__c - Start_Month__c +1,
IF(AND(Start_Date__c >=Start_Month__c, End_Date__c <= Last_Day_EOM__c), End_Date__c - Start_Date__c +1,
IF(AND(Start_Date__c >= Start_Month__c,End_Date__c > Last_Day_EOM__c), Start_Month__c - Start_Date__c +1 , 0 ))))))

Any assistance in shorting this formula would be GREAT!

Thanks all!
I'm having trouble getting started with a basic trigger.  When a product is added to a quote, I want it to pull the product description.  Any help getting started would be appreciated

my test so far looks like:

trigger AddDescription on QuoteLineItem (before insert) {
    for (QuoteLineItem qli : Trigger.New){
        qli.Description = 'Description here';
    }
}
Hello,

I am looking to implement a feature that when an email is recieved on a case that has been Resolved or Closed the email creates a new case rather than linking to the original case.

I have tried a couple of things without achieving the desired results. 1) removing the case reference string from the email body/subject and removing the parent Id, 2) cloning the case.

I want the email to follow the email to case rules and assign the new case as per the rules we have set up. Any answers/suggestions would be useful.

Thanks,
Ashley
Hi all,

This is my scenario : 
I use all standard objects to do my opportunity (opportunity, opportunity line items, quotes, products ...)
When I create an opportunity, I select my product by click on "Add product" button. When I choose my pricebook I click on "next" and select my products" and after "Select". I arrive in the "Add products" page to enter my sales price.
Here is my problem : I just want to know if it's possible to create a visualforce page or another things to replace this page and display some fields in term of the product type ?

Really thanks in advance
Cheers
Thomas

How do I define a Date field  in the class to call in a Constructor

Here is my  class - 

public class CustomFields {
            public String fieldName;
            public String stringValue;
           
            public CustomFields(String fieldName, String stringValue){
                this.fieldName = fieldName;
                this.stringValue = stringValue;
            }
 

Here is the constructor 

jo.customFields = new List<CustomFields>();
            jo.customFields.add(new CustomFields('CX.LEADS360ID', currentOpp.Opportunity_ID__c));
            jo.customFields.add(new CustomFields('CX.LEADS360CAMPAIGN', currentOpp.Lead_Source_Name__r.Name));
            jo.customFields.add(new CustomFields('Date.CX.LEAD.CREATE.DATE', currentOpp.Legacy_Lead_Date_Added__c));
            jo.customFields.add(new CustomFields('CX.CRM.OWNER.EMAIL', currentOpp.Owner.Email));
 

I cannot add 

jo.customFields.add(new CustomFields('Date.CX.LEAD.CREATE.DATE', currentOpp.Legacy_Lead_Date_Added__c));

Because Opp.Legacy_Lead_Date_Added__c is a date field . How do I add a date variable in my class and call it in the constructor
       

Error I am getting 

Constructor not defined: [CustomFields].<Constructor>(String, Date) 

I'm trying to integratre call records from a third-party 1-800 number provider.  To deliver the call records via API, the configuration on their end (See screenshot below) requires 1) an end-point url and 2) http headers that are passed along the request (authentication and call record key value pairs).  I'd like the call records to populate a custom object named TFN_Call__c.   Key / Values they provide include some of the following:
{callId} ,{sessionId} ,{start} ,{end} ,{dnis} ,{phoneType} {target}

To test, I'd like the incoming call record's {sessionId} to populate the name field on the custom TFN_Call__c object.

I've set up a Connect App that provices a consumer key and consumer secret.  I'm looking for help setting up the endpoint url and headers that salesforce wiil accept from an authentication standpoint.  In Workbench, using the Rest API utility, I'm able to create TFN_Call__c records using the following url   /services/data/v43.0/sobjects/TFN_Call__c.   

1) Should the end point url that I'm supposed to add in the configuration section below equal the following:
   
https://{mycompanydomain}.my.salesforce.com/services/data/v43.0/sobjects/TFN_Call__c?Name={sessionId}

2)  What are required headers:
grant_type: 
client_id : 
consumer_secret:
name: {sessionId}

anything else.  Any help pionting me in the right direction will be greatly appreciated. 



API Set Up
Hi

I currently have a workflow rule set up for a donation page that will send an email to the doner when someone submits a donation. 

This is what my workflow rule looks like: 

AND( rC_Connect__Batch_Upload_Campaign_Matched__c  = '2019 BftM Ticket Page', rC_Connect__Event_Purchase_Giving_Amount__c > 0 , rC_Connect__Giving_Paid__c  = True)

For context the company I work for is a non-profit who uses batchupload linked with a payment provider to collect payments. 

I tried using the debugger to look at the workflow to see what's wrong. This is what I get: 

User-added image

Clearly I'm doing something wrong because I don't see my workflow and I obviously don't know how to use the debugger. Hoping someone can give some direction. 

 
Hi There!

I am trying to calculate the total number os days in a given month based on custom fields created at the Opportunity level:

Custom Fields:
  • Start Date
  • End Date
  • Start Month
  • Last Day EOM
IF( Start_Date__c > Last_Day_EOM__c ,0,
IF( End_Date__c < Start_Month__c ,0,
IF(AND(Start_Date__c < Start_Month__c ,End_Date__c > Last_Day_EOM__c), Last_Day_EOM__c - Start_Month__c +1,
IF(AND(Start_Date__c < Start_Month__c, End_Date__c <= Last_Day_EOM__c), End_Date__c - Start_Month__c +1,
IF(AND(Start_Date__c >=Start_Month__c, End_Date__c <= Last_Day_EOM__c), End_Date__c - Start_Date__c +1,
IF(AND(Start_Date__c >= Start_Month__c,End_Date__c > Last_Day_EOM__c), Start_Month__c - Start_Date__c +1 , 0 ))))))

Any assistance in shorting this formula would be GREAT!

Thanks all!
public class Program1 
{
    public void print()
    {
         integer i, j;
            for (i = 1; i <= 5; i++)
            {
                for (j = 1; j <= i; j++)
                {
                    system.debug(i);
                }
                 
            }
    }
}

i am getting output but not in this shape User-added image
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5 
 
I'm having trouble getting started with a basic trigger.  When a product is added to a quote, I want it to pull the product description.  Any help getting started would be appreciated

my test so far looks like:

trigger AddDescription on QuoteLineItem (before insert) {
    for (QuoteLineItem qli : Trigger.New){
        qli.Description = 'Description here';
    }
}
Hi Guys, I'm a newbie for Salesforce...

I'm trying to insert 200 Account record through Bulkification process...However I get the above message...I'm just practicing the below code...I'm unable to execute...please help....
Here is the code...

public class DMLUtility 
{
  Public Static void InsertBulkAccounts()
  {
      //Insert 200 Account records...Always use bulkification process...
      
      List<Account> lstAccounts = new List<Account>(); 
      
      for(integer counter = 1; counter <=200; counter ++)
      {
          //Create an account record..
Account acc = new Account();
          
          acc.Name = 'Bulk Accounts - '+ counter;
          acc.Rating = 'Hot'; 
          acc.AnnualRevenue = 2000000;
          acc.Industry = 'Finance'; 
          acc.Type = 'Open - Direct';  
          acc.Ownership = 'Public'; 
          acc.Site = '554544'; 
          acc.CustomerPriority__c = 'high';  
          acc.Active__c = 'Yes'; 
          
          //Add the record
          lstAccounts.add(acc); 
          
      }
      //Insert the collection of records....
      if(! lstaccounts.isEmpty())
      {
          insert lstAccounts;  
      }
  }
}

Thanks in advance
I have a custom object, where I am storing all the outbound messages and processing all the outbound messages one by one. When I process each outbound message, it will write into the data base and I get the unique number from database, which needs to be updated in the Account Object. To do this, I am using SOQL query to extract the matching account record using the record type id from outbound message. (Note: When I am creating the account in salesforce, I write the a.id into the outbound message object.)
SELECT Id, Name, Unique_Number FROM Account WHERE RecordTypeId = :Record_Id__c from outbound message object. (Note: When I am creating the account in salesforce, I write the a.id into the outbound message object into the field Record_Id__c)
The above query is returning more than 30 records ... but I am expecting only record as output.. how this is possible ?? Id is unique for every record right... what is wrong here...
 
  • May 14, 2018
  • Like
  • 0
Hi, I'm very new to Salesforce development. I'm looking for a way to provision auth providers and named credentials through code. I originally posted my question on the general helps site: https://success.salesforce.com/answers?id=9063A000000iiVd. Anything to point me in the right direction, or alternative solution recommendations, would be much appreciated. Thanks.
Our team is working on a mobile app for android and iOS. We have connected apps for both types of device, and are trying to get devices registered for Push Notifications.

Push Messages are enabled in both apps, and we've been able to register using Android; however, using iOS, get the following error:
 
2017/07/14 16:14:23.205 AppName[698:2a07] ERROR com.salesforce: Registration for notifications with Salesforce failed with status 404
2017/07/14 16:14:23.206 VertexGPS[698:2a07] ERROR com.salesforce: Response:(
        {
        errorCode = "NOT_FOUND";
        message = "The requested resource does not exist";
    }
)

Has anyone encountered this before? Could this be related to a configuration issue?

 Hello All,

 

I am creating a custom object to track trade in programs. Is there a way to add a thread ID so that when e-mail that are sent from this object are replied to that it auto associates back to the existing Trade in record?

 

Thanks,

PB

I have a requirement where i need to delete few Account records from my Production and do backup for them in seperate sandbox.Backup of Accounts should also include all its related lists data including ATTACHMENTS.Am unable to export& backup attachments on those specific records that are to be deleted.

I did "Data Export" and also i exported through Data Loader using "Attachments" Object but i couldn't get any files except their Id's.

Can Someone help with your valuable suggestions?