• anil Kumar
  • NEWBIE
  • 60 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 1
    Likes Given
  • 49
    Questions
  • 19
    Replies
Hi All,

Lightning Ui namespace is deprecating soon hence we are migrating Ui namespace tags to lightning name space.  We have used below tag to select multi picklist values with Ui namespace. Now salesforce suggesting to use Use lightning:select or lightning:combobox .   

If we use lightning:select or lightning:combobox  not able to select multiple picklist values. Could anyone please help me on this.

I have tried using 
multiple="true"​​​​​​​ in lightning select tag but is not accepting. 

  <ui:inputSelect multiple="true" class="multiple" aura:id="InputSelectMultiple" change="{!c.onMultiSelectChange}">

            <ui:inputSelectOption text="Any"/>
            <ui:inputSelectOption text="Open"/>
            <ui:inputSelectOption text="Closed"/>
            <ui:inputSelectOption text="Closed Won"/>
     </ui:inputSelect>

Thanks,
Anil Kumar
Hi All,

While doing authorize an org i am getting below error. Please help me how to resolve this error.

ERROR running force:auth:web:login:  Cannot read property 'getInstance' of undefined

Thanks,
Anil Kumar 
Hi All,

I have a requirement where i need to save http resonce (JSON) in static resources and later i have to access the file and parse the response and save it in custom object.

Please let me know how to achive this ?

Thanks,
Anil Kumar
Hi All,

I have installed Salesforce CLI and VS code in my machine. When i try to create project  by using  (Ctrl+Shift+P). it shows as Salesforce CLI is not insalled.

below is path of both installations

salesforce CLI : C:\Program Files\Salesforce CLI\bin
VS Code: C:\Users\paka\AppData\Local\Microsoft VS code

User-added image
Hi All,

I have requirement where i need to show notes and attachmntes file (pfd ) of work order object in the lightning component. Could you please help me on this.

Thanks,
Anil Kumar 
 
Hi All,

I have to show child query count in aura:iteration. Could anyone help me how to  show child query count ?

Below is apex controller:

public without sharing class BH_LocationsListClass {
       @AuraEnabled
        public static List<SVMXC__Site__c>  findAll() {
            
            id persAccId; 
            Set<id> BusAcc = new Set<id>();
            set<id> Locid = new set<id>();
            List<id> SiteIds = new List<id>();
            persAccId = [SELECT AccountID FROM User WHERE id = :  UserInfo.getUserId()].AccountID;//0050V0000070hym  UserInfo.getUserId()
            List<Person_Account_Location_Association__c> AsscoBusList = [select BH_Business_Account__c from Person_Account_Location_Association__c where BH_Person_Account_Association__c =:persAccId];
            system.debug('Account ID '+ persAccId);
                    if(AsscoBusList.size()>0){
            for(Person_Account_Location_Association__c mainAcc : AsscoBusList){
                BusAcc.add(mainAcc.BH_Business_Account__c);
            }
        }
        List<SVMXC__Site__c>  SiteList = [select name from SVMXC__Site__c where SVMXC__Account__c in:BusAcc];
        for(SVMXC__Site__c sites :SiteList){
            SiteIds.add(sites.id);
        }
        List<Person_Account_Location_Association__c> AsscolIst = [select BH_Location_Association__c from Person_Account_Location_Association__c where BH_Person_Account_Association__c =:persAccId and BH_Location_Association__c in: SiteIds];
        system.debug('AsscolIst common'+AsscolIst);
        
        if(AsscolIst.size()>0){
            for(Person_Account_Location_Association__c mainAcc : AsscolIst){
                Locid.add(mainAcc.BH_Location_Association__c);
            }
        }
        system.debug('Locid common'+Locid);
            
        List<SVMXC__Site__c>  AssocLocationLocList = [select name,id,BH_Location_Address__c,Superior_Asset_Count__c,
                                                      SVMXC__Account__c,SVMXC__Account__r.name,SVMXC__City__c,
                                                      SVMXC__State__c,SVMXC__Country__c,
                                                      (select id,name,BH_US_SM_Superior_Asset__c from R00N70000001hzcqEAA__r where BH_US_SM_Superior_Asset__c!=null),
                                                      SVMXC__Zip__c from SVMXC__Site__c where id in:Locid];
        system.debug('AssocLocationList common'+AssocLocationLocList);
        String AssetCount;
        for(SVMXC__Site__c acc : AssocLocationLocList){
            AssetCount  = String.valueOf(acc.R00N70000001hzcqEAA.size());
            }
            system.debug('Number of assets '+ AssetCount );
            AssocLocationLocList.sort();
            return AssocLocationLocList; 
            } 
         
}

