• venkat bojja
  • NEWBIE
  • 220 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 43
    Questions
  • 32
    Replies
Hi Team,
I have a requirement...
I have Check_Box__c field on opportunity which should editable only  the opportunity stage is Contract Loaded.
How I can achieve this requirement with validation rule or any configuration process...
Thanks in advance
Thanks
Venkat.
I have ObjectA,ObjectB and ObjectC

I have two look-up fields on ObjectB 

Like :ObjectA Name
        ObjectC Name
     
     Now When I'm trying to create the ObjectB record from it's parent object ObjectA related list, no need to visible ObjectC Name Look-up field same like while creating the ObjectB record from it's another parent ObjectC  no need to visible ObjectA Name Look-up field

Thanks in advance ....

Thanks & Regards
Venkat.
Hi Team,
Contact  Record Owner's User is inactive, so in this scenario no one can update the Account Name on that Contact record. Any word around for it. Thanks in advance...
FYI:

User-added image

Thanks
Venkat.
Hi Team

I want to rename the Text Posts tab which is under the Fee>Post on Case Object. Please help me on this.Thanks in advance...
FYI:
User-added image


Thanks 
Venkat    
Hi Team,
I have a requirment.
I have a Case Objec having Lookup to Account And Asset.
After select Account on Case the selected Account related Assets only we need to select and save the case record. If the asset is not related to this seleected Account we need to throw the validation error like Please select the Selected Account related Asset and it should only applicable for recordtypename='service' on the Case object. Please help me on this ASASP.
                 Thanks in Advance.....

Thanks
Venkat.
 
Hi Team,
I have a .CSV file which contains object names and field names.When I upload this file in salesforce org, autometically create that objects and fields. How can we achieve this requirement.
              Thanks in Advance...
Thanks,
Venkat.
Hi Team,
Please help me on below formula as each and every line with expaination.

IF( 
ISPICKVAL( Severity__c , "Critical")&& ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10, 
1,Plan_Due_By_Date___c+4+10,  
2,Plan_Due_By_Date___c+4+10, 
3,Plan_Due_By_Date___c +4+10, 
4,Plan_Due_By_Date___c +4+10, 
5,Plan_Due_By_Date___c+4+10, 
Plan_Due_By_Date___c+3+10), 
IF( 
ISPICKVAL( Severity__c , "High")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10, 
1,Plan_Due_By_Date___c+4+10, 
2,Plan_Due_By_Date___c+4+10, 
3,Plan_Due_By_Date___c +4+10, 
4,Plan_Due_By_Date___c +4+10, 
5,Plan_Due_By_Date___c+4+10, 
Plan_Due_By_Date___c+3+10), 
IF( 
ISPICKVAL( Severity__c , "Medium")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+6+20, 
1,Plan_Due_By_Date___c+8+20, 
2,Plan_Due_By_Date___c+8+20, 
3,Plan_Due_By_Date___c +8+20, 
4,Plan_Due_By_Date___c +8+20, 
5,Plan_Due_By_Date___c+8+20, 
Plan_Due_By_Date___c+7+20), 
IF( 
ISPICKVAL( Severity__c , "Low")&&ISBLANK(Plan_Due_By_Date__c ),CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+10+30, 
1,Plan_Due_By_Date___c+12+30, 
2,Plan_Due_By_Date___c+12+30, 
3,Plan_Due_By_Date___c+12+30, 
4,Plan_Due_By_Date___c+12+30, 
5,Plan_Due_By_Date___c+12+30, 
Plan_Due_By_Date___c+41),Plan_Due_By_Date__c 



)

Thanks in advance

Thanks,
Venkat.
Hi Team,

I have a requirement i want to clone the case with custom Action. Please provide me the reference component for this. While cloning the case i want to make sure few fiedls are blank with case status as NEW. 

                                      Thanks in advance 

Thanks,
Venkat.
Hi Team,

How to Display the current system date and Time with better UI template in lightning.Please help me on this.
                                 Thanks in advance....
Thanks
bvr.
Hi Team,
Any one is having the lightning documentation is done by their own.
If have please provide.. Thanks in advance\

