• Admin User 10161
  • NEWBIE
  • 50 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 4
    Replies
Hi there,
In the following Apex code. I have created a string "query" in which I selected all the fields of a custom object.
for(String fieldName : fieldMap.keyset() )
        {
         if(strFields == null || strFields == '')
         {
           strFields = fieldName;
          }else{
           strFields = strFields + ' , ' + fieldName;
          }
         }

		query = 'SELECT ' + strFields + ' FROM ' + SobjectApiName + ' WHERE Id IN: buyIds';
        
        for(APTIVN__NBuyer__c buy: Database.query(query)) {
            SelectedBuyerIDs.add(buy);
        }
The problem is that for some fields for one particular row the value of this field is null. Is it possible to replace NULL value in an empty string on a SOQL query?
Best regards,
Hi there,
I have created a custom object called 'Aptiv Buyer'. In this custom object I have create a list button called "Convert Buyers to Leads". I have linked this button to a Visualforce page named "PassSelectedIdsToFlowVF":
<apex:page standardController="APTIVN__NBuyer__c" recordSetVar="Buy" extensions="PassSelectedIdsToFlowVFController" lightningStylesheets="true">
    
    <flow:interview name="Convert_Buyer_List">
        <!-- Buyers is flow input variable & SelectedBuyerIDs is a property in the Apex controller -->
        <apex:param name="Buyers" value="{!SelectedBuyers}" />
    </flow:interview>
    
</apex:page>
This VF page is linked to the following Apex class:
public class PassSelectedIdsToFlowVFController {
    
    public APTIVN__NBuyer__c[] SelectedBuyers{get;set;}
    
    public PassSelectedIdsToFlowVFController(ApexPages.StandardSetController listcontroller){
        SelectedBuyers = new APTIVN__NBuyer__c[]{};
        for(APTIVN__NBuyer__c buy : (APTIVN__NBuyer__c[])listcontroller.getSelected()){
            SelectedBuyers.add(buy);
        }
    }
}
I have created the flow "Convert Buyer List" in which I created a Record Collection variable "Buyers". This is the parameter from the visualforce page that I want to linked to the flow.
However, when I run the flow and try to get a field from the record via a lookup I have this error message:
The flow failed to access the value for Loop_List_Buyers.APTIVN__FirstName__c because it hasn't been set or assigned.
and when I check the content of the variable I have:
Buyers = [APTIVN__NBuyer__c (a0Z2g000000RCHpEAO),APTIVN__NBuyer__c (a0Z2g000000RCNgEAO),APTIVN__NBuyer__c (a0Z2g000000RCDiEAO),APTIVN__NBuyer__c (a0Z2g000000RCKjEAO),APTIVN__NBuyer__c (a0Z2g000000RCA6EAO),APTIVN__NBuyer__c (a0Z2g000000RCHHEA4),APTIVN__NBuyer__c (a0Z2g000000RCTJEA4),APTIVN__NBuyer__c (a0Z2g000000RCEWEA4),APTIVN__NBuyer__c (a0Z2g000000RCVtEAO),APTIVN__NBuyer__c (a0Z2g000000RBkwEAG),APTIVN__NBuyer__c (a0Z2g000000RBnzEAG),APTIVN__NBuyer__c (a0Z2g000000RBf4EAG)]
Do you know how to fix the issue?
Regards,
Hi there,
When I try to convert String to Datetime in Apex via the following code:
Integer randomNumber = Integer.valueOf((Math.random() * 29))+1;
Datetime dt = Datetime.parse('6/'+randomNumber+'/2020');
I have this error message: System.TypeException: Invalid date/time: 6/20/2020
Do you know how to fix that?
Best regards,
Hi there,
I would like to send an email with link and images using HTML code and linebreaks but don't see any option for that on text variable on Flow. Anyone knows how to do that?
Hi there,
I have created an Aura Lightning Component which is button that opens an hyperlink.
I want to get the URL from current record of "Lead" via a custom field in called "URL__c". I have tried to use "force:hasRecordId" but I am not able to get the value.
Here is my implementation of my lightning component:
<aura:component implements="lightning:availableForFlowScreens" access="global">
	<center><ui:button label="Open Opportunity" press="{!c.openActionWindow}"/></center>
</aura:component>
({
	openActionWindow : function(component, event, helper) {
        window.open("{!v.URL__c}");
	}
})