Thanks,
Anil Kumar 
Hi All,

We have implemented download all the Assest object records in the CSV file based on the button click in the lightning compnent. Now i need show and hide columns and based other column value in the CSV file.

For example if the column A value equals source i need to hide column E and F in the CSV file and column A value not equals source i need to show column E and F in the CSV.

Below is the code which we have used in component JS to dlownload all the records.



  downloadCsvrecords : function(component,event,helper){
        var lstPositions = component.get("v.fullResults");
        console.log('lstPositions=== : '+ lstPositions.length);
        var data = [];
        var headerArray = [];
        var csvContentArray = [];        
        //Fill out the Header of CSV
        //headerArray.push('Installed Product');
        headerArray.push('Product Line');
        headerArray.push('Serial Number');
        headerArray.push('System ID / Asset#'); 
        headerArray.push('Eligibility');
        headerArray.push('Remote Access');
        headerArray.push('Location');
          
        data.push(headerArray);
        
        for(var i=0;i<lstPositions.length;i++){
            
            //Check for records selected by the user
            if(lstPositions[i]){
                console.log('lstPositions.length : '+ lstPositions.length);
                //Initialize the temperory array
                var tempArray = [];
                //use parseInt to perform math operation
                /*tempArray.push('"'+lstPositions[i].Name+'"');*/
                if(lstPositions[i].Product_Line__c === undefined || lstPositions[i].Product_Line__c == null){
                    tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].Product_Line__c+'"');}
                if(lstPositions[i].Serial_Lot_Number__c === undefined || lstPositions[i].Serial_Lot_Number__c == null){
                    tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].SVMXC__Serial_Lot_Number__c+'"');}
                if(lstPositions[i].Asset_Tag__c === undefined || lstPositions[i].Asset_Tag__c == null){
                    tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].SVMXC__Asset_Tag__c+'"');}
                if(lstPositions[i].SM_Eligibility_Status__c === undefined || lstPositions[i].SM_Eligibility_Status__c ==  null){tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].BH_US_SM_Eligibility_Status__c+'"');}
                if(lstPositions[i].SM_VirtualCare_Enabled__c === undefined || lstPositions[i].SM_VirtualCare_Enabled__c == null){tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].SM_VirtualCare_Enabled__c+'"');}    
                if(lstPositions[i].Site__c === undefined || lstPositions[i].Site__c == null){
                    tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].Site__r.Name+'"');}
                             
         
                data.push(tempArray);
            }
            
        }
        console.log('data.length : '+ data.length);
        for(var j=0;j<data.length;j++){
            var dataString = data[j].join(",");
            csvContentArray.push(dataString);
        }
        var csvContent = csvContentArray.join("\n");
        
        
       
        var fileName = "My Assets"; //Generate a file name
        fileName += ".csv";            //this will remove the blank-spaces from the title and replace it with an underscore 
     
        
        if (navigator.msSaveBlob) { // IE 10+
            console.log('----------------if-----------');
            var blob = new Blob([csvContent],{type: "text/csv;charset=utf-8;"});
            console.log('----------------if-----------'+blob);
            navigator.msSaveBlob(blob, fileName);
        }
        else{ 
          var myBlob =  new Blob( [csvContent] , {type: 'text/html'});
         var url = window.URL.createObjectURL(myBlob);
         var a = document.createElement("a");
         document.body.appendChild(a);
         a.href = url;
         a.download = "My Assets.csv";
         a.click();
        //adding some delay in removing the dynamically created link solved the problem in FireFox
         setTimeout(function() {window.URL.revokeObjectURL(url);},0);
            component.set("v.isDownloadcsv",false);
            
        }
 
    }

Thanks,
Anil Kumar 
Hi All,

We have custom navigation bar in lighting community. Onclick of each tab we are navigating to different URLs. How to highlight active tab in custom navigation bar in lightning. Below is my code.

 <nav id="ddmenu" class="ddmenu">
    <ul class="ddmenu_ul" aura:id="mobile_ddmenu_ul">
        <li class="mobile_navbar-brand no-sub" style="display:none;width: 370px;">
        <a class="top-heading" href="{!$Label.c.Home}" onclick="{!c.menuClose}">Home</a>
        </li>

        <li class="no-sub" style="width: 170px;" onclick="{!c.menuClose}" >
            <a class="top-heading" href="{!$Label.c.SalesforceArticles}">Salesforce Articles </a>
        </li>
        <li class="no-sub" style="width: 170px;" onclick="{!c.menuClose}">
            <a class="top-heading" href="{!$Label.c.My_Training}">My Training</a>
        </li>
        <li class="no-sub" style="width: 170px;" onclick="{!c.menuClose}">
            <a class="top-heading" href="{!$Label.c.To_myTeam}">My Team</a>
        </li>
    </ul>
