• Jitendra
  • SMARTIE
  • 1902 Points
  • Member since 2008
  • Salesforce MVP


  • Chatter
    Feed
  • 65
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 13
    Questions
  • 428
    Replies
I need to be able to display a component in a lightning console app with a button bound to the bottom  of the screen as the user scrolls. The button will bring the user back to the top of the record page upon clicking it. My code below works on a lightning application record  page, but not on the lightning console application record page.

Please let me know if you have any suggestions on how to display this component on a console record page. 

ScrollToTopOfPage.cmp: 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome" access="global">
    <aura:attribute name="title" type="string" default="Go to top" description="Tooltip text when the mouse moves over the element"/>
    <aura:attribute name="label" type="string" default="Go to top" description="Text to be displayed inside the button"/>
    <aura:attribute name="className" type="string" description="CSS class for element"/>
    <aura:attribute name="heightToShowButton" type="integer" default="100" description="Height after which button will be visible"/>
    <aura:attribute name="iconName" type="string" default="utility:jump_to_top" description="Lightning Design System name of the icon. Names are written in the format 'utility:down' where 'utility' is the category, and 'down' is the specific icon to be displayed."/>
    <aura:attribute name="iconPosition" type="string" default="right" description="Describes the position of the icon with respect to body. Options include left and right."/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

    <lightning:button variant="brand" aura:id="scrollToTopBtn" class="{!'scrollToTopBtn hideBtn ' + v.className}"
                      iconName="{!v.iconName}" iconPosition="{!v.iconPosition}"
                      title="{!v.title}" label="{!v.label}" onclick="{!c.scrollToTop}"/>
</aura:component>

ScrollToTopOfPageController.js:
({    
    doInit : function(component, event, helper){
       helper.bindScrollEvent(component, event);
    },
    
    scrollToTop : function(component, event, helper) {
        window.scroll({
            top: 0, 
              behavior: 'smooth' 
        });
    }
})

ScrollToTopOfPageHelper: 
({
    bindScrollEvent : function(component, event) {
        var heightIndx = component.get("v.heightToShowButton");
        console.log("testing"); 
        window.onscroll = function() {
            console.log("scrolling"); 
            var btnCmp = component.find("scrollToTopBtn");
            if (document.body.scrollTop > heightIndx || document.documentElement.scrollTop > heightIndx) {
                $A.util.removeClass(btnCmp, 'hideBtn');
                console.log("if"); 
            } else {
                $A.util.addClass(btnCmp, 'hideBtn');
                console.log("else");
            }
        };
    }
})

ScrollToTopOfPage.css: 
.THIS.scrollToTopBtn {
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  font-size: 18px;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 15px;
  border-radius: 4px;
}

.THIS.hideBtn{
    display : none;
}
ScrollToTopOfPage.design:
<design:component >
    <design:attribute name="title" default="Go to top" description="Tooltip text when the mouse moves over the element"/>
    <design:attribute name="label" default="Go to top" description="Text to be displayed inside the button"/>
    <design:attribute name="className" description="CSS class for element"/>
    <design:attribute name="iconName" default="utility:jump_to_top" description="Lightning Design System name of the icon. Names are written in the format 'utility:down' where 'utility' is the category, and 'down' is the specific icon to be displayed."/>
    <design:attribute name="iconPosition" default="right" description="Describes the position of the icon with respect to body. Options include left and right."/>
    <design:attribute name="heightToShowButton" default="100" description="Height after which button will be visible"/> 
</design:component>
Hi Guys,
I need your help that how can I create a custom button on list view to run the batch class.
Right now I go to developer console and click on Debug and click on Open Execute Anonymous Window and then I enter Database.executeBatch(new CreateOrderBatch(),1); and then execute it. When I execute it then it makes a API call.
Is there a way I can just click on the Custom Button on List View and it makes API calls instead of going Developer Console?

Thanks!
Hi Adminstrators and Developers,
Is there any way, to stop the auto email trigger to the user when the user is newly created? Please help.

-Kaity
Hi All,

Just wanted to understand the difference between when to use Continutaion Class and when to use @future  (callout = true) in case asynchronous invocation of WS.

In case of imported WSDL, can we call the sync stub class from a method using @future(callout == true) or we have to use asyncWSDLtoApex class passing the continuation object.

Can anyone please explain both the concepts with bit explanation.

Great Thanks
Somnath
I am trying to create a button on a custom object so when clicked, it updates a checkbox field on the object. I am not a developer so I am reaching out to the pros! 
Hi,

