• Upasana Paul
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
My main aim is to show different fields on child object, if the parent object has a particular piclist value.
To achieve this I have created 2 record types and 2 page layouts.
So I have created a custom button to add the child record with prefilled value of the parent by URL hacking.
/a0T/e? CF00N0k000002irEW={!TRIM(Returns_Request__c.Name)} &CF00N0k000002irEW_lkid={!Returns_Request__c.Id} &retURL=%2F{!Returns_Request__c.Id} &RecordType={!IF( INCLUDES( Returns_Request__c.Reason__c ,'Incorrect Pricing') ,'0120k0000008QsNAAU','')} &ent=01I0k000000AsBx
This is the code I have used. It works perfectly on website but does not work on mobile.
Please suggest any improvement on this or maybe a completly different way to show different fields on child record creation based on parent record picklist.
I  have a vf page which has a button named "proceed" on line 154. what it should do is to display the form2 which is apex:form and hide form which is also apex:form.
I am trying to do it using javascript $j('form[id$=form2]').show(); and $j('form[id$=form]').hide();
This method is not working.
Can anyone please help me as to why this does not work
`
<apex:page controller="Email_Quotation_Controller" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" >    
    <script src='/canvas/sdk/js/publisher.js' type='text/javascript' ></script>   
    <script src="/soap/ajax/40.0/connection.js" type="text/javascript" ></script>   
    <script src="/soap/ajax/40.0/apex.js" type="text/javascript" ></script>
    <script src="/sforce/one/40.0/api.js" type="text/javascript" ></script>   
    <apex:stylesheet value="{!URLFOR($Resource.SLDS, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
    
    <apex:includescript value="{!URLFOR($Resource.CKEditorAirco, 'ckeditor/ckeditor.js')}" />
    
    
    
    
    <script >
    
    
    function hideContactList(){
        $j('form[id$=form2]').show();
        $j('form[id$=form]').hide();
    }
    
    function back(){
        showSpinner();
        CallApexMethodBack();
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {              
            //javascript:sforce.one.navigateToURL('/apex/page?Account=');
        }else{
            //window.location.href ='/apex/page?Account=';
        }              
    }
    function back2(){
        showSpinner();
        CallApexMethodBack2();
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {              
            //javascript:sforce.one.navigateToURL('/apex/page?Account=');
        }else{
            //window.location.href ='/apex/page?Account=';
        }              
    }
    function selectToEmail(){
        showSpinner();
        CallApexMethodSelectToEmail();
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {              
            //javascript:sforce.one.navigateToURL('/apex/page?Account=');
        }else{
            //window.location.href ='/apex/page?Account=';
        }              
    }
    function sendTemplates(){
        showSpinner();
        CallApexMethodSendTemplates();
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {              
            //javascript:sforce.one.navigateToURL('/apex/page?Account=');
        }else{
            //window.location.href ='/apex/page?Account=';
        }              
    }
    function showSpinner(){
        document.getElementById('loader').style.display = 'block';
    }
    function hideSpinner(){
        document.getElementById('loader').style.display = 'none';
    }
    </script>
    
    <style>
        tr.spaceUnder > td{
        padding-bottom: 1em;
        }    
        .cError{
        font-weight: bold;
        color: #c00;
        text-align: center
        }
        .title{
        font-family: inherit;
        font-weight: 500;
        line-height: 1.1;
        color: #2e4153;
        font-size: 18px;
        }   
    </style>
    <style>
        .slds-form-element{
        margin-bottom: 0px;
        }
    </style>
    
    <apex:slds />
    
    <body>    
        <!-- REQUIRED SLDS WRAPPER -->
        <div class="slds">    
            <div class="slds-spinner_container" style="display:none;" id="loader">
                <div class="slds-spinner slds-spinner--large" aria-hidden="false" role="alert">
                    <div class="slds-spinner__dot-a"></div>
                    <div class="slds-spinner__dot-b"></div>
                </div>
            </div>
            <!-- MASTHEAD -->
            <div class="slds-text-heading--large slds-text-align--left" style="margin-bottom:50px"> </div>
            
            <div class="slds-text-heading--medium slds-text-align--left" style="margin-bottom:30px"> </div>
            <!-- / MASTHEAD -->    
            
            <!-- PRIMARY CONTENT WRAPPER -->
            <div class="myapp">
                
                <div class="slds-container--center slds-container--small">
                    
                    <apex:form id="form" rendered="{!emailNotSelected}">
                        <apex:actionFunction name="CallApexMethodSelectToEmail" action="{!selectToEmail}" rerender="toEmailsOutPutText, messagePanel" oncomplete="hideSpinner(),hideContactList()"/>
                        <apex:actionFunction name="CallApexMethodBack" action="{!Back}" oncomplete="hideSpinner()"/>
                        
                        <apex:outputPanel id="emailSetPanel">
                            
                            <apex:pageBlock >
                                <div id="emailErrorDiv" class="cError" style="display:none;">Error: No Contact selected. <br/> NO Select at least one Contact in Quotation to proceed to send mail.</div>
                                
                                <div class="title"><b>Customer Contacts:</b></div>
                                <div>&nbsp;</div>
                                <apex:pageBlockTable width="50%" value="{!contactInnerClassList}" var="c" id="tblResults">                       
                                    <apex:column >
                                        <apex:facet name="header"><apex:outputPanel >Select</apex:outputPanel></apex:facet>
                                        <apex:inputCheckbox value="{!c.selected}"/>    
                                    </apex:column>
                                    <apex:column >
                                        <apex:facet name="header"><apex:outputPanel >Name</apex:outputPanel></apex:facet>
                                        <apex:outputtext >{!c.name}</apex:outputtext>     
                                    </apex:column>
                                    <apex:column >
                                        <apex:facet name="header"><apex:outputPanel >Email</apex:outputPanel></apex:facet>
                                        <apex:outputtext >{!c.email}</apex:outputtext>    
                                    </apex:column>
                                </apex:pageBlockTable>                         
                            </apex:pageBlock>
                            
                            <div>&nbsp;</div>
                            <div>&nbsp;</div>
                            <div class="title"><b>Internal Users:</b></div>
                            <div>&nbsp;</div>
                            
                            <apex:pageBlock id="pbselect">
                                <div align="left">
                                    <apex:selectList id="myselect" value="{!internalUsersSelected}" multiselect="true" size="10">
                                        <apex:selectOptions value="{!items}"/>
                                    </apex:selectList>
                                </div>
                            </apex:pageBlock>          
                            
                            <div align="center">
                                <div>&nbsp;</div>		
                                <span id="proceed2" >
                                    <div class="slds-text-align--center">
                                        <a class="slds-button slds-button--brand" onclick="selectToEmail();">Proceed</a>
                                        <a class="slds-button slds-button--brand" onclick="back();">Go Back</a>
                                    </div>                
                                </span>
                            </div>    
                            
                        </apex:outputPanel>             
                    </apex:form>  
                </div>
                
                <apex:form id="form2" style="display:none;" > 
                    <apex:actionFunction name="CallApexMethodSendTemplates" action="{!sendTemplates}" oncomplete="hideSpinner()"/>
                    <apex:actionFunction name="CallApexMethodBack2" action="{!Back}" oncomplete="hideSpinner()"/>
                    
                    <apex:outputPanel id="emailOutputPanel">
                        
                        <table width="100%">
                            <b>
                                <tr class="spaceUnder">
                                    <td width="10%"><b>To: </b></td>
                                    <td width="90%"><apex:outputText value="{!toEmails}" id="toEmailsOutPutText"/></td>            
                                </tr>
                                <tr class="spaceUnder">
                                    <td width="10%"><b>Cc: </b></td>
                                    <td width="90%"><apex:inputTextarea value="{!ccemails}" style="width:100%"/></td>             
                                </tr>
                                <tr class="spaceUnder">
                                    <td width="10%"><b>Email Template: </b></td>
                                    <td width="90%">
                                        <apex:selectList value="{!tmpltName}" id="Template" size="1" label="Email Template">
                                            <apex:selectOptions value="{!templates}"/>
                                            <apex:actionSupport event="onchange" action="{!populatetemplate}"/>
                                        </apex:selectList>                 
                                    </td>             
                                </tr>
                                <tr class="spaceUnder">
                                    <td width="10%"><b>Email Subject: </b></td>
                                    <td width="90%"><apex:inputText value="{!emailSubject}" style="width:100%" /></td>             
                                </tr>                         
                                <tr class="spaceUnder">
                                    <td width="10%"><b>Email Body: </b></td>
                                    <td width="90%"><apex:inputtextarea value="{!emailBody}" id="Body1" styleClass="ckeditor"/></td>           
                                </tr>           
                            </b>                        
                        </table>
                        
                        <div class="slds-container--center slds-container--small">
                            <div>&nbsp;</div>
                            <div>&nbsp;</div>
                            <span id="send" >
                                <div class="slds-text-align--center">
                                    <a class="slds-button slds-button--brand" onclick="sendTemplates();">Send Email</a>
                                    <a class="slds-button slds-button--brand" onclick="back2();">Go Back</a>
                                </div>                
                            </span>                
                        </div>   
                        
                    </apex:outputPanel>       
                </apex:form>            
                <apex:outputPanel rendered="{!emailSelected}">
                    <script>
                    $j('form[id$=form2]').show();
                    </script>
                </apex:outputPanel>           
                
            </div>
            <!-- / PRIMARY CONTENT WRAPPER -->    
            
            
            <apex:outputPanel id="thePricePanel">        
                <!-- Custom error message -->
                <apex:outputpanel rendered="{!warningFlag}">
                    <div class="slds-notify_container">
                        <div class="slds-notify slds-notify--alert slds-theme--alert-texture" role="alert">
                            <button class="slds-button slds-notify__close slds-button--icon-inverse" title="Close">
                                <svg aria-hidden="true" class="slds-button__icon">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#close')}"></use>
                                </svg>
                                <span class="slds-assistive-text">Close</span>
                            </button>
                            <span class="slds-assistive-text">Info</span>
                            <h2>{!warningMsg}</h2>
                        </div>
                        <p>&nbsp;</p>				  		  
                    </div>    
                </apex:outputpanel>
                <apex:outputpanel rendered="{!errorFlag}">
                    <div class="slds-notify_container">
                        <div class="slds-notify slds-notify--alert slds-theme--error slds-theme--alert-texture" role="alert">
                            <button class="slds-button slds-notify__close slds-button--icon-inverse" title="Close">
                                <svg aria-hidden="true" class="slds-button__icon">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#close')}"></use>
                                </svg>
                                <span class="slds-assistive-text">Close</span>
                            </button>
                            <span class="slds-assistive-text">Error</span>
                            <h2>
                                <svg aria-hidden="true" class="slds-icon slds-icon--small slds-m-right--x-small">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#ban')}"></use>
                                </svg>{!errorMsg}</h2>
                        </div>
                        <p>&nbsp;</p>				  		  
                    </div>    
                </apex:outputpanel>
                <apex:outputpanel rendered="{!successFlag}">
                    <div class="slds-notify_container">
                        <div class="slds-notify slds-notify--alert slds-theme--success slds-theme--alert-texture" role="alert">
                            <button class="slds-button slds-notify__close slds-button--icon-inverse" title="Close">
                                <svg aria-hidden="true" class="slds-button__icon">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#close')}"></use>
                                </svg>
                                <span class="slds-assistive-text">Close</span>
                            </button>
                            <span class="slds-assistive-text">Success</span>
                            <h2>
                                <svg aria-hidden="true" class="slds-icon slds-icon--small slds-m-right--x-small">
                                    <use href="{!URLFOR($Asset.SLDS, '/assets/icons/custom-sprite/svg/symbols.svg#custom19')}"></use>		        
                                </svg>{!successMsg}</h2>
                        </div>
                        <p>&nbsp;</p>				  
                    </div>    
                </apex:outputpanel>
                <!-- Custom error message -->
            </apex:outputPanel>
            
            
        </div>
        
        <!-- / REQUIRED SLDS WRAPPER -->    
        <apex:includeScript value="{!$Resource.SLDSDynamicLookupScript}"/>
        
    </body>
    
</apex:page>
I need to remove the 1st column from the lightning table which is the row number but not able to do it.
User-added image


My .cmp looks as follows
 
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Order" type="Order__c" />
<aura:attribute name="OrderLines" type="Otter_FFA_Order_Line_Item__c" />
<aura:attribute name="Columns" type="List" />

<aura:handler name="init" value="{!this}" action="{!c.myAction}" />

<force:recordData aura:id="OrderRecord" recordId="{!v.recordId}" targetFields="{!v.Order}" layoutType="FULL" />


<lightning:card iconName="standard:contact" title="{! 'Order Items List for ' + v.Order.Otter_FFA_Order__c}">
    <!-- Order Line list goes here -->
        <lightning:datatable data="{! v.OrderLines }" columns="{! v.Columns }"  keyField="Id"/>

</lightning:card>

And .js is as below
({ myAction : function(component, event, helper) {

    component.set("v.Columns", [
        {label:"#", initialWidth: 20, fieldName:"Otter_FFA_Ln__c", type:"number"},
        {label:"Item", initialWidth:80, fieldName:"Product_Name__c", type:"text"},
        {label:"Description", initialWidth: 110, fieldName:"Description_1_and_2__c", type:"text"},
        {label:"QTY", initialWidth: 70, fieldName:"Otter_FFA_Quantity__c", type:"number",editable: true},
    {label:"Net Price", initialWidth: 70, fieldName:"Otter_FFA_Net_Price__c", type:"number"},
        {label:"Add Disc%", initialWidth: 90, fieldName:"Otter_FFA_User_Discount__c", type:"number",editable: true},
        {label:"Order Price", initialWidth: 70, fieldName:"Otter_FFA_Applied_Net_Price__c", type:"number",editable: true},
        {label:"Total Before GST", initialWidth: 70, fieldName:"Otter_FFA_Total_Price__c", type:"number"}

    ]);
    var action = component.get("c.getOrderLines");

    action.setParams({
        recordId: component.get("v.recordId")
    });

    action.setCallback(this, function(OrderLines) {
        component.set("v.OrderLines", OrderLines.getReturnValue());
    });

    $A.enqueueAction(action);
}
})

with a stylesheet as below
.THIS .slds-th__action{ word-wrap: initial; font-weight: bold; font-size: 70% !important; }
 
I have been trying to install Force.com IDE software on mac os 10.13.6 but it is giving me this error when I try to create a new project for Force.com IDE in eclipse for creating metadata backup of my salesforce org. 
User-added image
The steps that I have used is from https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/ide_install.htm this salesforce site and with same exact versions of java and eclipse as well as with the latest version of eclipse for committers.
Any help would be really appreciated.
I need to remove the 1st column from the lightning table which is the row number but not able to do it.
User-added image


My .cmp looks as follows
 
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Order" type="Order__c" />
<aura:attribute name="OrderLines" type="Otter_FFA_Order_Line_Item__c" />
<aura:attribute name="Columns" type="List" />

<aura:handler name="init" value="{!this}" action="{!c.myAction}" />

<force:recordData aura:id="OrderRecord" recordId="{!v.recordId}" targetFields="{!v.Order}" layoutType="FULL" />


<lightning:card iconName="standard:contact" title="{! 'Order Items List for ' + v.Order.Otter_FFA_Order__c}">
    <!-- Order Line list goes here -->
        <lightning:datatable data="{! v.OrderLines }" columns="{! v.Columns }"  keyField="Id"/>

</lightning:card>

And .js is as below
({ myAction : function(component, event, helper) {

    component.set("v.Columns", [
        {label:"#", initialWidth: 20, fieldName:"Otter_FFA_Ln__c", type:"number"},
        {label:"Item", initialWidth:80, fieldName:"Product_Name__c", type:"text"},
        {label:"Description", initialWidth: 110, fieldName:"Description_1_and_2__c", type:"text"},
        {label:"QTY", initialWidth: 70, fieldName:"Otter_FFA_Quantity__c", type:"number",editable: true},
    {label:"Net Price", initialWidth: 70, fieldName:"Otter_FFA_Net_Price__c", type:"number"},
        {label:"Add Disc%", initialWidth: 90, fieldName:"Otter_FFA_User_Discount__c", type:"number",editable: true},
        {label:"Order Price", initialWidth: 70, fieldName:"Otter_FFA_Applied_Net_Price__c", type:"number",editable: true},
        {label:"Total Before GST", initialWidth: 70, fieldName:"Otter_FFA_Total_Price__c", type:"number"}

    ]);
    var action = component.get("c.getOrderLines");

    action.setParams({
        recordId: component.get("v.recordId")
    });

    action.setCallback(this, function(OrderLines) {
        component.set("v.OrderLines", OrderLines.getReturnValue());
    });

    $A.enqueueAction(action);
}
})

with a stylesheet as below
.THIS .slds-th__action{ word-wrap: initial; font-weight: bold; font-size: 70% !important; }
 
I have been trying to install Force.com IDE software on mac os 10.13.6 but it is giving me this error when I try to create a new project for Force.com IDE in eclipse for creating metadata backup of my salesforce org. 
User-added image
The steps that I have used is from https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/ide_install.htm this salesforce site and with same exact versions of java and eclipse as well as with the latest version of eclipse for committers.
Any help would be really appreciated.