Posts

Showing posts from August, 2017

salesforce questions and answers

Image
1. What is Lightning? A lightning Component framework is a UI framework for developing responsive web apps, Single Page Application FrameWork, It Supports partitioned multi-tier component development that bridges the client and server, It uses JavaScript on the client-side and Apex on the server-side. 2. What is the use of Lightning Component Framework? Out-of-the-box set of components, Event-driven Architecture, Framework optimized for performance. 3. What is a component?  Self-contained and reusable units of an app, A single line of code can use the entire app wherever want. 4. What is an aura framework? Aura is an open-source framework. Enables building apps completely independent of your data in Salesforce. 5. What is lightning App Builder? The Lightning App Builder, To build apps visually, without code, quicker than ever before using off-the-shelf and custom-built Lightning components. Make your Lightning components available in the Lightning

clearing cache after login in IE browser

Google chrome and firebox browsers are working fine after login to clear the cache and rendering dynamic information to the form. but in the IE browser, most of the developers are expecting issues, after login the form values are not changing dynamically due to unclear cache in the browser. for that, we have to use the following simple and powerful code to eliminate the IE browser issue. I have tried meta tag comments to clear the cache, unfortunately, it's not working. but I have used the following set of codes, now it's working fine. use for MEAN Stack Applications, function ( req , res ){ res . header ( 'Cache-Control' , 'private, no-cache, no-store, must-revalidate' ); res . header ( 'Expires' , '-1' ); res . header ( 'Pragma' , 'no-cache' ); }

date picker issue in firebox and IE browser

Image
Firebox and Internet Explorer do not support if the input type is date using HTML. for that, we have to use input type as a TEXT and write some JQuery code to eliminate the date issue in both browsers. In HTML,    //Required script:      < script src =" https : //code.jquery.com/jquery-1.12.4.js"></script>      < script src =" https : //code.jquery.com/ui/1.12.1/jquery-ui.js"></script>      //HTML Changes: < input type =" text " id =" dob " name =" borDOb " class =" form - control " />      //Jquery Changes: < script > $( document ). ready ( function (){ var $ j = jQuery . noConflict (); $( "# dob " ). datepicker ({ dateFormat : 'dd/mm/yy' , changeMonth : true , changeYear : true , yearRange : '1900:2050' , onSelect : function ( date ) {

xml to json conversion

Use case      To convert the XML file to JSON file using node.js      Consider sample XML file name as test.xml which contains the following information < groceryShop > < ownerName > xxxx </ ownerName > < name > DepartmentalStore </> < address > bangalore </ address > < pincode > 562320 </ pincode > </ groceryShop >      There are different methods to convert XML to JSON .but here we will see customized JSON format where will see only required information details. we will create a JSON structure. output: var groceryitems = { ownerName : xxxx , name : DepartmentalStore , address : bangalore , pincode : 562301 }; // required modules: const fs = require ( 'fs' ), xml2js = require ( 'xml2js' ); //Step 1: To read file using fs.readfile syntax in node.js.it will fetch all the information      and store it into one variable var data = fs . readFileSync ( 'test.xml'

wrapper class examples in salesforce

Image
Wrapper Class The wrapper class is a class that contains the collection of objects or different objects to store the manipulated values. The wrapper class will have fields and different data types as Objects. Apex Controller public class wrapperClassController { //Our collection of the class/wrapper objects cContact public List < cContact > contactList { get ; set ;} //This method uses a simple SOQL query to return a List of Contacts public List < cContact > getContacts () { if ( contactList == null ) { contactList = new List < cContact >(); for ( Contact c : [ select Id , Name , Email , Phone from Contact ]) { // As each contact is processed we create a new cContact object and add                     it to the contactList contactList . add ( new cContact ( c )); } } return contactList ; } public PageReference processSelect