I am trying to develop S2S integration using canvas application. For that i followed http://www.jitendrazaa.com/blog/salesforce/salesforce-to-salesforce-integration-using-canvas/ In that he asked to develop a VF(in service provider) which will be called in identity provider. 

VF code is as below
<apex:page showHeader="false">
    
    <script type="text/javascript" src="{!URLFOR($Resource.CanvasSDK,'SalesforceCanvasJavascriptSDK-master/js/canvas-all.js')}" />
    
    <script type="text/javascript">
        
        var sid="{!GETSESSIONID()}".substr(1,30) +'...';
    
    	function refreshSR(){
        	Sfdc.canvas.client.refreshSignedRequest(function(data){
            	
                if(data.status == 200){
                	var signedRequest = data.payload.response;
                    var part = signedRequest.split('.')[1];
                    var obj = JSON.parse(Sfdc.canvas.decode(part));
                    updateDisplay(obj) ;
                } 
            }); 
        }
    
    function updateDisplay(obj){
    	setValue('spSessionId', sid);
        setValue('ipOAuth', obj.client.oauthToken.substr(1,30)+'...');
        setValue('ipUser', obj.context.user.fullName);
        setValue('ipOrg', obj.context.organization.name);
        setValue('ipRefresh', obj.client.refreshToken.substr(1,30)+'...');
    }
    
    function setValue(eleId,val)
    {
       	var domEl = document.getElementById(eleId);
        if(domEl){
        	domEl.innerHTML = val;    
        }
    }
    
    Sfdc.canvas.onReady(function(){
    	refreshSR();
    });
         
    </script>
          
        <b> <u> Service Provider Org </u></b>  
        I am Canvas App from Salesforce Domain <b> Jitendra.zaa5@gmail.com </b>      
        User : {!$User.FirstName} {!$User.LastName} 
        Org : {!$Organization.Name}
        Session Id : <span id="spSessionId"></span>    

<hr />
 
        <b> <u> Identity Provider Org  - Current Org </u> </b>
        User : <span id="ipUser"></span>
         Org : <span id="ipOrg"></span>
         OAUth Token : <span id="ipOAuth"></span>
        Refresh Token : <span id="ipRefresh"></span>
     
</apex:page>
My VF page showing without the session id and informations of identity provider as belowUser-added image
How to get those values. I Need some one help to resolve it. 

