• Sankeerth Reddy
  • NEWBIE
  • 150 Points
  • Member since 2017

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 23
    Replies

Hi friends,

I'm an admin just branching into apex development - so many of the examples I'm seeing around the forums have colored code, which makes it easier / faster to read. How do you actiate this? At the moment, all of my Salesforce code color is black (or maybe faintly colored but very dark), but I've seen many colored examples around like this one: https://www.dropbox.com/s/5krau2vfq9b2dru/Screenshot%202017-12-11%2013.16.17.jpg?dl=0

I can't find info anywhere online on how to change the coloring of the code while editing! If you could point me in the right direction I'd be really grateful!
Thanks,

Palmira

HI all, hope someone can help me here

SO I have been taking the apex academy on pluralsight to learn how to code in salesforce and its been a great starting point but have recentrly been stuck in my tracks now that mavensdmate is now not usable.  I am hoping that someone here is able to help recommend and show me step by step how to install and get running a new instance so I can get back to learning.  I have tried on my own but I have no idea what I am doing.  I have no idea which ones are good or work etc but any right now would be amazing.

Any help much appreciated.
Hi,

Can I write a 'after insert' trigger on EmailMessage object to edit the TextBody of incoming Mail?
Is it possible in Salesforce?
HI,
Whne logged in as user, SetUp>>My Settings >> Personal >> Advanced User Details, login history is not visible. As admin I can see User Login History as related list. Is there anything I have to enable?
Any help will be much appreciated.

Thanks,
Krishna
Hi Guys,
i am creating Batch apex class to insert/update/delete records in my custom object emploee_profile from Profiles. I am able to insert but delete/update not working.

please see my code and guide me where i am wrong..actually i am beginner in salesforce:


global class ProfilesSync implements database.batchable<sObject>,Database.Stateful{
    
    global map<ID,Profile> ProfileRegMap=new map<ID,Profile>();
    global Database.QueryLocator start(Database.BatchableContext BC){
        System.debug('in start');
        try{
            return database.getQueryLocator([select ID,Name from Profile order by ID]);
        }
        catch(Exception e){
            System.debug('Error=='+e.getStackTraceString());
        }
        return null;
    }
    global void execute(Database.BatchableContext BC, List<Profile> ProfilesList)
    {
        System.debug('ProfileList=='+ProfilesList.size());
        if(ProfilesList!=NULL)
        {
            for(Profile rl:ProfilesList){
                ProfileRegMap.put(rl.ID,rl);
            }
        }
    }
    global void finish(Database.batchableContext BC){
        System.debug('UserProfileList=='+ProfileRegMap);
        List<Employee_Profile__c> Employee_Profile_list1 = new List<Employee_Profile__c>([select Profile_ID__c,Profile_Name__c from Employee_Profile__c order by Profile_ID__c]);
        List<Employee_Profile__c> Employee_Profile_list_Insert = new List<Employee_Profile__c>();
        List<Employee_Profile__c> Employee_Profile_list_update = new List<Employee_Profile__c>();
        List<Employee_Profile__c> Employee_Profile_list_delete = new List<Employee_Profile__c>();
        
        map<ID,Employee_Profile__c> custRoleMap=new map<ID,Employee_Profile__c>();
        for(Employee_Profile__c us:Employee_Profile_list1){
            custRoleMap.put(us.Profile_ID__c,us);
        }
 
            for(Profile urs:ProfileRegMap.values()){
                if(!custRoleMap.containsKey(urs.id)){
                  system.debug('New records');
                        Employee_Profile__c urs2 = new Employee_Profile__c();
                        urs2.Profile_ID__c=urs.id;
                        urs2.name=urs.id;
                        urs2.Profile_Name__c=urs.name;
                       Employee_Profile_list_Insert.add(urs2); 
              
                }
                
            }
            system.debug('size of cust list'+Employee_Profile_list_Insert.size());
            insert Employee_Profile_list_Insert;
           update Employee_Profile_list_update;
           delete Employee_Profile_list_delete;
    }
}
Hello, i am a Admin, unfortunately facing a tough situation right now.
What is the easiest way to have a http call from a javascript to create records in salesforce? I have almost no experience with API connections, but with apps from the app store such as formassembly etc.
How easy is it to set up a connection to have a javascript being able to perform a http call?

Thanks a lot in advance for any advice, even if it is a developer, who would be able to assist here.

Hi friends,

I'm an admin just branching into apex development - so many of the examples I'm seeing around the forums have colored code, which makes it easier / faster to read. How do you actiate this? At the moment, all of my Salesforce code color is black (or maybe faintly colored but very dark), but I've seen many colored examples around like this one: https://www.dropbox.com/s/5krau2vfq9b2dru/Screenshot%202017-12-11%2013.16.17.jpg?dl=0

I can't find info anywhere online on how to change the coloring of the code while editing! If you could point me in the right direction I'd be really grateful!
Thanks,

Palmira