</nav>

Thanks,
Anil Kumar
Hi All,

I want add mouse hover tool tip for the Anchor tag in the lightning component. below is my code. 

<a onclick="{!c.profilePage}">My Profile</a>

i tried with lighting helptext but it is displaying i symble  User-added image  beside My Profile link.
<lightning:helptext content="Cilick on My Profile to see your account details" />

How to show tooltip without i symbol.


Thanks,
Anil Kumar 
We have created process builder (BH_Delete Locations Assocation) on User Approval Object which invokes Approval Process when criteria meet. Below is the condition written in the builder. Process Builder is not invoking Approval process even condition meet. Suppose if we edit User Approval record and Click on Save at that time approval is getting created.

NOT(ISBLANK([BH_User_Approvals__c].Locations__c)) && NOT(ISBLANK([BH_User_Approvals__c].BH_UA_Business_Account__c)) && NOT(ISBLANK([BH_User_Approvals__c].User_Name__c)) && 
NOT(ISBLANK([BH_User_Approvals__c].BH_UA_Person_Account__c)) &&
ISPICKVAL([BH_User_Approvals__c].Location_Delete__c, 'Yes') &&   [BH_User_Approvals__c].BH_Approval_Ready__c = True

In the code level we are creating the user approval records for the approval purpose.

User-added image
Hi All,

We have few web service call outs from salesforce community portal to external system. External system has been upgraded to TLS 1.2 protocol. Now they wants us to upgrade to LS 1.2 protocol version. Kidly help me how to upgrade TLS 1.2 version in salesforce?

Thanks,
Anil Kumar
Hi All,

We have ServiceMax managed package custom object  in our org. We have found thousands of records have been deleted and they were available in recycle bin. We are able see user id of deleted records. But how to Find out how the records were deleted. We have verified the code trigger and batch classes in could not found delete operation in that. How to find how the records were deleted?

Thanks,
Anil Kumar
Hi All,

We have several reports which exclude Specialists by using a filter that has the names hard-coded. Finding these reports has proven difficult. Is there any way to query the reports to see which reports filter on Technician Name? Or search wherever "John Jason" is used as a filter? There has to be an easier way than looking through the hundreds of reports out there.

Thanks,
Anil Kumar
Hi All,

We have converted Managed package application to unmanged package application to one of our client. We have Visualforce Component it is mentioned in Visualforce page with namespace like **<MTS_retail:fastGrid componentId="gridRoutes" />**. It was working find when application was Managed package.

While converting Managed package application to Unmanged package application we have removed namespace in the visualforce component and mention it as **<C:fastGrid componentId="gridRoutes" />** since Unmanged package application was not accepting namespace. Now Visualforce Component logic is not working in the visualforce page. 

Thanks,
Anil Kumar
Hi All,

We have converted Managed package application to unmanged package application to one of our client. We have Visualforce Component it is mentioned in Visualforce page with namespace like **<MTS_retail:fastGrid componentId="gridRoutes" />**. It was working find when application was Managed package.

While converting Managed package application to Unmanged package application we have removed namespace in the visualforce component and mention it as **<C:fastGrid componentId="gridRoutes" />** since Unmanged package application was not accepting namespace. Now Visualforce Component logic is not working in the visualforce page. Please do the needful.

Thanks,
Anil Kumar
Hi All,

We have implemented customer portal for one of our customer where they uses ServiceMax managed package, while creating user we assign ServiceMax licence to the user so that they can access ServiceMax objects. For the few user ServiceMax licence is getting disabled after some time without any intervention.

We have raised case to salesforce and ServiceMax support team, they were not able to trace how the ServiceMax licence is getting disabled. 

Is there anyway how to find ServiceMax users those who are assined to ServiceMax licence in the organisation so that we can keep a count of the user to identify the missing  ServiceMax licence users

Thanks,
Anil Kumar 
Hi All,

I have case record which has been created by sys admin, in the case record user A has created task and it is assigned to User B. Now user A trying to edit the task record which he has been created. user A is getting error message as Insufficient privileges.

OWD sharing on Activities object has been set for private. if i change this to Controlled by parent user A able to edit the record. 

Is there any possibility without changing OWD sharing, can we give edit permission to user A.

Thanks,
Anil Kumar
Hi All,