Hi there!
I would like to know if it is possible to change the title of a custom object. Because when I open a record on one of my custom object I have something like that: "a0X2g000000HTa0 | Salesforce". The field that is used to display the custom object is "Preview URL Name" which is the standard default field and the primary key when you create a custom object.
I would like to change the title of the record using one of my custom field called "Title" but don't see any option on page layout and on Lightning Record.
Does anyone knows how to do that?
Best regards,

Hi everyone,
I would like to know if it is possible for an object like "Lead", "Opportunity" or "Account" to get the value of the fields from the current record on Flow Builder.
For example when I enter to a Lead with the field "Name" equals to "John Doe" I would like to display on the screen "John Doe".
Is it possible to do that on the filters of "Get Records"? Instead of having a filter like "Name = ..." I would like to have a filter "Get Current Name".
Hi there,
In the following Apex code. I have created a string "query" in which I selected all the fields of a custom object.
for(String fieldName : fieldMap.keyset() )
        {
         if(strFields == null || strFields == '')
         {
           strFields = fieldName;
          }else{
           strFields = strFields + ' , ' + fieldName;
          }
         }

		query = 'SELECT ' + strFields + ' FROM ' + SobjectApiName + ' WHERE Id IN: buyIds';
        
        for(APTIVN__NBuyer__c buy: Database.query(query)) {
            SelectedBuyerIDs.add(buy);
        }
The problem is that for some fields for one particular row the value of this field is null. Is it possible to replace NULL value in an empty string on a SOQL query?
Best regards,
Hi there,
I have created a custom object called 'Aptiv Buyer'. In this custom object I have create a list button called "Convert Buyers to Leads". I have linked this button to a Visualforce page named "PassSelectedIdsToFlowVF":
<apex:page standardController="APTIVN__NBuyer__c" recordSetVar="Buy" extensions="PassSelectedIdsToFlowVFController" lightningStylesheets="true">
    
    <flow:interview name="Convert_Buyer_List">
        <!-- Buyers is flow input variable & SelectedBuyerIDs is a property in the Apex controller -->
        <apex:param name="Buyers" value="{!SelectedBuyers}" />
    </flow:interview>
    
</apex:page>
This VF page is linked to the following Apex class:
public class PassSelectedIdsToFlowVFController {
    
    public APTIVN__NBuyer__c[] SelectedBuyers{get;set;}
    
    public PassSelectedIdsToFlowVFController(ApexPages.StandardSetController listcontroller){
        SelectedBuyers = new APTIVN__NBuyer__c[]{};
        for(APTIVN__NBuyer__c buy : (APTIVN__NBuyer__c[])listcontroller.getSelected()){
            SelectedBuyers.add(buy);
        }
    }
}
I have created the flow "Convert Buyer List" in which I created a Record Collection variable "Buyers". This is the parameter from the visualforce page that I want to linked to the flow.
However, when I run the flow and try to get a field from the record via a lookup I have this error message:
The flow failed to access the value for Loop_List_Buyers.APTIVN__FirstName__c because it hasn't been set or assigned.
and when I check the content of the variable I have:
Buyers = [APTIVN__NBuyer__c (a0Z2g000000RCHpEAO),APTIVN__NBuyer__c (a0Z2g000000RCNgEAO),APTIVN__NBuyer__c (a0Z2g000000RCDiEAO),APTIVN__NBuyer__c (a0Z2g000000RCKjEAO),APTIVN__NBuyer__c (a0Z2g000000RCA6EAO),APTIVN__NBuyer__c (a0Z2g000000RCHHEA4),APTIVN__NBuyer__c (a0Z2g000000RCTJEA4),APTIVN__NBuyer__c (a0Z2g000000RCEWEA4),APTIVN__NBuyer__c (a0Z2g000000RCVtEAO),APTIVN__NBuyer__c (a0Z2g000000RBkwEAG),APTIVN__NBuyer__c (a0Z2g000000RBnzEAG),APTIVN__NBuyer__c (a0Z2g000000RBf4EAG)]
Do you know how to fix the issue?
Regards,
Hi everyone,
I would like to know if it is possible for an object like "Lead", "Opportunity" or "Account" to get the value of the fields from the current record on Flow Builder.
For example when I enter to a Lead with the field "Name" equals to "John Doe" I would like to display on the screen "John Doe".
Is it possible to do that on the filters of "Get Records"? Instead of having a filter like "Name = ..." I would like to have a filter "Get Current Name".