Hi All,

I am looking for a cron expression that runs my apex class every first week of Monday and Thursday in all months

I have tried to set up

expression = 0 0 1 ? * 2#1 which shows Fires at every first week on Monday,

but i am looking for something which runs my apex class on every first week of Monday and Thursday.....

I am looking forward to hear from you all.

This is quite urgent, please let me know as soon as possible.
I am not able to see Challenge section under Admin Beginner > Lightning Experience Customization > Create and Customize List Views.
Please take a look.
Thank you in advance !

User-added image
For handson challenge "Install an AppExchange dashboard package and make updates to one of the dashboards." i m getting error "Challenge Not yet complete... here's what's wrong: The 'New LEAD Trend by Source' dashboard component does not have the wedges set to 'Lead Source'. " Don't know where i am gng wrong
Hi,

Can I write a 'after insert' trigger on EmailMessage object to edit the TextBody of incoming Mail?
Is it possible in Salesforce?
I am creating a Predefined Filed but I am getting Error: Incorrect number of parameters for function 'YEAR()'. Expected 1, received 0

How can I correct the below formula? 

 
AND(Primary_Sales_Rep__c.Name, YEAR(), "Pipeline Review")

 
HI all, hope someone can help me here

SO I have been taking the apex academy on pluralsight to learn how to code in salesforce and its been a great starting point but have recentrly been stuck in my tracks now that mavensdmate is now not usable.  I am hoping that someone here is able to help recommend and show me step by step how to install and get running a new instance so I can get back to learning.  I have tried on my own but I have no idea what I am doing.  I have no idea which ones are good or work etc but any right now would be amazing.

Any help much appreciated.
Has anybody completed challenge 5 in lightning experience superbadge? If yes kindly post the solution of the same.
I'm facing problem in the following section.
Awaiting Approval
If the status changes to awaiting approval and there is a positive discount value, kick off the discount approval process. If no discount is applied, the status updates to Scheduled because no approval is needed when a package is purchased at full price.

It is showing me the following error.
User-added image

Kindly share the solution.
hi ,i am trying the Lightning Experience Specialist

while i installed the  unmanaged LEX Superbadge package.
here comes the issue

"Install the unmanaged package from the pre-work if you haven’t already. Rename all of the standard objects in the schema as specified, and set the default page layouts for Adventure, Adventure Package, and Opportunity to the Relaxation Gauntlet custom layouts. Update the Opportunity stage values, create a sales path for sales reps (highlighting key fields and giving specific coaching guidance), and create an approval process as specified in the business requirements."

i am confused what i should do next .as i am unable to understand ....

help me
The campingList JavaScript controller isn't setting the 'item' as a parameter or saving the record correctly.

My code is as follows:

1---Camping List Component
<aura:component controller="CampingListController">
	
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    
    <aura:handler name="addItem" event="c:addItemEvent"
   	action="{!c.handleAddItem }"/>
    
    <aura:attribute name="newItem" type="Camping_Item__c"
     default="{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 0,
                    'Price__c': 0,
                    'Packed__c': false }"/>
    
    <aura:attribute name="items" type="Camping_Item__c[]"/>
    
    <ol>
    <li>Bug Spray</li>
    <li>Bear Repellant</li>
    <li>Goat Food</li>
    </ol>
    
       <!-- NEW EXPENSE FORM -->
    <div class="slds-col slds-col--padded slds-p-top--large">

        <c:campingListForm/>

    </div>
    <!-- / NEW EXPENSE FORM -->    
   

    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Items</h3>
        </header>
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="items">
                    <c:campingListItem item="{!item}"/>
                </aura:iteration>
            </div>
        </section>
    </div>

</aura:component>

2---Camping List Controller
 
({
    // Load items from Salesforce
	doInit: function(component, event, helper) {

    // Create the action
    var action = component.get("c.getItems");

    // Add callback behavior for when response is received
    action.setCallback(this, function(response) {
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            component.set("v.items", response.getReturnValue());
        }
        else {
            console.log("Failed with state: " + state);
        }
    });

    // Send action off to be executed
    $A.enqueueAction(action);
},

    
    handleAddItem: function(component, event, helper) {
    var newItem = event.getParam("item");
    //helper.createItem(component, newItem);
        this.saveItem(component, item, function(response){
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            var items = component.get("v.items");
            items.push(response.getReturnValue());
            component.set("v.items", items);
        }
    }
          
}
                      
})

3---Camping List Helper

Empty

4---Camping List Form
 
