• VSK98
  • NEWBIE
  • 269 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 218
    Questions
  • 125
    Replies
Hello All,

I have a requirement like this, 

As of now, we are displaying Text(String) and the Biz wants to convert into the Lookup. The Data we getting from third-party DB, not from Salesforce. Is it Possible?

Regards,
VSK98
  • June 03, 2019
  • Like
  • 0
Hello All,

I am trying to insert account record on ONLOAD of the page with dynamic Lightning:recordEditForm but i could n't able to crack it. Could you please guide me where i did mistake.

Snippet:
 
init: function(component, event, helper) {
        // First, create children
        $A.createComponents([
            ["lightning:inputField", { fieldName: "Name", value: "Test"}],
            ["lightning:inputField", { fieldName: "Industry", value: "Test" }]
        ], (components, status, errors) => {
            // Then parent, specifying body of lightning:inputFields
            $A.createComponents(
            [["lightning:recordEditForm", { objectApiName: "Account", body: components }]], 
                            (components, status, errors) => {
         
            component.set("v.recordEdit", components); // i can able to view the fields on UI
            console.log('#####'+JSON.stringify(components));
            component.find("createAccountForm").submit();
             //var payload = event.getParams().response;
       // console.log('#####'+JSON.stringify(payload));
                                
                            });
        });
    }

Regards,
VSK98
  • May 10, 2019
  • Like
  • 0
Hello All,

How to create the dynamic Lightning Data service component when clicking on the button.

Regards,
VSK98
 
  • May 08, 2019
  • Like
  • 0
Hello All,

How to insert the account record in catch block in JS controller without calling Apex.

Adv thanks,

Regards,
VSK98
  • May 08, 2019
  • Like
  • 0
Hello All,

I am getting a FATAL ERROR while deploying the custom metadata component... Please suggest me on the same

Adv thanks...

Regards,
VSK98
 
  • April 11, 2019
  • Like
  • 0
Hi All,

I am using custom metadata type in Apex class. I am trying to insert the custom metadata type like custom object but I am getting an error. the fields are not editable. 

In Apex Class:
Roles__mdt roles = [SELECT id,Name from Roles__mdt where Name__c = 'xxxx' AND Isactive__c = true]

Adv thanks,
VSK98
  • March 27, 2019
  • Like
  • 0
Hello All,

I would like to display the Nested columns in a single column in lightning Datatable/TreeGrid... Pls refer the screenshot below.

User-added image

Regards,
VSk98
  • March 21, 2019
  • Like
  • 0
Hello All,
How to disable the Help& Training, Support & Global Actions etc using Profiles in lightning?
User-added image
Regards,
VSK98
  • March 18, 2019
  • Like
  • 0
Hello All,

I have created the Profile & disabled all EDIT/READ permission in profile. But the lightning user can label to view the Email Template Object.
User-added imagePlease let me know how to fix the issue.

Adv thanks,
Regards,
VSK98
  • March 18, 2019
  • Like
  • 0
Hi All,

Getting the error after user loggedin into Salesforce via lightning. 

Error:
Failed to initialize a component [Expected ';']
I have kept debugging particular user.
02:49:59.16 (16402720)|CUMULATIVE_LIMIT_USAGE_END

02:49:59.0 (16549420)|CODE_UNIT_FINISHED|MTS_callGroupCustomers.fetchUser()
02:49:59.0 (16690971)|CODE_UNIT_FINISHED|Aura
02:49:59.0 (18404546)|EXECUTION_FINISHED
02:49:59.30 (30371394)|CUMULATIVE_PROFILING_BEGIN
02:49:59.30 (30371394)|CUMULATIVE_PROFILING|SOQL operations|
Class.MTS_callGroupCustomers.fetchUser: line 22, column 1: [select id,Name,Username,Alias,Country,Email,FirstName,LastName,IsActive 
                      FROM User Where id =: userInfo.getUserId() limit 1]: executed 1 time in 12 ms

02:49:59.30 (30371394)|CUMULATIVE_PROFILING|No profiling information for SOSL operations
02:49:59.30 (30371394)|CUMULATIVE_PROFILING|No profiling information for DML operations
02:49:59.30 (30371394)|CUMULATIVE_PROFILING|method invocations|
External entry point: public static User fetchUser(): executed 1 time in 14 ms
Class.MTS_callGroupCustomers.fetchUser: line 23, column 1: global static String getUserId(): executed 1 time in 0 ms

02:49:59.30 (30371394)|CUMULATIVE_PROFILING_END

Apex class:
 
@AuraEnabled 
    public Static user fetchUser(){
  
        // query current user information  
        User oUser = [select id,Name,Email,IsActive 
                      FROM User Where id =: userInfo.getUserId() limit 1];
               
        return oUser;
    }