Thanks 
Venkat.
Hi Team,
I Have one issue...
When i am tring to use var showToast = $A.get("e.force:showToast");  like this in my controller.Js  it is not working through the developer console.
But it is working into tab level. I required to work this into developer console. Is there any work aroud it. Please help me on this...
Thanks in advance...

Thanks
Venkat
Hi Team,

How could we open a component into new tab from the same application in lightning.  What are the possibilities. Please help me on this.

Thanks
Venkat
Hi Team,
I am iterating the <a href="https://www.google.co.in/" target="_blank">My Google</a>. In hyper link how can we give the component URL. Is it possible...?.when i clicked on that hyper link i need to navigate to that particular component with record ID. I don't want to use the force:navigateToURL.
Please help me on this... Thanks in advance...
Reference Code:

 <aura:iteration items="{!v.ContactList}" var="acc">
                                        <tr>
                                            <th>
                                                <label class="slds-checkbox" id="{!acc.Id}">
                                                    <ui:inputCheckbox aura:id="checkContact" name="{!acc.Id}" text="{!acc.Id}" change="{!c.onCheckboxChange}" />

                                                    <span class="slds-checkbox--faux" />
                                                    <span class="slds-form-element__label"></span>
                                                </label>
                                            </th>
                                            <th scope="row">
                                                <div class="slds-truncate" title="">{!acc.Name}</div>
                                            </th>
                                            <td>
                                                <div class="slds-truncate" title="">{!acc.Phone}</div>
                                            </td>
                                            <th scope="row">
                                                <div class="slds-truncate" title="">{!acc.Email}</div>
                                            </th>

                                            <td>
                                                <div class="slds-truncate" title=""><a href="https://www.google.co.in/" target="_blank">My Google</a></div>
                                            </td>

                                            <th scope="row">
                                                <div class="slds-truncate" title="{!acc.PM_General_Notes__c}">{!acc.AccountId}</div>
                                            </th>

                                        </tr>
                                    </aura:iteration>

=============================================================
Ref Image:

User-added image
Thanks 
Venkat
Hi Team,

I have a one data table with check boxes. Ineed to check only one check box at a time with the checked record ID.Please help me on this.
                                     Thanks in advance...

Reference code:

Component:

<aura:component  controller="ContactAuraController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >

    <!--Declare Event Handlers--> 
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
     
    <!--Declare Attributes-->
    <aura:attribute name="contactList" type="list" />   
    <aura:attribute name="isSelectAll" type="boolean" default="false"/>
      <aura:attribute name="recdId" type="String" /> 
    <div class="slds-m-around_xx-large">
        <h1 class="slds-text-heading--medium">Contacts</h1>
        <br/>
        <!--Contact List Table-->
        <table class="slds-table slds-table--bordered slds-table--cell-buffer" role="grid">      
            <thead>  
                <tr class="slds-text-title--caps">
                    <th>           
                        <label class="slds-checkbox">
                            <ui:inputCheckbox value="{!v.isSelectAll}" change="{!c.handleSelectedContacts}" aura:id="selectAll"/>
                            <span class="slds-checkbox--faux" />
                            <span class="slds-form-element__label"></span>
                        </label>
                    </th>
                    <th scope="col">
                        <div class="slds-truncate" title="Name">Name</div>
                    </th>
                    <th scope="col">
                        <div class="slds-truncate" title="Account">Account</div>
                    </th>
                     
                    <th scope="col">
                        <div class="slds-truncate" title="Phone">Phone</div>
                    </th>
                     
                    <th scope="col">
                        <div class="slds-truncate" title="Email">Email</div>
                    </th>
                </tr>
            </thead>
            <tbody>        
                <aura:iteration items="{!v.contactList}" var="con">
                    <tr>
                        <th>
                            <label class="slds-checkbox">
                                <ui:inputCheckbox aura:id="checkContact" value="" text="{!con.Id}"/>
                                <span class="slds-checkbox--faux" />
                                <span class="slds-form-element__label"></span>
                            </label>
                        </th>
                        <th scope="row">
                            <div class="slds-truncate" title="{!con.Name}">{!con.Name}</div>
                        </th>
                        <td>
                            <div class="slds-truncate" title="{!con.Account.Name}">{!con.Account.Name}</div>
                        </td>
                        <th scope="row">
                            <div class="slds-truncate" title="{!con.Phone}">{!con.Phone}</div>
                        </th>
                        <td>
                            <div class="slds-truncate" title="{!con.Email}">{!con.Email}</div>
                        </td>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
        <div>
            <br/>
            <!-- <lightning:button label="Submit" class="slds-button_brand" onclick="{!c.handleSelectedContacts }"  /> -->
        </div>
    </div>
