• Neil Jamison
  • NEWBIE
  • 55 Points
  • Member since 2015

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

Hello Salesforce developer community! I'm working on my second lightning component and I feel like I'm 95% there but stuck on one thing. Apologies if the answer to this is already posted somewhere or it is in the developer documentation. I'm not sure how to search to ask the right question. 

Scenario: I'm creating a component that will be used in a flow (implements="lightning:availableForFlowScreens"). Part of the component is a Rich Text field and I want to be able to make that rich text field required. 

<div>
     <lightning:inputRichText value="{!v.myVal}" placeholder="Enter text with formatting" messageWhenBadInput="{!v.errorMessage}" valid="{!v.validity}"/>
</div>
This much works but I want to be able to make my field required. In fact as a test, I have temporarily added a button that checks that the field has something in it:
<lightning:button name="validate" label="Validate" onclick="{!c.validate}"/>
validate: function(cmp,event,helper) {
        if(!cmp.get("v.myVal")){
            cmp.set("v.validity", false);
        }
        else{
            cmp.set("v.validity", true);
        }
    }

However, I don't want the button. I want to check that the field is not empty when the user clicks the Next button on the flow screen. 

I know I can do both of the following solutions but I would prefer a more elegant solution:

1. I could write code with a replacement set of navigation buttons. This would allow me to override the functionality of the Next button. I want to use the standard navigation if possible so I'm hoping this is not required.

2. I could pass the result of the lightning:inputRichText to the flow and make the flow do the validation and pass the user back to the same screen with an error message. However I want my component to be self-contained so this is not the ideal solution because it requires work to be done in the flow each time the component is used.

Is there any way to get flow to recognize that a component on the screen is in an invalid state using standard navigation? In other words, I want the lightning:inputRichText to work like any other required field would work where when you click next, it throws an error if the field is not filled in.
 

I have created a workflow in process builder to map a picklist field from a custom object into a contact object. I can successfully map other picklist fields but this one gives the above error. The only thing I can think of is it might be too long, the picklist is UK counties. I'm using a global picklist so I know that both picklists are identical. The error message is below. Grateful for any ideas. I have 3 other picklist fields that failed too, one a multi-picklist, but I'll tackle those later.

RECORD CREATE: myRule_1_A1
Create one Contact record where:
Birthdate = {!myVariable_current.Date_of_Birth__c} (06 July 1996)
Charity_Referrers__c = {!myVariable_current.Charity_referrers__c} (null)
College_Referrers__c = {!myVariable_current.College_Referrers__c} (null)
County_of_origin__c = {!myVariable_current.County_of_origin__c} (Berkshire)
FirstName = {!myVariable_current.First_Name__c} (Test)
Gender__c = {!myVariable_current.Gender__c} (Female)
LastName = {!myVariable_current.Last_Name__c} (Dodd)
Local_Authority_Referrers__c = {!myVariable_current.Local_Authority_referrers__c} (null)
MobilePhone = {!myVariable_current.Mobile_Phone__c} (06610230804)
Next_of_Kin_First_name__c = {!myVariable_current.Next_of_Kin_First_Name__c} (null)
Next_of_kin_Last_name__c = {!myVariable_current.Next_of_Kin_Last_Name__c} (null)
Previous_accommodation__c = {!myVariable_current.Previous_accommodation__c} (null)
RecordTypeId = 01258000000U464
Referral_Agency__c = {!myVariable_current.Referral_Agency__c} (null)
Social_Services_Referrers__c = {!myVariable_current.Social_Services_Referrers__c} (null)
Town_of_origin__c = {!myVariable_current.Town_of_origin__c} (Slough)
npe01__HomeEmail__c = {!myVariable_current.Email_address__c} (dodd@gmail.com)
Result
Failed to create record.

Error Occurred: INSERT --- INSERT FAILED --- ERRORS : (INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST) bad value for restricted picklist field: Berkshire, 
I'm on the last step of the Lightning App Builder trail on the intermediate Admin Trail.  I've download the custom components from the app exchange and confirmed that they are listed in my dev org.  However, when I go to my Lightning app I built, there are no custom components available.  What am I missing?  Thank you for your help.
|org wide email for sender not supported without a provided email

I have a flow (originating on Case Button Click) firing an email alert (sent from an org wide email) that is causing above error.

any clues?

Hi,

 

I'm using the following package.xml snippet to retrieve email template from an organisation. The execution of "retrieveUnpackaged" command was successful and retrieved  retrieveUnpackaged\email\unfiled$public\Test_Notification.email and retrieveUnpackaged\email\unfiled$public\Test_Notification.email-meta.xml files. I then ran "deployUnpackaged" to deploy the downloaded email template and received this error:

 

Error: package.xml(unfiled$public):An object 'unfiled$public' of type EmailTemplate was named in package.xml, but was not found in zipped directory

 

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>unfiled$public</members>
<members>unfiled$public/Test_Notification</members>
<name>EmailTemplate</name>
</types>
<version>23.0</version>
</Package>

 

Any suggestions would be appreciated.

 

Thanks!

Using the formula editor, how do i round up (or down) a number to x decimal places. eg:- I would like 1.239 rounded up to 2 decimal places to get the result 1.24. thanks!