• Abers55
  • NEWBIE
  • 35 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hi,

I wrote a piece of code to update the chatter photo for a user using the chatter API.  It's been working successfully,  however,  now it has stopped working.

The code looks like this:
Document content = [select Body from Document where id ='***known id***'];

ConnectApi.Photo photo = ConnectApi.ChatterUsers.setPhoto(null, UserInfo.getUserId(),  new ConnectApi.BinaryInput(content.Body,'image/jpg','userImage.jpg'));
I don't think that there's anything wrong with the code.  I have noticed that I cannot even update the picture from my chatter page anymore.  So,  is there some sort of limit that I have broken?
I've written a very simple component to play around with toastEvents,  but,  I'm having trouble getting them to display an icon of my chosing.  The documentation says to set the type parameter to "other" and then use an icon defined in the SLDS.  Here's my code:

Component
<aura:component implements="flexipage:availableForAllPageTypes">
    <lightning:button variant="brand" label="Toast" iconName="utility:event" iconPosition="left" onclick="{! c.handleClick }" />
</aura:component>
Controller
({
    handleClick : function(component, event, helper) {        
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            "title": "The toast pops up",
            "message": "Toast event fired",
            "mode": "sticky",
            "type": "other",
            "key": "utility:event"
        });
        toastEvent.fire();
    }
})
No matter what value I supply in the key parameter,  I can't seem to get a result and there don't seem to be any examples of it's use.  Anyone out there succeeded with this?

 

I'd like to share some data across 2 visualforce pages,  so I developed 2 pages that share a single controller:

PageOne

<apex:page controller="PageOne">
    <apex:form >
        <apex:inputText value="{!ThingOne}"/>
        <apex:commandButton value="Next" action="{!Next}"/>
    </apex:form>
</apex:page>

 and PageTwo 

<apex:page controller="PageOne">
    <apex:form >
        <apex:inputText value="{!ThingOne}"/>
        <apex:commandButton value="Previous" action="{!Previous}"/>
    </apex:form>
</apex:page>

 share

public with sharing class PageOne {

    public PageReference Previous() {
        return new PageReference('/apex/PageOne');
    }

    public PageReference Next() {
        return new PageReference('/apex/PageTwo');
    }

    public String ThingOne { get; set; }
}

 Which works fine and I'm happy.

 

However,  supposing Page One had a great deal of complexity and Page Two had a very simple visual output that was based on a result of this complexity.  I'd like to remove the complexity from the work to be done by Page Two,  so,  it seemed to me that the best way to do this would be to continue to share the custom controller and to use an extension on each page.  The code now reads:

PageOne:

<apex:page controller="PageOne" extensions="PageOneExt">
    <apex:form >
        <apex:inputText value="{!ThingOne}"/>
        <apex:commandButton value="Next" action="{!Next}"/>
    </apex:form>
</apex:page>
public with sharing class PageOneExt {
    public PageOne pageController;

    public PageOneExt(PageOne controller) {
        pageController = controller;
        system.debug('***pageController: ' + pageController);
    }

}

 

PageTwo:

<apex:page controller="PageOne" extensions="PageTwoExt">
    <apex:form >
        <apex:inputText value="{!ThingOne}"/>
        <apex:commandButton value="Previous" action="{!Previous}"/>
    </apex:form>
</apex:page>

 

public with sharing class PageTwoExt {
    public PageOne pageController;
    
    public PageTwoExt(PageOne controller) {
        pageController = controller;
/*
* Do a work here with data from Page One
*/ system.debug('***pageController: ' + pageController); } }

 However,  the ThingOne string is no longer shared between the pages and I don't understand why.  Am I doing something wrong or missing the point somewhere?

 

  • September 06, 2013
  • Like
  • 0
Hi All

Please help me in defining the CRON expression for running a scheduler class for every 30th min of an hour 
For example first run should be 9 30 next should be 10 30 next should be 11 30 

 
Custom Tabs 
Help for this Page
You can create new custom tabs to extend Salesforce functionality or to build new application functionality. 

Custom Object Tabs look and behave like the standard tabs provided with Salesforce. Web Tabs allow you to embed external web applications and content within the Salesforce window. Visualforce Tabs allow you to embed Visualforce Pages. Lightning Component tabs allow you to add Lightning Components to the navigation menu in Salesforce1. Lightning Page tabs allow you to add Lightning Pages to the navigation menu in Salesforce1.


I want to create a Custom Lightning component tab .
But the feature is missing though it is described in the help section.User-added image
Hi,

I wrote a piece of code to update the chatter photo for a user using the chatter API.  It's been working successfully,  however,  now it has stopped working.

The code looks like this:
Document content = [select Body from Document where id ='***known id***'];

ConnectApi.Photo photo = ConnectApi.ChatterUsers.setPhoto(null, UserInfo.getUserId(),  new ConnectApi.BinaryInput(content.Body,'image/jpg','userImage.jpg'));
I don't think that there's anything wrong with the code.  I have noticed that I cannot even update the picture from my chatter page anymore.  So,  is there some sort of limit that I have broken?