</aura:component>

==================================
Controller.JS

({
    //get Contact List from apex controller
    doInit : function(component, event, helper) {
        var action = component.get("c.getContactList");
        action.setParams({
        });
        action.setCallback(this, function(result){
            var state = result.getState();
            if (component.isValid() && state === "SUCCESS"){
                component.set("v.contactList",result.getReturnValue());   
            }
        });
        $A.enqueueAction(action);
    },
     
    //Select all contacts
    
     
    //Process the selected contacts
    
    
    
    getSelectedName: function (cmp, event,helper) {
        debugger; 
        var selectedRows = event.getParam('selectedRows'); 
        
      
        for (var i = 0; i < selectedRows.length; i++){
           // alert(selectedRows[i].Id);
            cmp.set('v.recdId', selectedRows[i].Id); 
            
            var RecordID = cmp.get("v.recdId");
            alert('RecordID'+RecordID);
        
        }
    },
})
=================================
Apex Controller

public class ContactAuraController {
 @AuraEnabled
    Public static List<Contact> getContactList(){
        //get all contact list
        List<Contact> conList = [SELECT Id, Name, Account.Name, Phone, Email FROM Contact LIMIT 10];
        return conList;
    }
}

=====================================
Reference Image:

User-added image
I have developed code to over come limitation of print option for list view.
VF Page
<apex:page sidebar="false" standardStylesheets="false" cache="false" standardController="Account" recordSetVar="accounts" lightningStylesheets="true">
    <button id="upload-button" onclick="window.print();" style="margin-left: 50%;" Class="slds-button">Print</button>
    <apex:includeLightning />
    <div id="lightning" ></div> 
    <script>
        $Lightning.use("c:ListView", function() {
          $Lightning.createComponent("c:ListViewComponent",
          { label : "" },
          "lightning",
          function(cmp) {
             
          });
        });
    </script>
</apex:page>


Controller class
public with sharing class ListViewController {
    
    // Method to get all list view option available for the Account object 
    @AuraEnabled
    public static List<SelectOption> getListViews(){
        SelectOption  lstView=new SelectOption ('--None--','--None--');
        List<SelectOption> listviews = new List<SelectOption>();
        listviews.add(lstView);
        for(ListView lstObj : [SELECT Id, Name FROM ListView WHERE SobjectType = 'Account' order by name ASC]){
            listviews.add(new SelectOption (lstObj.id,lstObj.name));
        }
        return listviews; 
    }
    // Method to get the Account records based on the selected list view
    @AuraEnabled  
    public static DynamicTableMapping getFilteredAccounts(String filterId){
        list<string> headervalue =new list<string>();
        HttpRequest req = new HttpRequest();
        String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        String endPoinURL = baseUrl+'/services/data/v32.0/sobjects/Account/listviews/'+filterId+'/describe';
        req.setEndpoint(endPoinURL);
        req.setMethod('GET');
        req.setHeader('Authorization',  'Bearer ' + UserInfo.getSessionId());
        Http http = new Http();
        HTTPResponse response = http.send(req);
        Map<String, Object> tokenResponse = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
        String query = (String) tokenResponse.get('query');
        system.debug('query--->'+query);
       for(string s:query.split(',')){
            s=s.trim();    
            if(s.startsWith('SELECT')){
                headervalue.add((s.removeStart('SELECT')).trim());        
            }else if(!s.startsWith('SYSTEMMODSTAMP') && !s.equalsIgnoreCase('SYSTEMMODSTAMP FROM ACCOUNT ORDER BY NAME ASC NULLS FIRST') && !s.contains('ASC')){
                headervalue.add(s.trim());
            }
        }
        
        List<ObjectValueMap> AccountList = new List<ObjectValueMap>();
        
        for(Account accountObj : database.query(query)){
            
            Map<String, Schema.SObjectField> objectFields = Account.getSObjectType().getDescribe().fields.getMap();
            list<FieldValues> fieldValue=new list<FieldValues>();
            for(string s:headervalue){
                Schema.DescribeFieldResult dr;
                if (objectFields.containsKey(s)) 
                      dr = objectFields.get(s).getDescribe();
                if(null!=dr)
                    fieldValue.add(new FieldValues(string.valueof(null==accountObj.get(dr.getName())?'':accountObj.get(dr.getName()))));            
                else
                    fieldValue.add(new FieldValues(string.valueof('')));
            }
            AccountList.add(new ObjectValueMap(accountObj,fieldValue));
        }
        
        return new DynamicTableMapping(headervalue,AccountList);        
    }
      
}



