• Engine Force
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 7
    Replies
On this documentation link: https://developer.salesforce.com/trailhead/lightning_components/lightning_components_events_handle

it says, a component can also handle its own event. Simply include an aura:registerEvent and aura:handler in that component.

Let's say I have a list of accounts and on clicking the account name, I want to display its contact list.

<aura:iteration items="{!v.accounts}" var="acc">    
        <div onclick="{!c.showContacts}" class="row primary">{!acc.Name}</div>     
    </aura:iteration>

In the showContacts controller action, how do I set the parameter to the event which takes an account object?
// How do I set acct below?
var updateEvent = component.getEvent("showContacts");
      updateEvent.setParams({ "account": acct }).fire();

var acct = component.get("v.acc.id");
this doesn't work.

I know how to do this via a sub-component that shows the account name, register the onclick event and handle it in the main component. Just wondering how you do this in the component itself since the logic is really simple and do not want to use a subcomponent for that one line of code.

Please advise.


 
Hi I'm trying to follow the example here https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_one_demo_load.htm.

Atfter setting it up, I got this error when previewing it by clicking on the preview button:
Something has gone wrong. Unable to get property 'setParams' of undefined or null reference. Please try again.

I think it's the helper js "getContacts" where

var toastEvent = $A.get("e.force:showToast");
            if (state === 'SUCCESS'){
                toastEvent.setParams({
                    "title": "Success!",
                    "message": " Your contacts have been loaded successfully."
                });
            }

e.force:showToast appears to be a system function. Can someone confirm? Does this function only work on Salesforce1?
Hi I'm configuring the Outlook Configuration Data Set for outlook sync. Under contacts, you can select users' records or User's Team's Records. User's records would be records user owns. What about user's team's records? What does that mean exactly?
Hi I've installed force.com migration tool ant on my computer. It works fine with developer org and free enterprise editions.e.g. ant test

But when I try to login to my company enterprise sandbox, it just does not log in.

The command prompt errors out:
build.xml:15: Invalid username, password, security token; or user locked out.


In the login history for my user in the company enterprise sandbox that's used in build.properties, i see:

Partner Product Invalid Password Java (Salesforce.com) Unknown Force.com Migration Tool 31.0 SOAP Partner 31.0

Whereas, I used the same user name and password (passwordsecuritytoken) to access data loader. They work just fine from the same computer / network.

Do you have any ideas why?

Hi There,

 

Is it possible to insert account and contacts at the same time in one DML: insert(new account(name='acct1'), contact = new contact())?

 

Thanks!

Do you have examples on how public string str { get; private set;}? I cannot find documentation on how to use private set. Does it mean it can only be set inside a method in the current class?

 

Thanks!

public virtual interface Pair<T, U> {
    T getFirst();
    U getSecond();
    void setFirst(T val);
    void setSecond(U val);
    Pair<U, T> swap();
}

The above code from APEX guide does not compile with Error: Compile Error: type parameters not supported?

 

Thanks for the help!

In the example here http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_lifecycle_example.htm?SearchType=Stem&Highlight=Setter|setter|setters, can someone explain why selectedValue = value; is a side-effect? Why cannot you set selectedValue in its own setter method?

 

public class componentController {

    public String selectedValue {

        get;

        set {

            editMode = (value != null);

          

 // Side effect here - don't do this!     

            selectedValue = value;

        }

    }

    public Boolean editMode {get; private set;}

}

I'm getting this error: entity type cannot be inserted: Product on an upsert soap call.

 

I'm system admin and have full rights on the product2 object. Not sure why I would get this error. I have specified the required fields on the product2 object. And I could add a new product through the UI. 

 

Have you run this issue before?

The javascript code on a list button below no longer works in winter 12.

 

{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}

alert("hello");

 

 

Do you have similar issues?

Did anyone receive the email that's supposedly sent on Tuesday, July 5, 2011, claimed by the Salesforce.com Certification Maintenance Announcement‏ email?

 

I have not received any email notification that the Summer ‘11 Certification Maintenance exams are available for registration.  

 

If you have received that email, can you please send me the list of study questions??

 

Your reply is much appreciated!

On this documentation link: https://developer.salesforce.com/trailhead/lightning_components/lightning_components_events_handle

it says, a component can also handle its own event. Simply include an aura:registerEvent and aura:handler in that component.

Let's say I have a list of accounts and on clicking the account name, I want to display its contact list.

<aura:iteration items="{!v.accounts}" var="acc">    
        <div onclick="{!c.showContacts}" class="row primary">{!acc.Name}</div>     
    </aura:iteration>

In the showContacts controller action, how do I set the parameter to the event which takes an account object?
// How do I set acct below?
var updateEvent = component.getEvent("showContacts");
      updateEvent.setParams({ "account": acct }).fire();

var acct = component.get("v.acc.id");
this doesn't work.

I know how to do this via a sub-component that shows the account name, register the onclick event and handle it in the main component. Just wondering how you do this in the component itself since the logic is really simple and do not want to use a subcomponent for that one line of code.

Please advise.


 
Hi I'm configuring the Outlook Configuration Data Set for outlook sync. Under contacts, you can select users' records or User's Team's Records. User's records would be records user owns. What about user's team's records? What does that mean exactly?

Hi,

 

I am unable to load a hybrid_remote application that is pointing to a remote visual force page on Android.  Here are the steps I followed 

 

1) I installed the following visual force examples into  my DE

   - http://bit.ly/mobile_vf_phonebook

   - and the example mentioned in http://www2.developerforce.com/en/mobile/getting-started/html5#backbone

2) using forcedroid create command I created a hybrid_remote application, I pointed the start page as /apex/PhoneBook or /apex/MobileSample_Backbone (neither pages worked) 

3) I editied oauthRedirectURI (testsfdc:///mobilesdk/detect/oauth/done) and consumerkey in the bootconfig.json.

 

I use ecllipse for building and launching my application, when i launched the app (either on device or simulator) the app simply shows a blank screen.

 

I was expecting it to show a sfdc login screen followed by permission screen and upon clicking allow it would take me to my remote visual force page, but that dint work.

 

Could someone let me know if there is an issue with my configuration ? 

 

Thanks,

 

Nikhil

Do you have examples on how public string str { get; private set;}? I cannot find documentation on how to use private set. Does it mean it can only be set inside a method in the current class?

 

Thanks!

The javascript code on a list button below no longer works in winter 12.

 

{!REQUIRESCRIPT("/soap/ajax/21.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}

alert("hello");

 

 

Do you have similar issues?

Did anyone receive the email that's supposedly sent on Tuesday, July 5, 2011, claimed by the Salesforce.com Certification Maintenance Announcement‏ email?

 

I have not received any email notification that the Summer ‘11 Certification Maintenance exams are available for registration.  

 

If you have received that email, can you please send me the list of study questions??

 

Your reply is much appreciated!

Hello,

 

I'm really excited about SF Content being free for all my users, and I think I have a great way to start using it. We have these PDF reports that go out to our customers, and I'd love it if we could bcc these emails to a Salesforce email address which would grab the attachments and stash them in a workplace (the same workplace for all attachments). I think this should be pretty easy, but I'm not sure where to begin.

 

I know that I'd create an email service, and I'd obviously add that email address to the emails being sent out, and create a new Apex class, but I looked through the Winter '10 API guide and didn't see what kind of calls I'd make - if anyone could give me an idea of what the code would look like, I'd really appreciate it!

 

Help?

Message Edited by Jakester on 12-16-2009 03:29 PM