Help Text On Fields of Custom Lightning Component












2















I have a lightning component in which i want to display help text for the fields. I can use for sure. But is there any way to get the help text from backend. I mean when we create the field in the org we provide some help text. Can that help text be called in the custom component?










share|improve this question























  • You can use the field describe calls to get the help text for fields. However there's no out of the box way in which the help text can be shown directly in the components. You will have to use a custom wrapper to wrap the help text along with other field information.

    – Saket Joshi
    19 hours ago
















2















I have a lightning component in which i want to display help text for the fields. I can use for sure. But is there any way to get the help text from backend. I mean when we create the field in the org we provide some help text. Can that help text be called in the custom component?










share|improve this question























  • You can use the field describe calls to get the help text for fields. However there's no out of the box way in which the help text can be shown directly in the components. You will have to use a custom wrapper to wrap the help text along with other field information.

    – Saket Joshi
    19 hours ago














2












2








2








I have a lightning component in which i want to display help text for the fields. I can use for sure. But is there any way to get the help text from backend. I mean when we create the field in the org we provide some help text. Can that help text be called in the custom component?










share|improve this question














I have a lightning component in which i want to display help text for the fields. I can use for sure. But is there any way to get the help text from backend. I mean when we create the field in the org we provide some help text. Can that help text be called in the custom component?







lightning-aura-components lightning-experience salesforcedx lightning-design-system






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 19 hours ago









Smruti Ranjan BiswalSmruti Ranjan Biswal

132




132













  • You can use the field describe calls to get the help text for fields. However there's no out of the box way in which the help text can be shown directly in the components. You will have to use a custom wrapper to wrap the help text along with other field information.

    – Saket Joshi
    19 hours ago



















  • You can use the field describe calls to get the help text for fields. However there's no out of the box way in which the help text can be shown directly in the components. You will have to use a custom wrapper to wrap the help text along with other field information.

    – Saket Joshi
    19 hours ago

















You can use the field describe calls to get the help text for fields. However there's no out of the box way in which the help text can be shown directly in the components. You will have to use a custom wrapper to wrap the help text along with other field information.

– Saket Joshi
19 hours ago





You can use the field describe calls to get the help text for fields. However there's no out of the box way in which the help text can be shown directly in the components. You will have to use a custom wrapper to wrap the help text along with other field information.

– Saket Joshi
19 hours ago










1 Answer
1






active

oldest

votes


















2














Out of the box is not there, but there is a workaround.

You can hold the loading of help text until you get the help text response from server.



Lets say there are fields called Test_Field1__c and Test_Field2__c on Test_Object__c.



In Apex:



@AuraEnabled
public static Map<String, String> getHelpText() {
String helpText1 = Test_Object__c.Test_Field1__c.getDescribe().getInlineHelpText();
String helpText2 = Test_Object__c.Test_Field2__c.getDescribe().getInlineHelpText();
return Map<String, String> { 'Test_Field1__c'=>helpText1, 'Test_Field2__c'=>helpText2 };
}


And in lightning component



<aura:attribute name="helpText1" type="String" default="" />
<aura:attribute name="helpText2" type="String" default="" />
<aura:attribute name="initDone" type="Boolean" default="false" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:if isTrue="{!v.initDone}">
<lightning:helptext content="{!v.helpText1}" />
<!-- field 1 -->
<lightning:helptext content="{!v.helpText2}" />
<!-- field 2 -->
</aura:if>


In js controller



doInit: function(component) {
//call apex
var action = component.get('c.getHelpText');

action.setCallback(this, function(response){
var resp = response.getReturnValue();
component.set("v.helpText1", resp.Test_Field1__c);
component.set("v.helpText2", resp.Test_Field2__c);
component.set("v.initDone", true);
});
$A.enqueueAction(action);
}





