• Piyush Gautam 6
  • NEWBIE
  • 260 Points
  • Member since 2017
  • Salesforce Developer


  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 40
    Replies

Hey...

We have an external system that needs to link to accounts in Salesforce. We don't have the account ids in the external system so we can't directly link them. We do have an external id though (customer_number). Is there anyway to use that external id to route to the account is Salesforce? 

 

ex: salesforce.com/lightning/r/Account?customer_number=123 

Hi guys,

I have custom formula fields on the OpportunityLineItemSchedule object which display a month based on the month the scheduled date falls within. 

I have created 12 custom fields on the OppLine object, each labeled one of the months of the year. I need a way of rolling up the Quantity of the the related schedules to the corresponding custom fields on the OppLine. 

Has anyone created anything similar in the past?
I'm using a PB Flow and a Visual Flow to achieve the following. When a new Shipment (custom object) record is created, it contains Shipping Address details. If the address is X, and a Building Record (custom object) already exists also with a value X, then use the Visual Flow to relate those records. However, if X does not exist as a Building record, then create a new Building record, mapping over details from the Shipment, and then update the Shipment record to establish a relationship. 

The flow below is not recognizing Buildings in the database and is instead creating new Buildings each time it runs. Can someone please advise on how to solve this puzzle?

User-added image

These are my loop variables:

User-added image

And these are the Decision Conditions I'm using to determine if there is a match between a Building in the Collection and the Variables passed through from the Shipment record (of couse this is not working). 
User-added image
 
Hello,

I am trying to create a formula for a workflow rule that will cause it to trigger only when a field changes from a certain value.

Specifically:

I want a field named "Lead_Status" (picklist) to be set to the value "Returning", when an account owner is changed FROM one of our internal admin accounts (i.e. user 1, user 2, or user 3.) to a sales rep (i.e. user 3, user 4, or user 5) AND another field named "ABW" is NOT checked (i.e. boolean = false).
Hi All,
Can someone help me with this.

I need functional that will select the contact and check statuses for all related Opportunities. If all Opportunities are LOST, then make a checkbox "All Opp Lost" on Contact record as True.
Probably it will be a trigger for Insert/Update /Delete on Opportunity object, but how to implement the logic.

Thanks in advance!

We are using a VF Page to display the latest products invoiced of an Account. Those values are retrieved from the Sales Lines (Custom Object) which are set private. 

However, Users who can access the Account, can also see the VF Page (as they need it for their own Accounts) and at the moment also get data desplayed in the VF they shouldn't see. Is there a way to prevent users seeing data in the VF they shouldn't? 

Hi,

When lead created from our web form, visitors put their full name into the FIRST NAME field.

I need a way to find how many words in the field and then split it and update it back to the first and last name field in the lead.

Here is an example when the lead created

First Name: Johnny Clark
Last Name: [not provided]

I want to split it out correctly using processes builder.

First Name: Johnny
Last Name: Clark

Does anyone have any idea? please let me know.

Thanks!

I have a list of fields on Account and an equal list of fields on Checklist_Library__c. Each field is a Boolean and there are 22 fields in total. 

I have a third object called Compliance__c which is related to both the Account and the Checklist_Library__c.  I need to look at the values and if any PAIR (from Account and Checklist_Library__c) == TRUE then Compliance__c status = "Not Applicable"

So if account.Value_1__c && Checklist_Library.Value_1__c == True, then Compliance.Status = "Not Applicable"

We are trying to do this on insert of the Compliance records and we generate approx 500 of them each time so I need to look at each compliance item and check to see if the status should be set to NA.

Each of the Compliance items are all related to 1 Account, but each Compliance item has a different Checklist_Library__c item it is related to.

So I need to loop through the Compliances being created, compare the flagged values on the Account, and see if the Compliances related Checklist_Library has any of the same named values flagged. I am trying really hard not to nest select statments inside a loop but that is what I keep running into. I list the Account values, then for each compliance item I query the related checklist libary for values in the same order and compare each value in the list and if ANY are equal, then I change status to true. Is there a better way to go about this?

