When Salesforce is life!

Month: April 2017

[Salesforce / Lightning] Simple Custom Modal Alert

Hello everybody!

This is an “easy peasy” post that comes from a recent two-weeks full immersion on Lightning Components task I got into at work: there will be more content from this activity and a Cagliari DG presentation as well.

For all the TL;DR guys (and again, I’m one of you!), here is the Github Repository.

The Alert Modal shows an alert modal through a custom event fired from your Lightning components:

var evt = $A.get("e.c:AlertEvt");
        evt.setParams({
            "show": true,                     //shos alert
            "mode": 'prompt',                 //alert mode: prompt, alert, toast
            "fixed": false,                   //fixed does not shows any "close" button
            "type": 'info',                   //type of alert: info, success, warning, error
            "message": 'Title Message',       //main title
            "details": 'Message Details. . .' //details message
        });
        evt.fire();

The event is caught up by the AlertCmp Lightning component that shows the request alert:

Besides the prompt mode, you can use the alert mode:

And a toast mode:

You can test the component in the provided Lightning app:

[Salesforce] ORGanizer Chrome Extension 0.6 is Live!

h1.chapter-title{
font-size:20pt;
}
div.post-content a{
color: blue;
font-weight: bold;
}

Another release is on its way!

You should receive the update in the next hours.

Which amazing features have been packed?

And other important enhancements:

  • Show line and column number on Quick Query, Execute Anonymous and Enhanced Formula editors:

  • Drag the Quick Console from the footer:

  • Resize editor’s textarea in Quick Query, Execute anonymous and Enhanced Formula Editor plugins:

  • Make lookup field clickable on query results (not only ID field):

  • Download child query result in JSON / CSV format (previously you could only download the main query results)
  • Child queries result now shows correctly all results (previously was limited to 10)

THE SWAG STORE

Do you know ORGanizer is free for all, right?

You can help me keeping it free forever by offering me a pizza or a cappuccino or … drumroll… buying stuff from the brand new ORGanizer Swag Store!

The store is hosted by Zazzle.com: they customize, pack and send the products right to your home/office giving the ORGanizer a small percent maring of the price.

This way you are happy to receive awesome swag and I’m happy as well because I can keep the #BestExtensionEvenr free for all!

Jump to the ORGanizer site to browse all this awesome stuff!

CHANGE SET HELPER

The Change Set Helper plugin has been developed to help daily work with Salesforce outbound Change Sets.

Due to limitations on Salesforce Change Set APIs, the plugin is meant to help you in the tedious work of searching for components, remove components from change set, creating recurring change sets to be included in every change set you make.

The plugin comes with limitations.

The plugin is in early beta, please report malfunctioning features or improvements from the support page.

What can you do with the Change Set Helper?

Open an outbound change set and you’ll se with your eyes!

Click the Download compoments to retrieve a zip file containing the components from the package.

WARNING: This features works if there is only one outbound component with the same name.

Because of dealing with big change set could be frustrating, the plugin is meant to create a template or every change set you work with.

A template is just a reusable change set model you can import in another change set, browse, refine removing certain components, use to remove components from the current change set.

To create a template click on the Create Template button: this operation can take a while especially if the change set has hundreds of components.

Once you hit the button, you’ll see the script automatically pressing the Next link on the change set components table, lurking all the components definitions.

Once the template is completed, you are required to set a name for the template and click the Save Template button.

The Metadata Templates picklist shows the list of all save templates:

The template can be added into a new change set (see next paragraph). Because it is not easy to understand if a component can be added, you can click the Compare Template button: this way the script iterates through all current change set components looking for matching components between the selected template and current change set.

If a subset of the selected template if found inside current change set, you are required to create a new “subset” template with all the components that have not been found, to safely import the template into your change set.

The plugin has been tested with various metadata types, but there can be unsupported components (it depends on how Salesforce shows components on the components table) that I haven’t still checked.

Please report any unwanted behavior.