Regards,
VSK98​​​​​​​ 
 
  • March 14, 2019
  • Like
  • 0
Hi All,

I have implemented the Custom Breadcrumb in VF Page with Styles but I am getting the ERROR.

ERROR:
Error: Custom_Breadscrumb line 38, column 20: The reference to entity ":after" must end with the ';' delimiter	
Error	Error: The reference to entity ":after" must end with the ';' delimiter.

VF Page:
<apex:page >

<style type="text/css">
       $crumbs-back:#F3F5FA;
$text-color:#8093A7;


body {
    margin: 100px auto;
    font-family: Helvetica;
    background: #FFF;
}

#crumbs {
    text-align: center;
   
ul {
        list-style: none;
        display: inline-table;
        li {
            display: inline;
            
            a {
            display: block;
            float: left;
            height: 50px;
            background: #F3F5FA;
        
            text-align: center;
            padding: 30px 20px 0 60px;
            position: relative;
            margin: 0 10px 0 0; 
            
            font-size: 20px;
            text-decoration: none;
            color: $text-color;
        
            &:after {
                content: "";  
                border-top: 40px solid transparent;
                border-bottom: 40px solid transparent;
                border-left: 40px solid #F3F5FA;
                position: absolute; 
                right: -40px;
                top: 0;
                z-index: 1;
            }
            &:before {
                content: "";  
                border-top: 40px solid transparent;
                border-bottom: 40px solid transparent;
                border-left: 40px solid #fff;
                position: absolute; 
                left: 0; 
                top: 0;
            } 
            
        }
        }
    }
}




        
    
                #crumbs ul li:first-child a {
                    border-top-left-radius: 10px; border-bottom-left-radius: 10px;
                }
                #crumbs ul li:first-child a:before {
                    display: none; 
                }
                
                #crumbs ul li:last-child a {
                    padding-right: 40px;
                    border-top-right-radius: 10px; border-bottom-right-radius: 10px;
                }
                #crumbs ul li:last-child a:after {
                    display: none; 
                }
            
            #crumbs ul li a:hover {
                background: #357DFD;
        color:#fff;
            }
                #crumbs ul li a:hover:after {
                    border-left-color: #357DFD;
           color:#fff;
                }
        
    </style>
 <div id="crumbs">
  <h1>Breadcrumbs</h1>
    <ul>
        <li><a href="#1" ><i class="fa fa-home" aria-hidden="true"></i></a></li>
        <li><a href="#2" ><i class="fa fa-shopping-bag" aria-hidden="true"></i> Shop</a></li>
        <li><a href="#3" ><i class="fa fa-cart-plus" aria-hidden="true"></i> Cart</a></li>
        <li><a href="#4" ><i class="fa fa-credit-card-alt" aria-hidden="true"></i> Checkout</a></li>
        
    </ul>
</div>
</apex:page>

Adv Thanks,
VSK98
  • March 07, 2019
  • Like
  • 0
Hi All,

I am using Open source alasql library, there I can download the multiple worksheets from vf page. Now I want to add colors to the columns.
                 Av thanks.......
Regards,
VSK98
  • February 14, 2019
  • Like
  • 0
Hi All,

I have a requirement like to download multiple worksheets in a single excel from the client side. 

I can able to download the multiple worksheets but the data is falling in the Active Sheet, not in other sheets.

Snippet Code:
   var template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet><x:ExcelWorksheet><x:Name>{worksheet1}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet><x:ExcelWorksheet><x:Name>TCO_1</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet><x:ExcelWorksheet><x:Name>TCO_2</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head>{table}{table1}</html>

Could anybody pls help me on this.

Regards,
VSK98

 
  • February 13, 2019
  • Like
  • 0
Hi All,

I am trying to download the multiple workbooks in lightning but it is not working. 
Snippet code:
<aura:application >
   
	<table id="tbl1" class="table2excel">
                    <tr>
                        <td>Product</td>
                        <td>Price</td>
                        <td>Available</td>
                        <td>Count</td>
                    </tr>
                    <tr>
                        <td>Bred</td>
                        <td>1
</td>
                        <td>2
</td>
                        <td>3
</td>
                    </tr>
                    <tr>
                        <td>Butter</td>
                        <td>4
</td>
                        <td>5
</td>
                        <td >6
</td>
                    </tr>
                </table>
    <hr></hr>
  
  <table id="tbl2" class="table2excel">
                    <tr>
                        <td>Product</td>
                        <td>Price</td>
                        <td>Available</td>
                        <td>Count</td>
                    </tr>
                    <tr>
                        <td>Bred</td>
                        <td>7
</td>
                        <td>8
</td>
                        <td>9
</td>
                    </tr>
                    <tr>
                        <td>Butter</td>
                        <td>14