share|improve this answer
























  • Hi @Aditya thanks for the reply. this is what i was looking for!

    – Smruti Ranjan Biswal
    17 hours ago











  • @SmrutiRanjanBiswal glad it helped, you can mark the answer accepted as well so other also can take the reference from here :-)

    – Aditya Vijay
    17 hours ago











  • yeah sure. Can u also help me with how to get the 'Guidance for Success of Sales Path to the Custom Component or to Apex'

    – Smruti Ranjan Biswal
    16 hours ago











  • @SmrutiRanjanBiswal that is a part of metadata developer.salesforce.com/docs/atlas.en-us.api_meta.meta/… you need to use Metadata API in order to get this to apex which is a bit complex to use. lightning:picklistPath is there to create the path in component, but it doesn't help with guidance of success or fields. Not sure if something else is there!

    – Aditya Vijay
    15 hours ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "459"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f253324%2fhelp-text-on-fields-of-custom-lightning-component%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Out of the box is not there, but there is a workaround.

You can hold the loading of help text until you get the help text response from server.



Lets say there are fields called Test_Field1__c and Test_Field2__c on Test_Object__c.



In Apex:



@AuraEnabled
public static Map<String, String> getHelpText() {
String helpText1 = Test_Object__c.Test_Field1__c.getDescribe().getInlineHelpText();
String helpText2 = Test_Object__c.Test_Field2__c.getDescribe().getInlineHelpText();
return Map<String, String> { 'Test_Field1__c'=>helpText1, 'Test_Field2__c'=>helpText2 };
}


And in lightning component



<aura:attribute name="helpText1" type="String" default="" />
<aura:attribute name="helpText2" type="String" default="" />
<aura:attribute name="initDone" type="Boolean" default="false" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:if isTrue="{!v.initDone}">
<lightning:helptext content="{!v.helpText1}" />
<!-- field 1 -->
<lightning:helptext content="{!v.helpText2}" />
<!-- field 2 -->
</aura:if>


In js controller



doInit: function(component) {
//call apex
var action = component.get('c.getHelpText');

action.setCallback(this, function(response){
var resp = response.getReturnValue();
component.set("v.helpText1", resp.Test_Field1__c);
component.set("v.helpText2", resp.Test_Field2__c);
component.set("v.initDone", true);
});
$A.enqueueAction(action);
}





share|improve this answer
























  • Hi @Aditya thanks for the reply. this is what i was looking for!

    – Smruti Ranjan Biswal
    17 hours ago











  • @SmrutiRanjanBiswal glad it helped, you can mark the answer accepted as well so other also can take the reference from here :-)

    – Aditya Vijay
    17 hours ago











  • yeah sure. Can u also help me with how to get the 'Guidance for Success of Sales Path to the Custom Component or to Apex'

    – Smruti Ranjan Biswal
    16 hours ago











  • @SmrutiRanjanBiswal that is a part of metadata developer.salesforce.com/docs/atlas.en-us.api_meta.meta/… you need to use Metadata API in order to get this to apex which is a bit complex to use. lightning:picklistPath is there to create the path in component, but it doesn't help with guidance of success or fields. Not sure if something else is there!

    – Aditya Vijay
    15 hours ago
















2














Out of the box is not there, but there is a workaround.

You can hold the loading of help text until you get the help text response from server.



Lets say there are fields called Test_Field1__c and Test_Field2__c on Test_Object__c.



In Apex:



@AuraEnabled
public static Map<String, String> getHelpText() {
String helpText1 = Test_Object__c.Test_Field1__c.getDescribe().getInlineHelpText();
String helpText2 = Test_Object__c.Test_Field2__c.getDescribe().getInlineHelpText();
return Map<String, String> { 'Test_Field1__c'=>helpText1, 'Test_Field2__c'=>helpText2 };
}


And in lightning component



<aura:attribute name="helpText1" type="String" default="" />
<aura:attribute name="helpText2" type="String" default="" />
<aura:attribute name="initDone" type="Boolean" default="false" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:if isTrue="{!v.initDone}">
<lightning:helptext content="{!v.helpText1}" />
<!-- field 1 -->
<lightning:helptext content="{!v.helpText2}" />
<!-- field 2 -->
</aura:if>