I have requirement where i need schedule batch job 4 times in day. this are the timinings 1AM EST, 10 AM EST, 3PM EST, 8PM EST. I have schedule this using cron expression in dev console. i have prepared script below, please advise is this correct.


className c = new className();
String sch = '0 0 1,10,15,20 * * *';
system.schedule('Four times in day ', sch, c);

Thanks,
Anil Kumar
Hi All,

I want to parse pipe delimiter .txt file in apex class and save the data into custum objects. Pipe delimitertext file i am getting from other application. Below is sample file. Please help to parse this file.

|BILLDATA|RCB|3517|SUM|11022017|61113
RecordType|ReferenceNumber|OtherData|dtStatement|dtDue|BillerInvoiceNo|NameFirst|MiddleName|NameLast|CompanyName|Address|Address2|City|State|Zip|Phone|Fax

Thanks,
Anil Kumar 
Hi All,

I have requirement where i need navigate multiple visulaforce pages by clicking on save&next buttons on the page. Also i need to notify the user on the top of the page with bigger buttonns which page user is residing like page one, page two exc...
How to achive this in visualforce with out using bootstrap breadcrumbs?

User-added image
Thanks,
Anil Kumar
Hi All,

We have few web service call outs from salesforce community portal to external system. External system has been upgraded to TLS 1.2 protocol. Now they wants us to upgrade to LS 1.2 protocol version. Kidly help me how to upgrade TLS 1.2 version in salesforce?

Thanks,
Anil Kumar
Hi All,

How to Retrieve List of all available apex class and Visualforce page which are not from managed pacakage.

Thanks,
Anil Kumar 
Hi All,

I have VF page, where i have added that page in salesforce sites to acess that VF page for the for the external user. Now my problem is user is able to access my VF page without authentication. Salesforce is not asking any authentication.

I have tried by removing my page acess following below mentioned steps but external user is not able to access VF page. User is getting insufficiant privilege error message.

Go to Setup -> Communities -> All Communities -> click Manage -> Administration -> Pages -> Go to force.com -> Click on public access settings.

Can anyone advise me how to access Salesforce site VF page with authentication

Thanks,

Regards,
Anil Kumar

 
Hi All,

I have requirement where i need to show notes and attachmntes file (pfd ) of work order object in the lightning component. Could you please help me on this.

Thanks,
Anil Kumar 
 
Hi All,

I want add mouse hover tool tip for the Anchor tag in the lightning component. below is my code. 

<a onclick="{!c.profilePage}">My Profile</a>

i tried with lighting helptext but it is displaying i symble  User-added image  beside My Profile link.
<lightning:helptext content="Cilick on My Profile to see your account details" />

How to show tooltip without i symbol.


Thanks,
Anil Kumar 
We have created process builder (BH_Delete Locations Assocation) on User Approval Object which invokes Approval Process when criteria meet. Below is the condition written in the builder. Process Builder is not invoking Approval process even condition meet. Suppose if we edit User Approval record and Click on Save at that time approval is getting created.

NOT(ISBLANK([BH_User_Approvals__c].Locations__c)) && NOT(ISBLANK([BH_User_Approvals__c].BH_UA_Business_Account__c)) && NOT(ISBLANK([BH_User_Approvals__c].User_Name__c)) && 
NOT(ISBLANK([BH_User_Approvals__c].BH_UA_Person_Account__c)) &&
ISPICKVAL([BH_User_Approvals__c].Location_Delete__c, 'Yes') &&   [BH_User_Approvals__c].BH_Approval_Ready__c = True

In the code level we are creating the user approval records for the approval purpose.

User-added image
Hi All,

We have few web service call outs from salesforce community portal to external system. External system has been upgraded to TLS 1.2 protocol. Now they wants us to upgrade to LS 1.2 protocol version. Kidly help me how to upgrade TLS 1.2 version in salesforce?

Thanks,
Anil Kumar
Hi All,

I have requirement where i need schedule batch job 4 times in day. this are the timinings 1AM EST, 10 AM EST, 3PM EST, 8PM EST. I have schedule this using cron expression in dev console. i have prepared script below, please advise is this correct.


className c = new className();
String sch = '0 0 1,10,15,20 * * *';
system.schedule('Four times in day ', sch, c);

Thanks,
Anil Kumar
Hi All,

Can anyone help me i am getting below error in the visualforce page, i am displaying 12 dependent picklist in the pageblock section.

Visualforce pages may not display more than 10 dependent picklists together with their controlling fields

Thanks,
Anil Kumar 
Hi All,

I am trying to change pageblock color using javascript. it is not getting changed getting error colorPageBlock is not defined in the console. please advise.

