• Josh Stigall
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hi all. I am very new to JavaScript in general and Salesforce development in particular. I think that this question is definitely a newbie question, but I need to get over my hesitation to ask. I'm happy if the best answer is to point to learning resources that will help. The code below comes from the Expenses Component build in the Lightning Basics Trailhead. I know the code works, but I want to know why it works. (The code is in the expensesHelper.js.)
  1. What exactly is the significance of the 'component' and 'expense' parameters in the function? Does 'component' refer back to a component (in this case the Expenses component)? Does 'expense' refer to an attribute somewhere? (I don't think it would refer to the Expenses component becuase the attribute set there is named 'expenses.')
  2. In the second line: Are 'component' and 'expense' repeated because they are defined above?
  3. In the final line: How does the component.set("v.expenses", expenses); work? I know v.expenses refers to the Expenses component, but where does the value (I think that's the correct word) 'expenses' come from?
Thanks again for any help you can provide as I continue to learn!
createExpense: function (component, expense) {
        this.saveExpense(component, expense, function (response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var expenses = component.get("v.expenses");
                expenses.push(response.getReturnValue());
                component.set("v.expenses", expenses);
            }

        });

    },

 
Hi all.

A core part of our business process is collecting the crops to be planted in a farmer's fields as part of a 'crop plan.' We have created a custom object to collect the data that we need to have for the crop plan. This crop plan will always have more than one crop planted by a farmer in more than one field. (A physical field, not a field in Salesforce.)

Is there a way to allow users to enter more than one crop to a famer's crop plan? Specifically, is there a way to add a button, for example, called 'additional crops' that will add a record to the user interface allowing multiple crops to be entered.

What we envision is a button that will duplicate two fields, 'crop' and 'acres planted.' In the end, a user will be able to enter a crop and the number of acres to be planted, click a button that will add another 'crop' and 'acres planted' fields. (In this case, the fields will be fields in salesforce.)

I know that we can add several 'crop' and 'acres planted' fields to the object, but we'd like this to be created by a user using the button, because different farms will have a different number of crops planted. That is, we don't want to create, say 5 'crop' and 'acres planted' fields to the object because some farmers will have 4 crops, some farmers will have 7 crops. We want the interface for entry to look cleaner than having a number of different fields for users to input data.

I hope this is a clear enough explanation for what we're looking for. I can provide more info and screenshot if that is helpful. (This is my first post, so I know I may be unclear in what I'm asking for.)

Thanks, in advance, for your advice.
Hi all.

A core part of our business process is collecting the crops to be planted in a farmer's fields as part of a 'crop plan.' We have created a custom object to collect the data that we need to have for the crop plan. This crop plan will always have more than one crop planted by a farmer in more than one field. (A physical field, not a field in Salesforce.)

Is there a way to allow users to enter more than one crop to a famer's crop plan? Specifically, is there a way to add a button, for example, called 'additional crops' that will add a record to the user interface allowing multiple crops to be entered.

What we envision is a button that will duplicate two fields, 'crop' and 'acres planted.' In the end, a user will be able to enter a crop and the number of acres to be planted, click a button that will add another 'crop' and 'acres planted' fields. (In this case, the fields will be fields in salesforce.)

I know that we can add several 'crop' and 'acres planted' fields to the object, but we'd like this to be created by a user using the button, because different farms will have a different number of crops planted. That is, we don't want to create, say 5 'crop' and 'acres planted' fields to the object because some farmers will have 4 crops, some farmers will have 7 crops. We want the interface for entry to look cleaner than having a number of different fields for users to input data.

I hope this is a clear enough explanation for what we're looking for. I can provide more info and screenshot if that is helpful. (This is my first post, so I know I may be unclear in what I'm asking for.)

Thanks, in advance, for your advice.
Hi all
 I have a cutom object A which has certain fields like Center, District, Region, etc. I have another object where I need to create custom lookup fields to individual fields of the object A like a field to capture Center of object A, District of Object A and so on.
Is it possible and how?
Thank you

This is the trailhead challenge I'm working on.
Create a report of Opportunities grouped by Type. Then follow the dashboard and share a snapshot on Chatter.
Name the report 'Opportunities by Type' and save it to the 'Unfiled Public Reports' folder.
The report must be of type Opportunities.
The report format must be a Summary report.
The report must be grouped by 'Type'.
The date range should be for All Time.
You can include any columns you like, but must include 'Amount' as one of the columns.
Create a dashboard named 'Opportunities Dashboard' and save it to the 'My Personal Dashboards' folder.
Create a dashboard component on the dashboard using the report you just created.
Set the header to 'Opptys by Type' and the title to 'For all time' for the dashboard component.
Use the horizontal bar chart dashboard component, and ensure the record count is displayed on the x-axis.
Follow the 'Opportunities Dashboard' dashboard in Chatter. Make sure that Feed Tracking is enabled for Dashboards first.
Post a snapshot of the 'Opptys by Type' dashboard component to Dashboard Chatter feed.

But I'm getting the following error when I check if the challenge has been completed
Challenge Not yet complete... here's what's wrong: 
The dashboard snapshot post to Chatter was not found.
Can someone hepl me?
If possible post the snapshots?
 
@AuraEnabled
public static List<Contact> getContacts() {
    return [Select Id, Name, Email, Title, Phone From Contact];
}
I'm receiving the following error: unexpected token: 'List'
 
While MavensMate is riding off into the sunset, it's going to remain relevant for a bit.  That said, what's The Thing to use moving forward to connect VS Code, Atom, or Sublime to the Salesforce backend?

Thanks,

Steve