In js controller



doInit: function(component) {
//call apex
var action = component.get('c.getHelpText');

action.setCallback(this, function(response){
var resp = response.getReturnValue();
component.set("v.helpText1", resp.Test_Field1__c);
component.set("v.helpText2", resp.Test_Field2__c);
component.set("v.initDone", true);
});
$A.enqueueAction(action);
}





share|improve this answer
























  • Hi @Aditya thanks for the reply. this is what i was looking for!

    – Smruti Ranjan Biswal
    17 hours ago











  • @SmrutiRanjanBiswal glad it helped, you can mark the answer accepted as well so other also can take the reference from here :-)

    – Aditya Vijay
    17 hours ago











  • yeah sure. Can u also help me with how to get the 'Guidance for Success of Sales Path to the Custom Component or to Apex'

    – Smruti Ranjan Biswal
    16 hours ago











  • @SmrutiRanjanBiswal that is a part of metadata developer.salesforce.com/docs/atlas.en-us.api_meta.meta/… you need to use Metadata API in order to get this to apex which is a bit complex to use. lightning:picklistPath is there to create the path in component, but it doesn't help with guidance of success or fields. Not sure if something else is there!

    – Aditya Vijay
    15 hours ago














2












2








2







Out of the box is not there, but there is a workaround.

You can hold the loading of help text until you get the help text response from server.



Lets say there are fields called Test_Field1__c and Test_Field2__c on Test_Object__c.



In Apex:



@AuraEnabled
public static Map<String, String> getHelpText() {
String helpText1 = Test_Object__c.Test_Field1__c.getDescribe().getInlineHelpText();
String helpText2 = Test_Object__c.Test_Field2__c.getDescribe().getInlineHelpText();
return Map<String, String> { 'Test_Field1__c'=>helpText1, 'Test_Field2__c'=>helpText2 };
}


And in lightning component



<aura:attribute name="helpText1" type="String" default="" />
<aura:attribute name="helpText2" type="String" default="" />
<aura:attribute name="initDone" type="Boolean" default="false" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:if isTrue="{!v.initDone}">
<lightning:helptext content="{!v.helpText1}" />
<!-- field 1 -->
<lightning:helptext content="{!v.helpText2}" />
<!-- field 2 -->
</aura:if>


In js controller



doInit: function(component) {
//call apex
var action = component.get('c.getHelpText');

action.setCallback(this, function(response){
var resp = response.getReturnValue();
component.set("v.helpText1", resp.Test_Field1__c);
component.set("v.helpText2", resp.Test_Field2__c);
component.set("v.initDone", true);
});
$A.enqueueAction(action);
}





share|improve this answer













Out of the box is not there, but there is a workaround.

You can hold the loading of help text until you get the help text response from server.



Lets say there are fields called Test_Field1__c and Test_Field2__c on Test_Object__c.



In Apex:



@AuraEnabled
public static Map<String, String> getHelpText() {
String helpText1 = Test_Object__c.Test_Field1__c.getDescribe().getInlineHelpText();
String helpText2 = Test_Object__c.Test_Field2__c.getDescribe().getInlineHelpText();
return Map<String, String> { 'Test_Field1__c'=>helpText1, 'Test_Field2__c'=>helpText2 };
}


And in lightning component



<aura:attribute name="helpText1" type="String" default="" />
<aura:attribute name="helpText2" type="String" default="" />
<aura:attribute name="initDone" type="Boolean" default="false" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:if isTrue="{!v.initDone}">
<lightning:helptext content="{!v.helpText1}" />
<!-- field 1 -->
<lightning:helptext content="{!v.helpText2}" />
<!-- field 2 -->
</aura:if>


In js controller



