+ Start a Discussion
d3developerd3developer 

Okay folks, I know this is a n00b question but I can't remember if or how to initialize a string with a set of arguments.

 

What I want to do is something like this

 

 

List<String> alphabet = { 'a' , 'b' , 'c' ...  };

 

How can I do this?

 

Best Answer chosen by Admin (Salesforce Developers) 
Jeremy.NottinghJeremy.Nottingh

 

List<String> alphabet = new list<String> { 'a' , 'b' , 'c' ...  };

 That should do ya.

 

jhartfieldjhartfield 

I randomly was trying a split today on a '*' field and got the following error:

 

System.StringException: Invalid regex: Dangling meta character '*' near index 0 * ^

 

Out of curiosity, I tried to split on '+' and got the same error.  

 

This is easily reproducible for me by running the following code in the execute anonymous window - can anyone else  confirm?

string sString = 'someStuff'; string[] splitted = sString.split('*');

 

 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

The following allows the text to be split on the '*' character:

 

string sString = 'some*Stuff'; string[] splitted = sString.split('\\*'); system.debug('Splitted = ' + splitted);

 


Itzik Winograd 7Itzik Winograd 7 
Hi
I need to perform an action on a LWC component when the flow navigates to Next/Finish. Since this component is part of a screen, I cant add my own navigation buttons on this component.
So, Is there any way to listen to the flow's native Navigation events?
Or, the only solution is to override the footer and add my own navigation buttons and use c-pubsub to perform an action on the mentioned component?
Thanks in advanced!
 
Best Answer chosen by Itzik Winograd 7
AnudeepAnudeep (Salesforce Developers) 
Hi Itzik, 

You should be able to use the Validate hook to accomplish this (discussed here and here). If you add it to your LWC, you'll get called each time something attempts to transition out of the flow screen. Most components that use this use it to carry out validation and potentially block the transition, but you could use it as a simple notification. I hope this helps

Anudeep
farouk fakunlefarouk fakunle 
Has anyone completed this trail? I am stomped on challenge number 3, regarding created the process for fulfillment. Any pointers or guidance would be appreciated.
 
Best Answer chosen by farouk fakunle
farouk fakunlefarouk fakunle
@Ajay thanks for your input,  Here is my data model below.  Thanks to @Trupti @Fons @ Jennifer @Surlya @ Nikhil for the valuable input and assistance on STEP 4




I am referencing the Adventure Pakage Object to Start my process so it it is:

Object - Adventure Package
Start Process- Only when a record is created 

FIRST NODE 

Define Criteria for this Action Group 

Criteria for Executing Actions - Conditions are met 

Set Conditions:

1. [OpportunityLineItem].Oppotunity.StageName Does not equal Cancelled 
2. [OpportunityLineitem].Fulfillment_Created_c Equals False

Conditions - All of the conditions are met (AND) 

IMMEDIATE ACTIONS 

1. Create a Record 

Record Type - Fulfillment 

Set Field Values 

AdventurePackageId -  Reference -[OpportunityLineItem].Id
Adventure Package cost - Reference - [OpportunityLineItem].TotalPrice 
Adventure - Reference -  [OpportunityLineItem].Product2Id
Expedition Leader - Reference -[OpportunityLineItem].Product2.Expedition_Leader_c
Explorer - Reference - [OpportunityLineItem].Explorer_C
Fulfillment Name - Formula -[OpportunityLineItem].Product2.Name + [OpportunityLineItem].Id
Schedule Date -Reference - [OpportunityLineItem].ServiceDate
Status- Picklist - New 
Package -  [OpportunityLineItem].OpportunityId

2. Update Records

Record - [OpportunityLineItem].Opportunity ID 

No criteria just update records 

Set new fields for the records you update 

Needs Insurance - Reference- [OpportunityLineItem].Product2.Needs_Insurance_c
Needs waiver - Reference -  [OpportunityLineItem].Product2.Needs_Waiver_c

3. Update Records 

Record - [OpportunityLineItem]

Criteria for Updating Records - No criteria-just update records 

Set new field values for the records you update 

Fulfilment Created = True 
Needs Insurance - Reference- [OpportunityLineItem].Product2.Needs_Insurance_c
Needs waiver - Reference -  [OpportunityLineItem].Product2.Needs_Waiver_c


Evaluate the Next Criteria 

 SECOND NODE 


EVALUATE THE NEXT CRITERIA 

Define Criteria for this Action Group 

Criteria for Executing Actions - Conditions are met 

Set Conditions:

1. [OpportunityLineItem].Explorer_c   Is Null  = True 

Conditions - All of the conditions are met (AND)

IMMEDIATE ACTIONS 

Create a Record - Task 

Set Field Values

Assigned to ID - reference- [OpportunityLineItem].Opportunity.OwnerId
Related to ID - reference -[OpportunityLineItem].Opportunity.Id
Priority - Normal 
Status - Not started 
Subject- String - Update explorer 

SCHEDULED ACTIONS 

14 days from now 

Post to Chatter 

User - Select a user from a record - [OpportunityLineItem].Opportunity.Owner.Id

Message:

{![OpportunityLineItem].Opportunity.Name}

{![OpportunityLineItem].Product2.Name}

{![OpportunityLineItem].Id}

Once done with these changes, execute blow lines of code in dev console.

Product2 product = new Product2(name='Half Dome Hike', isActive=true); 
insert product; 
//insert the pricebookentry 
Pricebook2 stdPrice = [Select id from Pricebook2 where isStandard=true limit 1]; 
PricebookEntry pbe = new PricebookEntry( IsActive = true, Product2Id = product.id, UnitPrice = 2.00, Pricebook2Id = stdPrice.Id); 
insert pbe;
MegachuckmcMegachuckmc 