Dear Team,
when creating a new Opportunity record for a specific account, I would need to access the value of a custom field from the most recent closed-won opportunity of a certain deal type. 

What would be the best approach here? Building an Opportunity Trigger and use SOQL to access the most recent opportunity? 
 

Thank you. 

GC

I need to carry out a process to send a reminder email when a date / time field is missing an hour from what the record says some would help me

Hey...

We have an external system that needs to link to accounts in Salesforce. We don't have the account ids in the external system so we can't directly link them. We do have an external id though (customer_number). Is there anyway to use that external id to route to the account is Salesforce? 

 

ex: salesforce.com/lightning/r/Account?customer_number=123 

Hi there,

I am trying following test class with api version 46.
my expected result is as follow.
totalUser = 0 and totalAccount = 0
But totalUser is not 0.
Any suggestion for using with @isTest(SeeAllData = false) User Object?
@isTest(SeeAllData = false)
public class TestClassSample {
    
    private static testMethod void test01() {      
        
        Test.startTest();
        
        System.debug('Total User Record = ' + [Select Count(Id) totalUser From User]);
        
        Test.stopTest();  
    }    
    
    private static testMethod void test02() {      
        
        Test.startTest();
        
        System.debug('Total Account Record = ' + [Select Count(Id) totalAccount From Account]);
        
        Test.stopTest();  
    }
}


Thanks
Regards,
LinThaw
Hi guys,

I have custom formula fields on the OpportunityLineItemSchedule object which display a month based on the month the scheduled date falls within. 

I have created 12 custom fields on the OppLine object, each labeled one of the months of the year. I need a way of rolling up the Quantity of the the related schedules to the corresponding custom fields on the OppLine. 

Has anyone created anything similar in the past?

In the below code, in the second line, I get an error System.NullPointerException: Attempt to de-reference a null object
Please help.

for (Application_Review__c ar : Trigger.new) {
            if (String.isNotBlank(arts.get(ar.Application_Review_Type__c).iPad_Configuration__c)) {
                reviewIds.add(ar.Id);
            }
        }
Hi all, I have a problem that regards predefined fields in Event creation Action.

Currently, the action that creates the event (in this case named 'Stipula Atto/Contratto') has 2 predefined fields. One is the 'Nome' or Name field, which is the preset WhoId field, and the other is custom field called 'Venditore'. These can be see in the image below:
Image of Predefined Fields
Both of the fields hold references to a Contact. The problem is, we want the value currently being predefined in the 'Venditore' fields to be concatinated to the 'Nome' field. 

We've already attempted concatinating both formulas into the 'Nome' field, however the following error arrises when this is done: 

Error: The data type of the formula result (Text) is not compatible with the expected data type (Search (Lead, Referent)).

This is shown in the image below:

Error for concatination

I understand that the error explains that concatination parses the reference into text, so I would like to know how to concatine 2 contact reference into 1 field, while keeping both references as actual contact references.

I'm assuming it is possible to add multiple contacts into the WhoId field because it is already possible to add multiple contacts into the field manually when creating the activity. Can anyone point me into the right direction about how to solve this problem? Thank you very much.
 
I'm using a PB Flow and a Visual Flow to achieve the following. When a new Shipment (custom object) record is created, it contains Shipping Address details. If the address is X, and a Building Record (custom object) already exists also with a value X, then use the Visual Flow to relate those records. However, if X does not exist as a Building record, then create a new Building record, mapping over details from the Shipment, and then update the Shipment record to establish a relationship. 

The flow below is not recognizing Buildings in the database and is instead creating new Buildings each time it runs. Can someone please advise on how to solve this puzzle?

User-added image

These are my loop variables:

User-added image

And these are the Decision Conditions I'm using to determine if there is a match between a Building in the Collection and the Variables passed through from the Shipment record (of couse this is not working). 
User-added image
 
As seen in debug logs , why is the string json on deserializing returning null ? 
 