doInit: function(component) {
//call apex
var action = component.get('c.getHelpText');

action.setCallback(this, function(response){
var resp = response.getReturnValue();
component.set("v.helpText1", resp.Test_Field1__c);
component.set("v.helpText2", resp.Test_Field2__c);
component.set("v.initDone", true);
});
$A.enqueueAction(action);
}






share|improve this answer












share|improve this answer



share|improve this answer










answered 18 hours ago









Aditya VijayAditya Vijay

430211




430211













  • Hi @Aditya thanks for the reply. this is what i was looking for!

    – Smruti Ranjan Biswal
    17 hours ago











  • @SmrutiRanjanBiswal glad it helped, you can mark the answer accepted as well so other also can take the reference from here :-)

    – Aditya Vijay
    17 hours ago











  • yeah sure. Can u also help me with how to get the 'Guidance for Success of Sales Path to the Custom Component or to Apex'

    – Smruti Ranjan Biswal
    16 hours ago











  • @SmrutiRanjanBiswal that is a part of metadata developer.salesforce.com/docs/atlas.en-us.api_meta.meta/… you need to use Metadata API in order to get this to apex which is a bit complex to use. lightning:picklistPath is there to create the path in component, but it doesn't help with guidance of success or fields. Not sure if something else is there!

    – Aditya Vijay
    15 hours ago



















  • Hi @Aditya thanks for the reply. this is what i was looking for!

    – Smruti Ranjan Biswal
    17 hours ago











  • @SmrutiRanjanBiswal glad it helped, you can mark the answer accepted as well so other also can take the reference from here :-)

    – Aditya Vijay
    17 hours ago











  • yeah sure. Can u also help me with how to get the 'Guidance for Success of Sales Path to the Custom Component or to Apex'

    – Smruti Ranjan Biswal
    16 hours ago











  • @SmrutiRanjanBiswal that is a part of metadata developer.salesforce.com/docs/atlas.en-us.api_meta.meta/… you need to use Metadata API in order to get this to apex which is a bit complex to use. lightning:picklistPath is there to create the path in component, but it doesn't help with guidance of success or fields. Not sure if something else is there!

    – Aditya Vijay
    15 hours ago

















Hi @Aditya thanks for the reply. this is what i was looking for!

– Smruti Ranjan Biswal
17 hours ago





Hi @Aditya thanks for the reply. this is what i was looking for!

– Smruti Ranjan Biswal
17 hours ago













@SmrutiRanjanBiswal glad it helped, you can mark the answer accepted as well so other also can take the reference from here :-)

– Aditya Vijay
17 hours ago





@SmrutiRanjanBiswal glad it helped, you can mark the answer accepted as well so other also can take the reference from here :-)

– Aditya Vijay
17 hours ago













yeah sure. Can u also help me with how to get the 'Guidance for Success of Sales Path to the Custom Component or to Apex'

– Smruti Ranjan Biswal
16 hours ago





yeah sure. Can u also help me with how to get the 'Guidance for Success of Sales Path to the Custom Component or to Apex'

– Smruti Ranjan Biswal
16 hours ago













@SmrutiRanjanBiswal that is a part of metadata developer.salesforce.com/docs/atlas.en-us.api_meta.meta/… you need to use Metadata API in order to get this to apex which is a bit complex to use. lightning:picklistPath is there to create the path in component, but it doesn't help with guidance of success or fields. Not sure if something else is there!

– Aditya Vijay
15 hours ago





@SmrutiRanjanBiswal that is a part of metadata developer.salesforce.com/docs/atlas.en-us.api_meta.meta/… you need to use Metadata API in order to get this to apex which is a bit complex to use. lightning:picklistPath is there to create the path in component, but it doesn't help with guidance of success or fields. Not sure if something else is there!

– Aditya Vijay
15 hours ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Salesforce Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f253324%2fhelp-text-on-fields-of-custom-lightning-component%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to label and detect the document text images

Vallis Paradisi

Tabula Rosettana