Category: Salesforce

Editing Salesforce Objects in Custom Lightning Components With NO JAVASCRIPT

When it comes to writing custom user-interface code in Salesforce, Lightning is where it’s at. You could write it in Visualforce, but sooner or later you’ll have to convert it to Lightning. Lightning provides a far richer experience. It allows you to view related data more easily, and see that data change in real-time.

One headache for developers has been that doing something like writing a component to update values on a Contact would require page markup, Javascript, and Apex. And Salesforce itself did not check whether the current user had the correct permissions to be viewing/editing this data. Security was an extra requirement that could easily be forgotten.

In Visualforce, the same requirements could all be achieved with a small amount of markup, leveraging built-in Visualforce tags.

Well, as of Spring ’18, Lightning can now achieve the same thing. The combination of two new components, lightning:recordEditForm and lightning:inputField handle all the complexity for us, and we can get on with only writing custom code where it really adds value to the business!

Editing a Contact in Lightning is now as simple as:

<lightning:recordEditForm recordId=”0030Y0000080eMuQAI” objectApiName=”Contact”>
<div class=”slds-box slds-theme_default”>
<lightning:messages />
<lightning:inputField fieldName=”Name” />
<lightning:inputField fieldName=”Phone”/>
<lightning:inputField fieldName=”Email” />
 <lightning:button class=”slds-m-top_small” variant=”brand” type=”submit” name=”update” label=”Update” />
</div>
</lightning:recordEditForm>

Build Secure and Interactive Forms Faster…No custom JavaScript and no Apex needed!

Salesforce Spring ’18 and GDPR

As the deadline for GDPR moves ever closer, we’re now starting to see opt-in’s appearing on web forms, and marketers are working harder than ever to ensure all aspects of data compliance are met.

But how do we ensure we’ve recorded the compliance data within Salesforce correctly?

Although subject to change, Spring ’18 will allow you to set up a new “Individual” record, linked to a Contact or a Lead, that allows you to record and encrypt specific information relating to their data preferences.

For instance, you can track preferences for:

  • Collecting, storing, and sharing their personal data
  • Packaging their personal data so they can take ownership of it
  • Deleting records and personal data related to them
  • Solicitation of products and services
  • Tracking their geolocation and web activity

 

Data privacy records, based on the Individual object, let you store certain data privacy preferences for your customers. These records can help you honour and respect your customers’ wishes when they request only specific forms of contact from your company.

Salesforce’s Time field (Beta) – Why and when to use it

The new Time field which can be found in the sandbox at the moment enables you to easily add a time to a record. This can be as a manually entered field or as a formula field. People have been finding uses for this in various firms including event control, project management, within cases and for recording appointment dates which can be easily provided to customers.

It is great to see such a long-standing request taking shape in the Salesforce environment but at present it does have a few limitations. These limitations include only being in GMT, not currently being able to be converted to text or number, and not being available in the process builder. However, these limitations can be seen as a good thing at this stage of the beta as it ensures that the base functionality works correctly.

As far as when to use the new field, the rule is to keep it simple at this stage. Personally I have found it very useful for showing client appointment times. This was previously controlled via a complex formula pulling from a time and date field which lead to difficulties for appointments which had more open timeframes such as AM or PM. With the current limitations and possibility that this functionality will not become a production feature it is not worth spending multiple hours configuring, however it is something that you should be aware of as it could easily become a stable of  the Salesforce environment. It is a field type which could be very powerful, especially when you consider that fomula functions such as TIMENOW have been enabled already.

I look forward to this being rolled out to production so that the functionality can be fully utilised for customers. If you have any questions about this though then the Success Community is definitely a good place to look.

 

There are 2 types of Time fields in Winter ’18 beta:

– as a custom field with Data Type = Time, or

– as a Formula field that returns type = Time