{
    "caPerformanceRecordList": [
        {
            "motorDealerID": "XL1HX",
            "dealerName": "Subaru Auto Dealer",
            "reportingPeriod": "2019-05-01",
            "financeSourceIntegrationTypeCode": "FIFS",
            "idlPlus": "Y",
            "creditApplicationSourceCode": "ECKNWNSPT",
            "submissionCount": 2
        },
        {
            "motorDealerID": "XL1HX",
            "dealerName": "Subaru Auto Dealer",
            "reportingPeriod": "2019-05-02",
            "financeSourceIntegrationTypeCode": "FIFS",
            "idlPlus": "Y",
            "creditApplicationSourceCode": "RTEONE",
            "submissionCount": 15
        }
    ]
}


public with sharing class CASReportController {

		public list<JSONWrapperController> wrapper {get;set;}

		public void deserialize() {
		
		string jsonresponse = '{"caPerformanceRecordList":[{"motorDealerID":"XL1HX","dealerName":"Subaru Auto Dealer","reportingPeriod":"2019-05-01","financeSourceIntegrationTypeCode":"FIFS","idlPlus":"Y","creditApplicationSourceCode":"ECKNWNSPT","submissionCount":2 },{"motorDealerID":"XL1HX", "dealerName":"Subaru Auto Dealer", "reportingPeriod":"2019-05-02","financeSourceIntegrationTypeCode":"FIFS","idlPlus":"Y","creditApplicationSourceCode":"RTEONE","submissionCount": 15 },{"motorDealerID": "XL1HX", "dealerName":"Subaru Auto Dealer","reportingPeriod":"2019-05-02","financeSourceIntegrationTypeCode":"FIFS","idlPlus":"Y","creditApplicationSourceCode":"RTEONE","submissionCount":14}]}';
		  
		 system.debug('json string is ' +jsonresponse);
		 wrapper = (list<JSONWrapperController>) JSON.deserialize(jsonresponse, lis<JSONWrapperController>.class);
        
        system.debug('This is the wrapper class: ' +wrapper);
	}
}



public class JSONWrapperController {
	
	    public class CaPerformanceRecordList {   
	    	
		public string dealerName {get; set;}
	        public String motorDealerId {get;set;}
	        public DateTime mtd {get; set;}
	        public Integer submissionCount{get;set;}
		public String idlPlus{get;set;}
		public String creditApplicationSourceCode{get;set;}
		    
    	}
	
	 public List<CaPerformanceRecordList> caperfreclist {get;set;} 
   
}


DEBUG|This is the wrapper class: JSONWrapperController:[caperfreclist=null]

 
I am having a list of Occupations, Driver, Mechanic, Plumber, Carpenter, Chef.
I have contact records with above occupations. One contact can have multiple occupations too.
So I have a trigger which creates Opportunities with these contacts when another field is updated.
Currently i am creating only one opportunity for each contact, now I am trying to create one opportunity for each contact based on occupation. For instance,

contact 1 - name:contact1,occupation:chef,carpenter
contact 2-name:contact2,occupation:Chef,driver
contact 3 -name:contact3,occupation:driver,mechanic,Plumber

My occupation list contains :  Chef,Driver,mechanic

So it should create 5 opportunities( now it creates only 3 opportunities using 3 contacts) like
1.Name-opp1,contact(lookup)-contact1,Contact occ-chef
2.Name-Opp2,contact(lookup)-contact2,contact occu-Chef
3.Name-Opp3,contact(lookup)-contact2,contact occu-driver
4.Name-Opp4,contact(lookup)-contact3,contact occu-Driver
5.Name-Opp5,contact(lookup)-contact3,contact occu-mechanic
I have to iterate over the list of occupations,and create opportunity records.How can i get this change.Thanks all.
I am trying to update a date/time field (Actual_Closed_Date__c) with the current date when an opportunity was closed (Stage__c = Closed Won || Stage__c = Closed Lost) using a trigger, any suggestions?