Friday 29 December 2017

Set environment variable for Apache ANT

To use ant in windows, you need to download it and should configure the windows environment variable.

Download file here,


Steps to set path:

Download the latest ant zip file from apache ant official website and unzip it to the folder you want to store ant.

Example:


To add the ANT_HOME as the windows environment variable. Please Navigate to My Computer -> right click My Computer -> Properties -> Advanced system setting -> Environment Variables...


Update the Path variable, Append the %ANT_HOME%\bin to the end, so that you can run the ant's command anywhere.


Now path added successfully to verify that go to command prompt and type ant -version and click enter. You see the message like give an image.



Wednesday 20 December 2017

Create a Simple Camping List Lightning Component

1.Create a campingList component that contains an ordered list of camping supplies that include Bug Spray, Bear Repellant, and Goat Food.

<aura:component >
<ol>
<li>Bug Spray</li>
<li>Bear Repellant</li>
<li>Goat Food</li>
</ol>
</aura:component>

2.Create a campingHeader component that displays Camping List wrapped in an H1 tag with a font size of 18.

<aura:component >
    <h1>Camping List</h1>
</aura:component>

use this for style 

.THIS {
}
h1.THIS {
font-size: 18px;
}

3. Create a camping component that contains the campingHeader and campingList components.

<aura:component >
    <c:campingHeader/>
    <c:campingList/>
</aura:component>

Create a Packing List Item Component

Steps:


1.Create the component named campingListItem


2.Include the below code to complete this challenge


<aura:component >

<aura:attribute name="item" type="Camping_Item__c" required="true"/>

<ui:outputText value="{!v.item.Name}"/>

<lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/>

<lightning:formattedNumber value="{!v.item.Quantity__c}" style="Number"/>

<lightning:input type="toggle" label="Packed" name="togglevalue" checked="{!v.item.Packed__c}" />



</aura:component>




Thanks :)

Monday 18 December 2017

Invalid Partner Network Status error

Invalid Partner Network Status error

Why this error occurs:

This error will occur when you are trying to forward records to connected org programmatically if the connected org doesn’t subscribe that object then this INVALID_PARTNER_NETWORK_STATUS error will be thrown.

How to solve this error:


Before forward the record from an object to which the connection check if the connected org subscribes the object that we are trying to forward.

How to run a single test methods from test classes in Salesforce

We can run specific test methods from test class in Salesforce. If you have many test methods in an Apex test class but you don’t want to run all of them, then you can select the specific method and run in the developer console.

In such scenarios, If you want to run failed test method out of 50 test methods in a class you can do this instead of running entire class.

Follow the below steps:

  • From developer console, select the Test -> New Run 

  • Select the test class and click add selected then select the methods, click Run


Sunday 17 December 2017

Run more than one test class at a time in Salesforce

Run more than one test class at a time

We can verify our apex code functionality by running test classes. We can run more than one test classes at a time from developer console.

o   From developer console, select the Test menu -> click New Run.



o   Select the classes you want to run, click add selected -> click run.



o   Now all the test classes will run asynchronously.

Set environment variable for Apache ANT

To use ant in windows, you need to download it and should configure the windows environment variable. Download file here, Ant St...