At the moment of writing, only Person Account record types are not supported: this means that these record types cannot be added through a template and so must be added manually.

By pressing the Remove Template button you can remove a selected template from the list.

The Extract Template CSV donwloads current template in CSV format (this CSV file can be usefull to trigger bugs if you report an error).

Once you select a template, a new table is shown:

You can filter components and save changes made to the template by the Remove from Template link.

If you want help to remove a specific component from current change set click the Remove from Change Set link next to each component’s name: this can save you A LOT OF TIME!

The helper iterates through the chage set components table (clicking the Next button) and if a match is found, clicks the standard Remove link, that triggers for the standard confirmation popup:

[https://organizer.enree.co/img/faq/faq_changeset6.png]

If no match if found, an informative message is displayed:

The plugin works with Packages as well but be aware that packages often includes in their components list also components that cannot be added to a change set (e.g. components that come from managed packages), so it may happen that templates created with a package is not importable on a change set (and vice versa).

The Change Set Helper plugin is hosted on the Add component page as well:

The only difference is the absence of the Create Template, Compare Template and Remove Template buttons.

The Add Template button insert current template into the plugin.

If all the components can be inserted, the script adds the components and goes back to the main change set page.

If un-importable components are found (e.g. Person Account record types, untested components in the beta development), the download of a CSV containing the remaining components is automatically triggered: this way you know what to import manually by yourself.

If this happens, you need to press the Add to Change Set button manually (you don’t see the list of the components you are about to insert).

The plugin adds 3 usefull features:

  • Quick search components: quickly filters the list of selected components type
  • Expand component list link to expand the list by 1000 components (the maximum allowed)
  • The Add to Change Set and Add Again button that simply does the Add action and returns back to current page (and not to the Change Set page)

Remember: this is not a change set manager because the absence of any API that can help this important Salesforce feature, but it is an helper that helps you automate change set management tasks.

Please report back any malfunctioning feature or any smart way to enhance this useful plugin.

To enable/disable this plugin run to the Features section of the plugin’s Options page.

QUICK CONSOLE GAMES

While you are waiting for long running operations (such as deleting a Change Set component among thousands of components using the Change Set Helper plugin), you can relax playing 2 ( more to come in the next releases) simple yet awesome games:

Quicklogin

The Quick Login plugin allow you to login directly from the standard Salesforce login page.

The plugin is automatically attached to the username input text and shows the corresponding ORGanizer accounts matching the input string:

To enable/disable this plugin run to the Features section of the plugin’s Options page.

TIMED PASSWORD SESSION

This plugin is configurable from the Encryption section of the Options page.

If encryption is enabled you can set up Timed Password Sessions.

Set up a maximum password session duration. During this time frame you are never requested for the encryption password when:

  • Copying login link in memory from the popup accounts page
  • Copying password + token from the popup accounts page
  • Showing password on the popup account editing page

This enhances security because if you leave your laptop unattended, after the session is expired none can login on any account anymore, but requires to insert the password to enable the extension.

Once the session is expired the Quicklogin and @login command with Quicklink do not work as well.

GET PASSWORD + TOKEN ON THE FLY

From the ORGanizer’s popup a new button is in place to get you the password and token of an account to use it for other porpouses (e.g. IDE, API, external services, …).

If you haven’t set up Timed Password Sessions and have Encryption enabled, the button asks you for the main encryption password.

SHOW PASSWORD IN EDITOR PAGE

Now you can see the password in clear while editing an ORGanizer account:

INCREASED LICENSE LIMITS

More accounts can be handled:

Total accounts has been increased from 80 to 150, and sync accounts from 60 to 100.

[CSS / Trick] Readonly Input Text

Message for the future me: this is a small CSS trick to make an input text like an output label using CSS:

.inputDisabled{
   pointer-events: none;
   cursor: default;
   background-color: white;
   border: none;
   font: inherit;
}

This is an example:

Powered by WordPress & Theme by Anders Norén