<script>
function colorPageBlock(pageblock, color) {
if (pageblock != null) pageblock.firstChild.style.cssText = “background-color: ” + color + “;”;

}
</script>


<apex:pageBlockSection id = "pbc" title="SELECT INFORMATION">

<apex:inputField value="{!Opportunity.LSS1__c}"/><br/>
<apex:inputField value="{!Opportunity.LSS2__c}"/><br/>
<apex:inputField value="{!Opportunity.LSS3__c}"/>

<script>colorPageBlock(document.getElementById("{!$Component.pbc}"), "red");</script>
</apex:pageBlockSection> 

Thanks,
Anil Kumar
Hi All,
I would like to prepare Dynamic JSON Body on the below mentioned format.
{
                "MyData": [{
                                "id": "SFDC-Contact1",
                                "name": "SFDC-Contact",
                                "description": "Contact Details",
                                "Popularity": "Public",
                                "dataTypes": [{
                                                "name": "Id",
                                                "description": "ID of Contact",
                                }, {
                                                "name": "Name",
                                                "description": "Complete name of Contact"
                                }],
                                "FCLR": null,
                                "DMS": null
                }]
}

I have used json string generator for a POST request body from salesforce to a third party.

list<FieldDefinition> sct = [SELECT DeveloperName,DataType,Label,LastModifiedDate FROM FieldDefinition WHERE EntityDefinition.DeveloperName = 'Contact'];

system.debug('=============='+sct.size() );

JSONGenerator gen = JSON.createGenerator(true);

  gen.writeStartObject();
  gen.writeFieldName('MyData');
  
  gen.writeStartObject();
  
  gen.writeStringField('id', 'SFDC-Contact1');
  gen.writeStringField('name', 'SFDC-Contact');
  gen.writeEndObject();
  gen.writeEndObject();
  gen.writeStartObject();

  gen.writeFieldName('dataTypes');
  gen.writeStartArray();
 
     for (FieldDefinition s: sct ){
        gen.writeStartObject();
        gen.writeStringField('name', s.Label);
  
        gen.writeStringField('description', 'ID of Contact');
        gen.writeEndObject();
      }         

gen.writeEndArray();

gen.writeEndObject();

String pretty = gen.getAsString();
system.debug('=============='+pretty );

Below is JSON body i am getting. Please advise.
{
  " MyData " : {
    "id" : "SFDC-Contact1",
    "name" : "SFDC-Contact"
  }
} {
  "dataTypes" : [ {
    "name" : "Contact ID",
    "description" : "ID of Contact"
  }, {
    "name" : "Deleted",
    "description" : "ID of Contact"
  } ]
}
Hi All,

I want prepare JSON body dynamically for all the contact fields with mask values, i have queried all the contact fileds dynamically assiged to list now i have to prepare JSON body for the fields with mask values. 
For example contact name is Anil it should returm like "Name":"True",contact Phone is null it should returm like "Phone":"False"

How to achive this in apex.

Thanks,
Anil Kumar 
Hi All,

I have VF page, where i have added that page in salesforce sites to acess that VF page for the for the external user. Now my problem is user is able to access my VF page without authentication. Salesforce is not asking any authentication.

I have tried by removing my page acess following below mentioned steps but external user is not able to access VF page. User is getting insufficiant privilege error message.

Go to Setup -> Communities -> All Communities -> click Manage -> Administration -> Pages -> Go to force.com -> Click on public access settings.

Can anyone advise me how to access Salesforce site VF page with authentication

Thanks,

Regards,
Anil Kumar

 
Hi Friends,

I have a requirement with 2 record types
when i choose X record type it should display opportunity standard page 
when i choose Y record type it should display VF Page with opportunity mandatory fields  

unable to do this , can any one help on this

Thanks
Hi,

Can any one help me how to write vaidation rule for date field where user should enter only future date not current(todays)

Thanks,
Regards,
​Anil Kumar
Hi,

Can we edit apex calss in production? if i want to make changes to apex calss after deployment what is the process?

Thanks,
Regards,
Anil Kumar
Hi,

What is standardset controller and where we use standardset controller?

Regards,

Anil Kumar
Hi,

Can anyone please explain what is the view state in visualforce page?

Regards,

Anil Kumar
Hi,

I have scenario that update a custom field(Amount__C) of parent(Account) with sum of all child records (Total_Price) from Child Object(Invoice Line Item).

I have to wirte a trigger for above scenario, if any one have sample code please share it.

Thanks in advance,
Shaik
  • December 21, 2014
  • Like
  • 1