<aura:component >
	
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>
        <!-- CREATE NEW ITEM FORM -->
    <form class="slds-form--stacked">

      <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputText aura:id="itemname" label="Name"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Name}"
                  required="true"/>

          </div>
     </div>

     <div class="slds-form-element slds-is-required">
          <div class="slds-form-element__control">
              <ui:inputNumber aura:id="quantity" label="Quantity"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Quantity__c}"
                  required="true"/>

          </div>
      </div>

      <div class="slds-form-element">
          <div class="slds-form-element__control">
              <ui:inputCurrency aura:id="price" label="Price"
                  class="slds-input"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Price__c}"
                  />
          </div>
      </div>

      <div class="slds-form-element">
          <ui:inputCheckbox aura:id="packed" label="Packed?"
              class="slds-checkbox"
              labelClass="slds-form-element__label"
              value="{!v.newItem.Packed__c}"/>
      </div>

      <div class="slds-form-element">
          <ui:button label="Create Camping Item"
              class="slds-button slds-button--brand"
              press="{!c.clickCreateItem}"/>
      </div>

    </form>
    <!-- / CREATE NEW ITEM FORM -->
</aura:component>

5---CampingListFormController
 
({
    
    clickCreateItem: function(component, event, helper) {    
    if(helper.validateItemForm(component)){
        // Create the new item
        var newItem = component.get("v.newItem");
        helper.createItem(component, newItem);
    }
        
        }

})

6---CampingListFormHelper
 
({
 createItem: function(component, newItem) {
    var createItem = component.getItem("createItem");
    createItem.setParams({ "item": item });
    createItem.fire();
             component.set("v.newItem",{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 0,
                    'Price__c': 0,
                    'Packed__c': false }/>);
},
    

		validateItemForm: function(component) {
		
              // Simplistic error checking
        var validItem = true;

        // Name must not be blank
        var nameField = component.find("itemname");
        var itemname = nameField.get("v.value");
        if ($A.util.isEmpty(itemname)){
            validItem = false;
            nameField.set("v.errors", [{message:"Item name can't be blank."}]);
        }
        else {
            nameField.set("v.errors", null);
        }
        
        // Quantity must not be blank
        var quantityField = component.find("quantity");
        var quantity = nameField.get("v.value");
        if ($A.util.isEmpty(quantity)){
            validItem = false;
            quantityField.set("v.errors", [{message:"Quantity can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
		// Price must not be blank
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        if ($A.util.isEmpty(price)){
            validItem = false;
            priceField.set("v.errors", [{message:"Price can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }
            return validItem;

	}
})

I am still getting this error:

User-added image

Any help would be appreciated.
 
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,
Hi,
I finally solved LES Challenge 8 after 10+ hours of headache. I had to create a lot of new columns and add data to the rows in my .CSV-file. Some files contained 130 rows and some only 3 rows. This is a rather small number of rows in guessing and therefore I'm wondering if there's an easier way to solve it when, lets say, you have files with 20 000+ rows. I'm looking for a better way to solve it than how I did it, a best practice of some kind. 
How did you guys do it? Is there a best practice?

I'm using the Dataloader.io when importing: 
  1. Downloaded the Superbadge-Lightning-Import.xlsx and split it up/converted into Explorers.csv , Adventures.csv and OpportunitiesWAdventures.csv 
  2. Insert Explorers from Explorers.csv. 
    1. Since Opportunities contains Adventure Package which contains a lookup to Explorer and the Adventure I figured the easiest would be to start inserting the Explorers.csv. Before inserting the Explorer.csv I had to split the Full Name column into First name and Last name to match the Explorer-object's Firstname and Lastname column. 
  3. Insert Adventures from Adventures.csv
    1. Before importing Adventure.csv I removed the Explorer column since it was empty and I also cleaned up the data in the Description column cause it contained commas and was interfering.
  4. Insert Price Book Entry from Adventures.csv
    1. The Adventures has to be in the Price Book to be able to be added to an Adventure Package. Therefore I added a column in the called PricebookID and added the Pricebook ID of the Standard Price Book to the rows. 
      1. Mapped field:
        1. Adventure Name - Adventure (Lookup via Adventure Name)
        2. List Price - List Price
        3. Active (Adventure) - Active
        4. Pricebookid - Price Book ID
  5. Insert Opportunities from OpportunitiesWAdventures.csv. 
    1. Mapped fields:
      1. Close Date - CloseDate, 
      2. Opportunity Name - Name
      3. Probability (%) - Probability
      4. Quantity - TotalOpportunityQuantity
      5. Stage - StageName
  6. Insert Opportunity Contact Role from OpportunitiesWAdventures.csv
    1. Mapped Fields
      1. Opportunity Name to Opportunity ID(Lookup via  Name) 
      2. Explorer to Explorer (Lookup via Full Name)
  7. Insert Adventure Package from OpportunitiesWAdventures.csv
    1. Added new column for Adventure Name in OpportunitiesWAdventures.csv and added the Adventure name (contained as a part in the Opportunity Name column) to all the rows. 
      1. Mapped Fields: 
        1. Opportunity Name - Opportunity ID(Lookup via Name)
        2. Adventure Name - Price Book Entry ID (Lookup via Adventure Name)
        3. Explorer - Explorer (Lookup via Full Name)
Please leave a comment on how you solved it, thanks! :)