I'm setting up the process-conf.xml file to set up a series of Upsert processes and can't find a Configuraton Parameter for Related Objects...

 

'sfdc.externalIdField' allows me to specify the External ID field used for data matching which in the GUI corresponds to

 

Step 2a: Choose your field to use for matching --> sfdc.externalIdField

 

Step 2b: Choose your related objects --> ???

 

 

I can't find any mention of this in any of the Data Loader documentation...

 

Any help is greatly appreciated!

 

Mike

 

 

 

 

 


Best Answer chosen by Admin (Salesforce Developers) 
GoForceGoGoForceGo

As long as your mapping file (.sdl) maps correctly to foreign keys it  works. You can create this file using the UI version of Data Loader using step 2b. you describe 

 

Let's say you are trying to upsert B records that have a lookup to object A.

 

So in the process-conf.xml would only reference B's sfdc.externalIdField.

 

<entry key="sfdc.externalIdField" value="B_ID__c"/> (equivalent of step 2a).

 

The mapping file would have something to effect: 

 

A_ID =A__r\:A_ID__c (UI step 2b will generate this reference)

 

Where A_ID is the column name in your .csv file, A_ID__c is the external ID for your object A.

Justin RuckJustin Ruck 
I have a custom object that has a lookup field to the Contact object.  I did the related lookup filter so that it would only pull in results for Contacts on that related Account.  The issue is that in Lightning Experience, when I click on this Contact lookup field, it shows my Recently Viewed contacts, whether they were for the related account or not.  I'd like to either somehow filter that Recently Viewed list or remove the Recently Viewed when the user clicks on the lookup field.

Any ideas on how to do that?  
Best Answer chosen by Justin Ruck
@Karanraj@Karanraj
Justin, Salesforce lightning experiences currently don't support any user defined lookup filters. Check this links for details about limitation - http://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/lex_gaps_limitations_search.htm
Puneet KhoslaPuneet Khosla 
I am getting this error when trying to do the "Lightning Experience Rollout Specialist"

The AccountTab Visualforce page does not include one or both of the following: the apex:slds tag in the page, or the slds-table value in the table.


My code is as follows:
 
<apex:page standardStylesheets="false" standardController="Account" recordSetVar="accounts" tabStyle="account" applyHtmlTag="false" applyBodyTag="false" showHeader="false">
   <head>
       <apex:slds />
    </head> 
	<body>
    <div class="slds-scope">     
        <table class="slds-table">
  			<thead>
    			<tr class="slds-text-title_caps">
      				<th scope="col">
        				<div class="slds-truncate" title="{!$ObjectType.Account.Fields.Name.Label}">{!$ObjectType.Account.Fields.Name.Label}</div>
      				</th>
    			</tr>
  			</thead>
  			<tbody>
    			<apex:repeat value="{!accounts}" var="a">
                <tr>
                  <td data-label="Account Name">
                    <div class="slds-truncate" ><apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink></div>
                  </td>
      
    			</tr>
                </apex:repeat>
            </tbody>
        </table>
     <!--   
     <div class="slds-scope">
        <apex:pageBlock >
            <apex:pageBlockTable value="{!accounts}" var="a" styleClass="slds">
                <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                    <apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>-->
    </div>
        </body>
</apex:page>

 
Best Answer chosen by Puneet Khosla
Puneet KhoslaPuneet Khosla
Looks like I figured out.

styleClass="slds-table" needs to be added to pageBlockTable
KevlangdoKevlangdo 
I am doing the following trailhead on big objects and I need to be able to upload zip file from Workbench into this playgound. However, when I login into sandbox, the url is test.salesforce.com. If I try to use my playground username it says that it doesn't exists. If I try to change the url to my playground, it generates and error. So How can I complete this trealhead.
https://trailhead.salesforce.com/modules/big_objects/units/big_objects_define_custom_big_objects
Best Answer chosen by Kevlangdo
Neetu_BansalNeetu_Bansal
Hello Kevin and Nathan,

Your playground org is not Sandbox, it should be developer org only, Try to use login.salesforce.com as the URL.

Thanks,
Neetu
Rebekah CastilloRebekah Castillo 

Hi,

I am trying to deploy a Change Set from my Sandbox to PROD Org however when I select to "Upload" the Change Set I receive the following error:
"This organization isn't authorized to upload change sets to other organizations. For authorization, contact the deployment connections administrators on the organizations where you want to upload changes.".

My profile is set up as a System Administrator for my Org.

Is anyone able to assist?

Thanks
 
Best Answer chosen by Rebekah Castillo
Nayana KNayana K
In Production :

From Setup, enter Deployment in the Quick Find box, then select Deployment Settings, and then click Continue.
Click Edit next to the org you want to authorize(sandbox).
Select Allow Inbound Changes.
Click Save.

 
Nick KeehanNick Keehan 
Hi Experts

We have serveral partners each with thier own login URL, which we would like to bring into a single shared login screen.

e.g.
myinstance.force.com/partner1/login
​myinstance.force.com/partner2/login

Is there a way to have one single login screen and it login to the correct partner depending on thier username/profile?

e.g.
myinstance.force.com/login

Any help would be apreciated.

Nick
Best Answer chosen by Nick Keehan
Jayant DasJayant Das
Hi Nick,

Because the login pages are specific to the community, thus a possible approach could be to have a "common" community created for all partners with the same login page. You would then need to customize the login process to capture the access details and internally redirect it to the appropriate community based on what was captured in the first step.

You may like to refer to these links on login customization for pointers:
https://help.salesforce.com/articleView?id=networks_customize_login_page.htm&type=5
https://help.salesforce.com/articleView?id=networks_custom_login_apex_controller.htm&type=5


Not sure, but this may be a route.

Thanks,
Jayant