Thanks.
For trailhead challenge (https://developer.salesforce.com/trailhead/lightning_components/lightning_components_uiforce), I am using below code. I am not able to figure out whats wrong in below code. I am getting error saying "The component is not using the ui:inputText component"
 
<aura:component >       
    <aura:attribute name="fName" type="String" default="Jitendra"/>
    <aura:attribute name="lName" type="String" default="Zaa"/>
    <aura:attribute name="pNumber" type="String" default="201"/>
    <aura:attribute name="sal" type="String" default="Mr."/>
 
    <ui:inputText label="First Name" value="{!v.fName}" />  
    <ui:inputText label="Last Name" value="{!v.lName}"  /> 
    <ui:inputText label="Phone Number" value="{!v.pNumber}"  />  
    
    <ui:inputSelect multiple="false" label="Salutation" value="{!v.sal}" >
        <ui:inputSelectOption text="Dr." label="Dr." />
        <ui:inputSelectOption text="Mr." label="Mr."/>
        <ui:inputSelectOption text="Mrs." label="Mrs."/>
        <ui:inputSelectOption text="Ms." label="Ms."/>
	</ui:inputSelect> 
    <ui:button label="Submit"/>
</aura:component>

 
I am new to Salesforce platform.  Not sure if it is possible to run CURL command on the Salesforce platform using APEX programming lanugage to retrieve external data source from another website such as ORCID ID from www.Orcid.org website.  Although I have successfully retrieved data from Salesforce object by running CURL command on my Windows 7 based computer.
If it is possible, can you please point me to information on how to run simple CURL command on the Salesforce platform.
Thanks
Does anyone know how I can set up my approvals so that users dont have to click the "submit for approval" ?
I have built a simple tab structure for the opportunity page.  I am using a custom field, it is not showing the name of the field before the picklist value.  Also I was wondering is there a way to have the save button act just like the standard save button that just shows that field not the box where I can add text of pick some thing. 

<apex:page standardController="Opportunity" sidebar="false" showHeader="false">
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="OpportunityTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
      <apex:tab label="Onboarding"> 
          <apex:form >
               <center><apex:commandButton action="{!Save}" value="Save"/></center><br></br> <br></br>
                    <apex:inputField value="{!opportunity.Growth_Enhancement_Track__c}"/>
          </apex:form>
     </apex:tab>
          <apex:tab label="Analysis">
     </apex:tab>
           <apex:tab label="Follow-up">
      </apex:tab>
  </apex:tabPanel>
</apex:page>

This is what it looks like also after I hit save.

User-added image
This is what I would like it to look like after I hit save. Fields are just an example

User-added image
 
I have created a Custom visual force page with around 7 columns and I am trying to display that in the Dashboards but when I do that half of the page is not visible. Is there a way I can increase the width of the Dashboard layout to fit in my page or is there a way I fit in my VF page with 7 columns in the Dashboard layout?
Hello,

We need to update some values of our website ​​when we change a record in Salesforce.
I think this is possible with the 'workflow'... We need a PHP example of how to get this call...

Thanks in advance
using force.com standard rest api's we can achieve all the functionality then what is the need of custom web services?

Hi Folks,

 

I'm trying to run an insert using Data loader with command line interface. Below is my command:

 

C:\Program Files\salesforce.com\Data Loader\bin>process.bat "C:\Program Files\Salesforce.com" accountInsert

 

 

 

On the design canvas, I have 4 dropdown choice elements that do not show as required (e.g., no Red bar next to them, nor have I check any Required box in their definition).

 

But when the flow is run, all dropdown choice fields become required, with both a read bar to the left of the field and a clearly enforced required validation complaint if one tries to pretend they are options.

 

Any idea how I can avoid having all dropdown choice field being required?  I'm clearly missing something basic :smileyfrustrated:

 

I seem to be having an issue with the Encrypt or decrypt portion of the password process. From what i read on the return from command prompt, it knows the first two characters in my password and decrypts it properly ("Sh") but it seems to have a problem with something after this point??? Or i could be completely crazy...

 

Might anyone be able to shed some light? Did i encrypt wrong? Is it recquired to have a key file? If so, where am i supposed to place it?

 

Any help would be appreciated.

834 [main] FATAL com.salesforce.dataloader.process.ProcessRunner  - Unable to ru
n process UofUAccountExtractToCSV
java.lang.RuntimeException: com.salesforce.dataloader.exception.ParameterLoadExc
eption: Error loading parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:136)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:74)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:226)
Caused by: com.salesforce.dataloader.exception.ParameterLoadException: Error loa
ding parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
83)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:620)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config
.java:646)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:94)
        ... 2 more
Caused by: java.lang.NumberFormatException: For input string: "Sh"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
        at java.lang.Integer.parseInt(Integer.java:447)
        at java.lang.Integer.valueOf(Integer.java:526)
        at java.lang.Integer.decode(Integer.java:919)
        at com.salesforce.dataloader.security.EncryptionUtil.textToBytes(Encrypt
ionUtil.java:58)
        at com.salesforce.dataloader.security.EncryptionUtil.decryptString(Encry
ptionUtil.java:194)
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
68)

 process-conf.xml looks like this:

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

    <bean id="UofUAccountExtractToCSV"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
      <description>Gets the UofU accounts with clients and exports to CSV"</description>
        <property name="name" value="UofUAccountExtractToCSV"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.debugMessagesFile" value="c:\Salesforce\DataLoader\Resources\Logs\SFDCdebug.log"/>
                <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
                <entry key="sfdc.username" value="sfdcusername"/>
		<entry key="sfdc.password" value="value returned by encrypt.bat -e"/>
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Client__c"/>
                <entry key="sfdc.extractionSOQL" value="SELECT c.LIS_Account_Name__c, c.Entity_Code__c,c.ClientID_Ext_Id__c, c.Phone_and_Extension__c, c.Secured_Fax__c, c.Comments__c,c.Street_Address__c, c.City__c, c.State__c, c.account__r.name from client__c c where c.account__r.recordtypeid ='012C0000000Q7lIIAS'"/>
                <entry key="process.operation" value="extract"/>
                <entry key="process.mappingFile" value="c:\Salesforce\DataLoader\Resources\Mapping\UofUAccountExtractMap.sdl"/>
                <entry key="process.outputError" value="c:\Salesforce\DataLoader\Resources\Logs\LastOperationError.csv"/>
    		<entry key="dataAccess.writeUTF8" value="true"/>            
		<entry key="dataAccess.type" value="csvWrite"/>
                <entry key="dataAccess.name" value="c:\Salesforce\DataLoader\Resources\Data\UofUSFDCExtract.csv"/>
            </map>
        </property>
    </bean>
</beans>