Lightning component
<aura:component controller="ListViewController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:attribute name="AccountListViewList" type="SelectOption[]"/>
    <aura:attribute name="AccountList" type="DynamicTableMapping"/>
    <aura:attribute name="fieldList" type="string[]"/>
    <ui:inputSelect class="slds-select slds-size_small" aura:id="selectedViewId" label="Account View" change="{!c.getFilteredAccount}">
        <aura:iteration items="{!v.AccountListViewList}" var="listview">
            <ui:inputSelectOption text="{!listview.value}" label="{!listview.label}"/>
        </aura:iteration>
    </ui:inputSelect>
   
    <br/><br/>
    
    <table class="slds-table slds-table_bordered slds-table_cell-buffer">
        <thead>
            <tr class="slds-text-title_caps">
                <aura:iteration items="{!v.fieldList}" var="item">
                    <th scope="col">
                        <div class="slds-truncate" title="{!item}">{!item}</div>
                    </th>
                </aura:iteration>
            </tr>
        </thead>
        <tbody>
        <aura:iteration items="{!v.AccountList}" var="item" indexVar="index">
        <tr>
       
            <aura:iteration items="{!item.values}" var="item1">
                <td>
                     {!item1.value}   
                </td></aura:iteration>
        </tr>
        </aura:iteration>
        </tbody>
    </table>
</aura:component>


Component controller JS
({
    doInit : function(component, event, helper){
        var action = component.get("c.getListViews");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.AccountListViewList",response.getReturnValue());
            }
        });
       
        $A.enqueueAction(action);
    },
    getFilteredAccount : function (component, event, helper) {
        var selected = component.find("selectedViewId").get("v.value");
        var action = component.get("c.getFilteredAccounts");
        action.setParams({filterId : selected});
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.AccountList",response.getReturnValue().value);
                component.set("v.fieldList",response.getReturnValue().headervalues);
            }
        });
        
        $A.enqueueAction(action); 
    },
    
})


Helper classes
public class DynamicTableMapping {
    
    @AuraEnabled
    public list<string> headervalues{get;set;}
    @AuraEnabled 
    public list<ObjectValueMap> value{get;set;}
    
    public DynamicTableMapping(list<string> headervalues,list<ObjectValueMap> value){
        this.headervalues=headervalues;
        this.value=value;
    }
}

--- Value map class--

public class ObjectValueMap {
	
    @AuraEnabled
    public account account{get;set;}
    @AuraEnabled
    public list<fieldValues> values{get;set;}
    
    public ObjectValueMap(account acc,list<fieldValues> values){
    	this.account=acc;
        this.values=values;
    }
}

-- Field values class--
public class FieldValues {
	@auraenabled
    public object value{get;set;}
    
    public FieldValues(object value){
        this.value=value;
    }
}

You can modify this code any other object you wish to implement.
Create listview button with the VF page.