</td>
                        <td>15
</td>
                        <td >16
</td>
                    </tr>
                </table>

<lightning:button label="Hit" onclick="{!c.tablesToExcel}"/>
<!--<button  onclick="tablesToExcel(['tbl1','tbl2'], ['ProductDay1','ProductDay2'], 'TestBook.xls', 'Excel')">Export to Excel</button>-->
</aura:application>
 
({
	tablesToExcel : function(component, event, helper) {
		
	
    var tmplWorkbookXML = '<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Author>Axel Richter</Author><Created>{created}</Created></DocumentProperties><Styles><Style ss:ID="Currency"><NumberFormat ss:Format="Currency"></NumberFormat></Style><Style ss:ID="Date"><NumberFormat ss:Format="Medium Date"></NumberFormat></Style></Styles>{worksheets}</Workbook>';
        console.log('@@@@@');
    var tmplWorksheetXML = '<Worksheet ss:Name="{nameWS}"><Table>{rows}</Table></Worksheet>';
    var tmplCellXML = '<Cell{attributeStyleID}{attributeFormula}><Data ss:Type="{nameType}">{data}</Data></Cell>';
    console.log('@@@@@');
        var base64 = function(s) {
        console.log('base64'); 
       return window.btoa(unescape(encodeURIComponent(s))) 
    };
        
   var format = function(s, c) {
       console.log('format'); 
       return s.replace(/{(\w+)}/g, function(m, p) { 
           return c[p]; 
       }) 
   };
        var tables = document.createElement("table");
        var table1 = document.createElement("table");
    //return function(tables, wsnames, wbname, appname) {
      var ctx = "";
      var workbookXML = "";
      var worksheetsXML = "";
      var rowsXML = "";
	console.log('###!!@');
      for (var i = 0; i < 2; i++) {
         
        if (!tables[i].nodeType) tables[i] = document.getElementById(tables[i]);
        for (var j = 0; j < tables[i].rows.length; j++) {
          rowsXML += '<Row>'
          for (var k = 0; k < tables[i].rows[j].cells.length; k++) {
            var dataType = tables[i].rows[j].cells[k].getAttribute("data-type");
            var dataStyle = tables[i].rows[j].cells[k].getAttribute("data-style");
            var dataValue = tables[i].rows[j].cells[k].getAttribute("data-value");
            dataValue = (dataValue)?dataValue:tables[i].rows[j].cells[k].innerHTML;
            var dataFormula = tables[i].rows[j].cells[k].getAttribute("data-formula");
            dataFormula = (dataFormula)?dataFormula:(appname=='Calc' && dataType=='DateTime')?dataValue:null;
            ctx = {  attributeStyleID: (dataStyle=='Currency' || dataStyle=='Date')?' ss:StyleID="'+dataStyle+'"':''
                   , nameType: (dataType=='Number' || dataType=='DateTime' || dataType=='Boolean' || dataType=='Error')?dataType:'String'
                   , data: (dataFormula)?'':dataValue
                   , attributeFormula: (dataFormula)?' ss:Formula="'+dataFormula+'"':''
                  };
            rowsXML += format(tmplCellXML, ctx);
          }
          rowsXML += '</Row>'
        }
        ctx = {rows: rowsXML, nameWS: wsnames[i] || 'Sheet' + i};
        worksheetsXML += format(tmplWorksheetXML, ctx);
        rowsXML = "";
      }

      ctx = {created: (new Date()).getTime(), worksheets: worksheetsXML};
      workbookXML = format(tmplWorkbookXML, ctx);

console.log(workbookXML);

      var link = document.createElement("A");
      link.href = uri + base64(workbookXML);
      link.download = wbname || 'Workbook.xls';
      link.target = '_blank';
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
    }
 
   // }
})

 
  • February 05, 2019
  • Like
  • 0
Hello All,

I am working on download multiple sheets from the client side in lightning. But the second sheet coming up with null instead of values.

Snippet code: 
var template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet><x:ExcelWorksheet>x:Name>{sample}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheets><x:ActiveSheet>0</x:ActiveSheet></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body><body><table><tr><th>test</th></tr></table></body></html>';

Adv thanks,
VSK98
  • February 05, 2019
  • Like
  • 0
Hello All,

I am able to download the excel sheet but it contains only one worksheet and I need to add one more worksheet to the existing excel sheet. 

Snippet code:
var uri = 'data:application/vnd.ms-excel;base64,';
            var template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'; 
            var base64 = function(s) {
                return window.btoa(unescape(encodeURIComponent(s)))
            }; 
                    
             var format = function(s, c) {
                return s.replace(/{(\w+)}/g, function(m, p) {
                    return c[p];
                })
            };

           var htmls = "YOUR HTML AS TABLE";
               
            var ctx = {
                worksheet : 'Worksheet',
                table : htmls 
            }
            
            
            var link = document.createElement("a");
            link.download = "export.xls";
            link.href = uri + base64(format(template, ctx));
            link.target = '_self';        
            link.click()

Adv thanks,
VSK98 
  • January 29, 2019
  • Like
  • 0
Hi All,

I am displaying the list of records with tree structure using TREEGRID tag in lightning. When the user selects the parent record using a checkbox, I able to get the parent record details in JS controller but I didn't get child records.
Component:

<lightning:treeGrid  data="{!v.PaginationList}" columns="{!v.tablecolumns}" keyField="group_name"   resizeColumnDisabled="false" onrowaction="{! c.handleRowAction }" onrowselection = "{!c.getSelectedName}"/>
 
JS Controller:

getSelectedName: function(cmp, event, helper) {
    var selectedRows = event.getParam('selectedRows');

                              var name1 = '';
				var city1 = '';
				var street1= '';
				var country1= '';
				var CustomerId1 = '';
				var Assetcnt1 = '';
				var children1 = [];
    for (var i = 0; i < selectedRows.length; i++){
     
        name1 = selectedRows[i].group_name;
               city1 = selectedRows[i].City;
               street1 = selectedRows[i].Street;
               country1 = selectedRows[i].Country;	
               Assetcnt1 = selectedRows[i].Assetcnt;
               CustomerId1 = selectedRows[i].CustomerId;
               children1 = selectedRows[i]._children;           // getting undefined
}

As per my knowledge, the user didn't select the child records from UI, that why I couldn't get it. 

IS IT POSSIBLE  TO GET THE CHILD RECORDS WHEN THE USER SELECT THE  PARENT RECORD FROM UI.

Adv Thanks......


Regards,
VSK98
 
  • January 10, 2019
  • Like
  • 0
<aura:method name="myMethod" action="{!c.executeMyMethod}">
     	<aura:attribute name="Cname" type="string" default="test"/> 
        <aura:attribute name="city" type="string" /> 
         <aura:attribute name="Assetcnt" type="string" />
         <aura:attribute name="CustomerId" type="string" />
         <aura:attribute name="children" type="list" />
         </aura:method>

Hi All,

I have created the Aura: Method tag, under I declared few attributes with default values. When i am trying to access the attributes with their name getting UNDEFINED values.

Aura: Method
<aura:method name="myMethod" action="{!c.executeMyMethod}">
     	<aura:attribute name="Cname" type="string" default="test"/> 
        <aura:attribute name="city" type="string" /> 
         <aura:attribute name="Assetcnt" type="string" />
         <aura:attribute name="CustomerId" type="string" />
         <aura:attribute name="children" type="list" />
         </aura:method>

JS Controller:
executeMyMethod : function(component, event, helper) {
         console.log('Beforeset: '+ component.get("v.myMethod"));  --- Undefined
          console.log('Beforeset: '+ component.get("v.Cname")); --- Undefined
         console.log('Beforeset: '+ component.get("v.myMethod.Cname")); --- Undefined
}

Regards,
VSK98​​​​​​​

 
  • December 20, 2018
  • Like
  • 0
Hi All,

I have two components (Parent & child) & I am passing some parameters from Parent to Child using Aura method. I can able to retrieve the parameters to Child also. But I couldn't able to bind the parameter value to the child attribute. 

Screenshot:User-added image

Code:
executeMyMethod : function(component, event, helper) {
        
        var params = event.getParam('arguments');
         console.log('name: '+ params.name); -- Getting values
         console.log('city: '+ params.city);
          console.log('Assetcnt: '+ params.Assetcnt);
          console.log('CustomerId: '+ params.CustomerId);
          console.log('children: '+ params.children);
        component.set("v.name",params.name);
          alert(component.set("v.name",params.name));-------Undefined
Could you please help me out.

Regards,
VSK98

 
  • December 19, 2018
  • Like
  • 0
Hi All,

I am displaying the Account & Contacts records with a tree structure. Account & Contact names have a hyperlink when the user click on parent /Account Name how to get child records from LIghtning:treegrid. 

Not required with checkboxes............

Anybody have Onrowaction examples in lightning:treegrid please provide the same.

Regards,
VSK98
 
  • December 13, 2018
  • Like
  • 0
Hi All,

I have Created sample Visual Flow and calling from Custom button. The logic is jsut creating Account Records. And I have a workflow when ever Account is created, updating the field in Account.

So when ever i ran the flow from button after the submitting the flow. I got the above error.
So i deactivated the workflow then the flow works fine. Can any one know why this is happened. Please help me out.

Error :
 
Flow Details
Flow Name: Sample_Account_Create
Type: Flow
Version: 1
Status: Inactive
Flow Interview Details
Interview Label: Sample Account Create 27/7/2016 7:35 PM
Current User: siva kumar (00590000003L0bm)
Start time: 27/7/2016 7:35 PM
Duration: 18 seconds
How the Interview Started
siva kumar (00590000003L0bm) started the flow interview.
SCREEN: Submit_Account_Details
Textbox: Account_Name
Label: Account Name
Value at run time: TestFlowRecord1

Number: Fax
Label: Fax
Value at run time: 554,646

Long Text Area: Description
Label: Description
Value at run time: 

Selected Navigation Button: NEXT
RECORD CREATE: Create_Record
Create one Account record where:
Description = {!Description} ()
Fax = {!Fax} (554,646)
Name = {!Account_Name} (TestFlowRecord1)
Result
Failed to create record.


Regards,
VSK
  • July 27, 2016
  • Like
  • 1
Hi,

i have one SOQL query like 
SELECT id FROM businesshours WHERE Name = 'UK'
Is it possible to get using dynamic apex...........................

Adv Thnx
VSK
  • April 25, 2016
  • Like
  • 1
Hi All,

Is it possible to run the scheduler class every one minute.............Because my req comes like only


Notifications need to send every 1 hr,2 hrs , 3 hr & 4 hrs
The record might be created at every minute in a hour.....
 
  • March 15, 2016
  • Like
  • 1
Hi,

I am new to Angular js.......i have been building new vf page with angular page ..Facing to not getting output 

Here is my Page

<apex:page applyHtmlTag="false" sidebar="false" showHeader="false">
 <apex:form>
  <apex:includescript value= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"/>

 <body>
  <script>
   angular.module('app',[]);
   .controller('Basic Controller', function()){
       this.name ="siva";
   
   }
   this.Hello: = function Hello:(){
   
   return this.name}
  </script>
   
   <div ng-app="app" ng-controller="Basic Controller">
   <p>Type the Your Name: </p>
   <p>Name: <input type="text" ng-model="name" placeholder="Enter your name"/></p>
       Hello: {{name}} 
   </div>
  </body>
   
</apex:form>
</apex:page>

Here am not getting my name as siva in Hello: siva

User-added image
  • October 20, 2015
  • Like
  • 1
Hello All,
How to disable the Help& Training, Support & Global Actions etc using Profiles in lightning?
User-added image
Regards,
VSK98
  • March 18, 2019
  • Like
  • 0
Hello All,

I have created the Profile & disabled all EDIT/READ permission in profile. But the lightning user can label to view the Email Template Object.
User-added imagePlease let me know how to fix the issue.

Adv thanks,
Regards,
VSK98
  • March 18, 2019
  • Like
  • 0
<aura:method name="myMethod" action="{!c.executeMyMethod}">
     	<aura:attribute name="Cname" type="string" default="test"/> 
        <aura:attribute name="city" type="string" /> 
         <aura:attribute name="Assetcnt" type="string" />
         <aura:attribute name="CustomerId" type="string" />
         <aura:attribute name="children" type="list" />
         </aura:method>

Hi All,

I have created the Aura: Method tag, under I declared few attributes with default values. When i am trying to access the attributes with their name getting UNDEFINED values.

Aura: Method
<aura:method name="myMethod" action="{!c.executeMyMethod}">
     	<aura:attribute name="Cname" type="string" default="test"/> 
        <aura:attribute name="city" type="string" /> 
         <aura:attribute name="Assetcnt" type="string" />
         <aura:attribute name="CustomerId" type="string" />
         <aura:attribute name="children" type="list" />
         </aura:method>

JS Controller:
executeMyMethod : function(component, event, helper) {
         console.log('Beforeset: '+ component.get("v.myMethod"));  --- Undefined
          console.log('Beforeset: '+ component.get("v.Cname")); --- Undefined
         console.log('Beforeset: '+ component.get("v.myMethod.Cname")); --- Undefined
}

Regards,
VSK98​​​​​​​

 
  • December 20, 2018
  • Like
  • 0
Hi All,

I am getting the error when I run the test class.
System.JSONException: Unexpected character ('C' (code 67)): was expecting comma to separate OBJECT entries

I have created the mock class, in that I am sending the body as below.
 
res.setBody('{"value": [{'+
        '"groupid": 1,'+
       '"group_name": "Test",'+
        '"sub_customer": "[{\"CustomerId\":\"9488491\",\"CustomerName\":\"Test\",\"Street\":\"Test\",\"City\":\"PENRITH\",\"PostalCode\":\"275\",\"Country\":\"Test\",\"Assetcnt\":\"6\"}]"}]}');

I am getting the error in Apex class
SearchResult obj=(SearchResult)JSON.deserialize(resp.getBody(), SearchResult.class);

Wrapper class :
 
Public class value{
        
        @AuraEnabled
        public Integer groupid {get; set;}
        @AuraEnabled
        public string group_name {get; set;}
        @AuraEnabled
        public String sub_customer {get; set;}
        
        
    }
    
    public class SearchResult {
        @AuraEnabled
        public List<value> value;
        
        public SearchResult(List<value> liList) {
            value = liList.clone();
        }
    } 
    
    Public class Value_out{
        @AuraEnabled
        public string group_name;
        @AuraEnabled
        public string groupid;
        //srini-added for parent level sum of assets
         @AuraEnabled
        public String sumofAssets;
        @AuraEnabled
        public list<sub_customer> children;
    }
    public class sub_customer{
        @AuraEnabled
        public string CustomerName;
        @AuraEnabled
        public string CustomerId;
        @AuraEnabled
        public string Street;
        @AuraEnabled
        public string City;
        @AuraEnabled
        public string PostalCode;
        @AuraEnabled
        public string Country;
        @AuraEnabled
        public string Assetcnt;
    }

Regards,
VSK98​​​​​​​
 
  • December 12, 2018
  • Like
  • 0
Hi All,

How to convert the below response into custom response using JSON
{
	"groupid": null,
	"group_name": null,
	"children": [{
		"Street": "PRINCES HIGHWAY",
		"PostalCode": "2538",
		"CustomerName": "MILTON ULLADULLA HOSPITAL",
		"CustomerId": "94107804",
		"Country": "Australia",
		"City": "MILTON",
		"Assetcnt": "0"
	}, {
		"Street": "COWPER STREET",
		"PostalCode": "2502",
		"CustomerName": "PORT KEMBLA HOSPITAL",
		"CustomerId": "94105686",
		"Country": "Australia",
		"City": "WARRAWONG",
		"Assetcnt": "0"
	}, {
		"Street": "Great Western Highway",
		"PostalCode": "2790",
		"CustomerName": "THE NEW LITHGOW HOSPITAL",
		"CustomerId": "94107702",
		"Country": "Australia",
		"City": "LITHGOW",
		"Assetcnt": "0"
	}, {
		"Street": "Shoalhaven Road",
		"PostalCode": "2540",
		"CustomerName": "SHOALHAVEN DISTRICT MEMORIAL HOSPIT",
		"CustomerId": "9487942",
		"Country": "Australia",
		"City": "NOWRA",
		"Assetcnt": "0"
	}]
	
}

IF Groupid== null then I have to remove those fields and the expected response is below
"children": [{
		"Street": "PRINCES HIGHWAY",
		"PostalCode": "2538",
		"CustomerName": "MILTON ULLADULLA HOSPITAL",
		"CustomerId": "94107804",
		"Country": "Australia",
		"City": "MILTON",
		"Assetcnt": "0"
	}]
	 "children": [{
		"Street": "COWPER STREET",
		"PostalCode": "2502",
		"CustomerName": "PORT KEMBLA HOSPITAL",
		"CustomerId": "94105686",
		"Country": "Australia",
		"City": "WARRAWONG",
		"Assetcnt": "0"
	}]
	"children": [{
		"Street": "Great Western Highway",
		"PostalCode": "2790",
		"CustomerName": "THE NEW LITHGOW HOSPITAL",
		"CustomerId": "94107702",
		"Country": "Australia",
		"City": "LITHGOW",
		"Assetcnt": "0"
	}]
	"children": [{
		"Street": "Shoalhaven Road",
		"PostalCode": "2540",
		"CustomerName": "SHOALHAVEN DISTRICT MEMORIAL HOSPIT",
		"CustomerId": "9487942",
		"Country": "Australia",
		"City": "NOWRA",
		"Assetcnt": "0"
	}]
Regards,
VSK98
 
  • December 08, 2018
  • Like
  • 0
Hi All,

How can we display the nested JSON values in lightning:treegrid. I am getting values from Apex to lightning when I checked the console. 
Please find the attached screenshot.
User-added image
Column names:
component.set('v.tablecolumns', [
                {label: 'Group name', fieldName: 'group_name', type: 'text'},
            	{label: 'GroupId', fieldName: 'groupid', type: 'number'},
            	{label: 'CustomerId ', fieldName: 'Subcustomer.CustomerId ', type: 'text'},
                {label: 'Name', fieldName: 'CustomerName ', type: 'url',
                typeAttributes: {label: { fieldName: 'CustomerName' }, target: '_blank'}},
                {label: 'Street', fieldName: 'Subcustomer__r.Street', type: 'text'},
                {label: 'City', fieldName: 'City', type: 'text'},
        		{label: 'Post Code', fieldName: 'postalcode', type: 'text'},
        		{label: 'Country', fieldName: 'Country', type: 'text'},
       		    {label: 'No of Assets', fieldName: 'Assetcnt', type: 'text'},
            	
            ]);

I have tried with Subcustomer__r & Subcustomer. also but no results.

Regards,
VSK98
  • December 05, 2018
  • Like
  • 0
Hi All,

I am working JSON Parsing which is very new to me. I am getting the response and deserialized by using below method.
Map<String, Object> deSer = (Map<String, Object>) JSON.deserializeUntyped(resp.getbody());
Response Body is below:
{
	value = ({
		group_name =  *******,
		groupid = 1,
		sub_customer = [{
			"CustomerId": "9488490",
			"CustomerName": "*******",
			"Street": "*******,"
			City ":"
			KINGSWOOD ","
			PostalCode ":"
			******* ","
			Country ": Australia",
			"Assetcnt": "0"
		}, {
			"CustomerId": "9488491",
			"CustomerName": "*******",
			"Street": "*******,"
			City ":"
			PENRITH ","
			PostalCode ":"
			******* ","
			Country ": Australia",
			"Assetcnt": "0"
		}, {
			"CustomerId": "94106344",
			"CustomerName": "*******",
			"Street": "*******,"
			City ":"
			KINGSWOOD ","
			PostalCode ":"
			******* ","
			Country ": Australia",
			"Assetcnt": "0"
		}, {
			"CustomerId": "94126502",
			"CustomerName": "*******",
			"Street": "DERBY STREET,"
			City ":"
			KINGSWOOD ","
			PostalCode ":"
			******* ","
			Country ": Australia",
			"Assetcnt": "0"
		}, {
			"CustomerId": "94106486",
			"CustomerName": "*******",
			"Street": "*******,"
			City ":"
			KINGSWOOD ","
			PostalCode ":"
			******* ","
			Country ": Australia",
			"Assetcnt": "0"
		}, {
			"CustomerId": "9488489",
			"CustomerName": "*******",
			"Street": "*******,"
			City ":"
			PENRITH ","
			PostalCode ":"
			******* ","
			Country ": Australia",
			"Assetcnt": "0"
		}]
	})
}

I would like to get a list of Sub_Customers by using below method which is getting NULL Values.
 
List<Object> lstObj = (List<Object>) deSer.get('sub_customer');

Once I get the list<Object> I need to pass to Lightning: Datatable to display as a tree Grid view.

Regards,
VSK98
 
  • December 03, 2018
  • Like
  • 0
Hi All,

I have created one lightning tab & one test App for one profile. I kept default app is the test.  Whenever the user logins the salesforce, it should redirect to Lightning Page(Lightning Tab). I couldn't find any default tab settings in the app.

Please suggest me.........

Regards,
VSK98
  • November 30, 2018
  • Like
  • 0
Hi All,

I am unable to display the records using Lightning:treeGrid. The data has passing from apex controller to JS Controller but data not displayed.
Was anything missed over there?

LightningComponent:
 
<aura:component implements="force:appHostable" 
                controller="Nested_JSONController">
 
    
    <aura:attribute name="gridColumns" type="List" />
    <aura:attribute name="gridData" type="Object" />

    
    <aura:handler name="init" value="{!this}" action="{!c.onLoad}"/>
    
    <lightning:treeGrid columns="{! v.gridColumns }"
        data="{! v.gridData }"
        keyField="Id"
        aura:id="mytree"
    />
        

</aura:component>

JS Controller:
({
    onLoad : function(component, event, helper) {
        var columns = [
            {
                type: 'double',
                fieldName: 'totalPrice',
                label: 'totalPrice'
            },
            {
                type: 'datetime',
                fieldName: 'statementDate',
                label: 'statementDate'
            },
            {
                type: 'double',
                fieldName: 'unitPrice',
                label: 'unitPrice'
            },
            {
                type: 'double',
                fieldName: 'quantity',
                label: 'quantity'
            },
            
        ];
        component.set('v.gridColumns', columns);
        var action = component.get("c.Nested_JSON");
        action.setCallback(this, function(response){
            var state = response.getState();
            if ( state === "SUCCESS" ) {
            alert(state);
                var data = response.getReturnValue();
               console.log(data);
                component.set('v.gridData', data);
            }
        });
        $A.enqueueAction(action);
    }

})

Apex Classes:
 
public class InvoiceWrapper_L {
    public class LineItem {
        @AuraEnabled
        public Double unitPrice {get; set;}
        @AuraEnabled
        public Double quantity {get; set;}
        @AuraEnabled
        public String productName {get; set;}

        public Double getLineItemTotal() {
            return this.unitPrice * this.quantity;
        }
    }

    public class Invoice {
        @AuraEnabled
        public Double totalPrice {get; set;}
        @AuraEnabled
        public DateTime statementDate {get; set;}
        @AuraEnabled
        public String contactnumber {get; set;}
        @AuraEnabled
        public List<LineItem> lineItems {get; set;}
        @AuraEnabled
        public Integer invoiceNumber {get; set;}
    }
    @AuraEnabled
    public List<Invoice> invoiceList {get; set;}
}
 
public class Nested_JSONController {
   
    @AuraEnabled
    public static InvoiceWrapper_L Nested_JSON() {
     
    InvoiceWrapper_L wrapper ;
        Http h = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndPoint('https://docsample.herokuapp.com/jsonSample');
        request.setHeader('Content-type', 'application/json');
        request.setMethod('GET');

        HttpResponse response = h.send(request);

        wrapper = (InvoiceWrapper_L) JSON.deserializeStrict(response.getBody(), InvoiceWrapper_L.class);
        system.debug('@@@@@'+wrapper);
        return wrapper;
    }
}

Regards,
VSK98
  • November 29, 2018
  • Like
  • 0
Hi All,

I am displaying the list of records using datatable but values not displaying correctly under column name. 

Image:
User-added image

Adv Thnx,
Regards,
VSK98
  • November 24, 2018
  • Like
  • 0
Hi All,

I have to build custom logout functionality when the user clicks on the toggle button. 
I have tried with lightning:buttonmenu but when the user clicks on toggle button the username disappears.

Snippet below:
 
<p class="slds-page-header__title slds-m-right_small slds-align-middle slds-truncate"  title="test" style="color:white">TEST
            <span ><div class="slds-float_right"> {!v.userInfo.Name}
      <lightning:buttonMenu aura:id="menu" onselect="{! c.handleSelect }" alternativeText="Show menu">
        <lightning:menuItem value="Logout" label="Logout" />
      </lightning:buttonMenu></div></span></p>
Controller:
handleSelect: function (cmp, event, helper) {
        
       // var selectedMenuItemValue = event.getParam("value");
         window.location.href= 'https://test.salesforce.com'; 
      
    }
Actual Page: Actual Page

Username Disappear:
disappear

Regards,
VSK98
  • November 24, 2018
  • Like
  • 0
Hi All,

How to disable the Wrap or Clip text in Lightning Datatable?

Adv Thanks:)

Regards,
VSK98
  • November 14, 2018
  • Like
  • 0
Hi All,

I have a requirement like a User has entered the Account & Contacts details in different sheets in a single excel. Once entered the user will save into the Csv File & upload the file from VisualForce Page. Once Uploaded, the Accounts & contacts should be stored in SFDC.

Adv Thanks !!!!!!!!!!

Regards,
VSK98
  • September 19, 2018
  • Like
  • 0
Hi All,

I display the list of records in a lightning page. When the user clicks on Account name (hyperlink), it will redirect to another page and the account name value is passing from parent to child component using aura method. I can get the account name to child component but I couldn't able to make assign the value to another attribute. 
Snippet Code:
executeMyMethod : function(component, event, helper) {
         var params = event.getParam('arguments');
        console.log('Param : '+ params);-------- Getting Account Name
        var  s = params; ---- Assign the value to S
        alert(s); ---- Getting Account Name
        var cus = component.set("v.customer", params); ----setting the value
		 console.log('cus : '+ cus); --- Getting Undefine

Please help me with this.

Adv Thanks,
VSK98
  • August 08, 2018
  • Like
  • 0
Hi All,

I am getting the response from the apex class using with response.getvalue()  and also I need list size from apex controller.
I have declared the list & stored some value. This list size irrespective of  response.getvalue().length...I want to pass the list of records & size.

Below is Snippet:
for(integer i=0;i<customernames.size();i++ ){
       
        if(i < 1){
            objWI = new value();
            objWI.customer = customernames[i];
            objWI.city = cities[i];
            objWI.country = countries[i];
           
            lstWI.add(objWI);   
            system.debug('LIST SIZE******'+lstWI.size());
            system.debug('LIST******'+lstWI);
         }  
        }
     
            totalassests = customernames.size(); //// In above code i am adding customer names into customernames list
         system.debug('LIST SIZE******'+totalassests);   
           return lstWI;

Adv Thanks,
VSK98
  • August 07, 2018
  • Like
  • 0
Hello Helplers

I  have a question related  to  Lihtning:dataTable  componenent
There is an option  the  CLIP  or WRAP  the test  in a cell.
By  Default CLIP  is used and user  can switch to WRAP

What I  want is  to  have the  WRAP  being defaulted

Is  there any  solution for this?

Thanks in advance
Csbaa