• Paul Allsopp 3
  • NEWBIE
  • 50 Points
  • Member since 2015
  • Software Developer
  • Vistar Retail (PFGC)

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 13
    Replies
We are trying to move to Lightning Experience and I have ran into an odd situation.  I have added a custom visualforce action and set the height to 500px.  The action was added to the page layout and is showing up correctly in lightning experience.  The problem is when the user clicks the button the modal box is displayed and the conent area in side the box is 500px high, but the actual content is only 186px height as seen here:

User-added image

If I change the height value declared in the custom action, the height of the model box changes, but the height of the displayed content does not.
Looking into the chrome dev tools inspector there are the following elements that are involved.
 
<div class="modal-body scrollable" style="height: 500px; max-height: 500px;">
This is apparently where the height gets set based on the height setting in custom action definition.
Then we have the following markup:
 
<div class="forceChatterBasePublisher--default forceChatterBasePublisher forceChatterAlohaPagePost">

    <div class="forceChatterPublisherPresentationPanel">
        
        <div class="container activeState">

            <div class="cuf-content">

               ....................
    
            </div>

        </div>

    </div>

</div>

If i manually add "height: 100%;" to these 4 elements in the inspector the content is displayed properly.

If anyone has any idea how to fix this, it would be greatly appreciated.  Thanks
 
Hey guys/gals,

I am trying to integrate the Outlook API from MS into a calendar app I'm building in Lightning. I have tried the code below, which I wrote today, but keep getting an error back saying: Malformed JSON. If I don't use JSON and send the request directly as a POST string, I get an error back saying the grant_type parameter is missing...although clearly not.

Any thoughts?

Thanks,
Paul
 
public Map<String, String> getAccessToken(String code) {
        HttpRequest req = new HttpRequest();
        Http http = new Http();
        HTTPResponse res;
        
        Map<String, String> access_data = new Map<String, String>();
        access_data.put('grant_type', 'authorization_code');
        access_data.put('client_id', APP_ID);
        access_data.put('client_secret', APP_PW);
        access_data.put('code', code);
        access_data.put('redirect_uri', APP_REDIRECT_URI);
        
        String request_body = (String)JSON.serialize(access_data);
        system.debug(request_body);
        
        req.setHeader('Content-Type', 'application/json');
        req.setEndpoint(APP_TOKEN_URL);
        req.setMethod('POST');
        req.setBody(request_body);
        req.setCompressed(true);

        try {
            res = http.send(req);
            system.debug(res.getBody());
            if (res.getStatusCode() == 400) {
                throw new NoDataFoundException('Bad Server Request'); 
            }
        } catch (Exception e) {
            Map<String, String> failure_response = new Map<String, String>();
            failure_response.put('Response', res.getBody());
            failure_response.put('Request', request_body);
            system.debug(e.getMessage());
            return failure_response;
        }
        
        Map<String, String> json_data = (Map<String, String>)JSON.deserialize(res.getBody(), Map<String, String>.class);
        this.setSessionToken(json_data.get('access_token'));
        
        return json_data;
    }

 
I'm trying to work through this Trailhead subject, but when I get to preview the app, the svg components properties are all "undefined" in the Chrome console window, and nothign displays on the screen.

Something else that I noticed was odd...when I went to create the Lightning Component, iw was like it created a new app: or is that just the way the dev console works?

Just to be sure, this is the Trailhead I am following: https://developer.salesforce.com/trailhead/project/slds-lightning-components-workshop/slds-lc-2
And after I get to Step 3 — Test the SVG Component, and hit "Preview" in the dev console, I get a blank wnite page.

Thanks for any help,
Paul
Hey Peeps!

I'm having an issue that I hope someone can help me with, concerning rendering a list of objects in a VF page.

I have a controller called Ticket, which contains a generic class:
public class Comment {
    Integer id {get; set;}
    String author {get; set;}
    String body {get; set;}
    String created {get; set;}
}
I have a list of these generic classes:
public List<Comment> comments {get {
    Comment [] cmt = this.fetchTicketComments(); 
    return cmt;
}set;}
The method fetchTicketComments calls another method:
private List<Comment> parseTicketComments(String json_string) {
	Comment [] ticket_comments = new List<Comment>();
	Map<String, Object> json_object = (Map<String, Object>) JSON.deserializeUntyped(json_string);
	List<Object> jira_ticket_comments = (List<Object>) json_object.get('comments');
	while (jira_ticket_comments.size() > 0) {
		Comment instance_comment = new Comment();
		Map<String, Object> cmt = (Map<String, Object>) jira_ticket_comments.get(0);
		Map<String, Object> author = (Map<String, Object>) cmt.get('author');
		instance_comment.id = Integer.valueOf(cmt.get('id'));
		instance_comment.author = String.valueOf(author.get('displayName'));
		instance_comment.body = String.valueOf(cmt.get('body'));
		instance_comment.created = Datetime.valueOf(String.valueOf(cmt.get('created')).replace('T', ' ')).format('M/d/y hh:mm a');
		
		ticket_comments.add(instance_comment);
		jira_ticket_comments.remove(0);
	}
	return ticket_comments;
}


Now to display this list of comments along with other data for a Ticket, I have this markup in my VF page:
<apex:pageBlockSection rendered="{!NOT is_new}" id="comment_detail" collapsible="true">
	<apex:repeat value="{!comments}" var="cmt">
		<apex:outputText >Comment:</apex:outputText>
 		<apex:inputTextarea cols="80" rows="4" value="{!cmt.body}" />
	</apex:repeat>
</apex:pageBlockSection>

The problem is that everytime I save, I get this error: 
Compilation error: Unknown property 'Ticket.Comment.body'

I'm confused because comments is a List of Comment objects, and a Comment object has a body property.

I'm fairly new to Apex, but not software development, so this is driving me nuts =)
I'm clearly missing some Java/Apex idiom here.

Thanks for any help.
Paul
Is there anyway through which we can make a voip call without Open CTI in salesforce lightning. I cannot even see a phone symbol beside the phone numbers in my contacts and leads?! 
Hey guys/gals,

I am trying to integrate the Outlook API from MS into a calendar app I'm building in Lightning. I have tried the code below, which I wrote today, but keep getting an error back saying: Malformed JSON. If I don't use JSON and send the request directly as a POST string, I get an error back saying the grant_type parameter is missing...although clearly not.

Any thoughts?

Thanks,
Paul
 
public Map<String, String> getAccessToken(String code) {
        HttpRequest req = new HttpRequest();
        Http http = new Http();
        HTTPResponse res;
        
        Map<String, String> access_data = new Map<String, String>();
        access_data.put('grant_type', 'authorization_code');
        access_data.put('client_id', APP_ID);
        access_data.put('client_secret', APP_PW);
        access_data.put('code', code);
        access_data.put('redirect_uri', APP_REDIRECT_URI);
        
        String request_body = (String)JSON.serialize(access_data);
        system.debug(request_body);
        
        req.setHeader('Content-Type', 'application/json');
        req.setEndpoint(APP_TOKEN_URL);
        req.setMethod('POST');
        req.setBody(request_body);
        req.setCompressed(true);

        try {
            res = http.send(req);
            system.debug(res.getBody());
            if (res.getStatusCode() == 400) {
                throw new NoDataFoundException('Bad Server Request'); 
            }
        } catch (Exception e) {
            Map<String, String> failure_response = new Map<String, String>();
            failure_response.put('Response', res.getBody());
            failure_response.put('Request', request_body);
            system.debug(e.getMessage());
            return failure_response;
        }
        
        Map<String, String> json_data = (Map<String, String>)JSON.deserialize(res.getBody(), Map<String, String>.class);
        this.setSessionToken(json_data.get('access_token'));
        
        return json_data;
    }

 
We are trying to move to Lightning Experience and I have ran into an odd situation.  I have added a custom visualforce action and set the height to 500px.  The action was added to the page layout and is showing up correctly in lightning experience.  The problem is when the user clicks the button the modal box is displayed and the conent area in side the box is 500px high, but the actual content is only 186px height as seen here:

User-added image

If I change the height value declared in the custom action, the height of the model box changes, but the height of the displayed content does not.
Looking into the chrome dev tools inspector there are the following elements that are involved.
 
<div class="modal-body scrollable" style="height: 500px; max-height: 500px;">
This is apparently where the height gets set based on the height setting in custom action definition.
Then we have the following markup:
 
<div class="forceChatterBasePublisher--default forceChatterBasePublisher forceChatterAlohaPagePost">

    <div class="forceChatterPublisherPresentationPanel">
        
        <div class="container activeState">

            <div class="cuf-content">

               ....................
    
            </div>

        </div>

    </div>

</div>

If i manually add "height: 100%;" to these 4 elements in the inspector the content is displayed properly.

If anyone has any idea how to fix this, it would be greatly appreciated.  Thanks
 
Can someone help me code a page leave alert for VF?

I found this code for commandbuttons:
onclick="if(!confirm('Did you do everything?')){return};"

which generates a prompt on the page which is exactly what I want except I need this to occur on page leave instead of on a button click.

My goal is to prevent a user from leaving the page without saving.

I have found the code below online but I am not sure how to swap out the function(e) for the action above.

I want to use the Salesforce alert as the browser will always display my text instead of the hit or miss results I get from this code in different browsers.
<script>
    var LeaveAllowed = false;
    var evt = window.attachEvent || window.addEventListener;
    var checkEvt = window.attachEvent ? 'onbeforeunload' : 'beforeunload';
    evt(checkEvt, function(e) {
        if (!LeaveAllowed)
        {
            var msg = 'There may be unsaved changes.';
            (e || window.event).returnValue = msg;
            return msg;
        }
    });

    function allowLeave()
    {
        LeaveAllowed = true;
    }

</script>

Thanks,
I am not sure what I am missing here which leads me to get some error when I include a lightning component in a visual force page.

Let me brief you my scenario:
I have created a lightning component which has some components in it like <ui:inputNumber> and <force:inputField>. I am using the force:inputField component to show a lookup field on a salesforce object. (Let's say case owner lookup). I have added this component in a lightning application and the component is working fine. When I preview the application, I can see it working.. I can select the user name or queue name on  the force:inputField.

Now when I add the same component in a visual force page (used <apex:includeLightning /> tag in VF page :kindly see the attached code) I am getting below exception:
'Something has gone wrong. Assertion Failed!: Abstract component without provider def cannot be instantiated : markup://force:inputField : undefined. Please try again. '
 Any idea?
Hi All,

Am working on salesforce Lightning, I just wanted to show Full Calander in salesforce Lightning Component. Can someone please help in this regard.

Thanks & Regards,
Ruhulla
Hello everyone.

I'm a developer at a company that provides a service for managing event ticket inventory. We have a lot of customers that use Salesforce.

We would like to introduce a Salesforce App that lets our customers initiate the ticket request process on a Salesforce contact, and also enables the customer to view ticket usage history for contacts within the context Salesforce.

I've read a little bit about the various ways a Salesforce App can be built, but I'm not sure what the best approach would be. Should we be focusing on Lighting Componets and Lightning Apps?

Thanks.
Ok so i am making a application that pulls up a list of Accounts and Contacts. the problem is that when i try to load the tab it goes  "We're still working on your requast.. please wait." its being doing that for 2 days now and i have gone through my components  and  there seems to be nothing  wrong in my code. does anyone have a idea why its doing that?
I'm very new to developing Lightning Apps/Components. I've created a couple of custom components and tied them together via event handling to an off-the-shelf custom component.

I have a few questions that I haven't been able to find answered anywhere:

1) Is it possible in the Lightning App Builder to get access to the events from the various components to tie them together? For example: I'd like a click on the filter list component to cause the record that was clicked to be displayed in a different panel in the app.
2) If the above is not possible, is it possible to open a Lightning Page that was built in Lightning App Builder in the Developer Console so that the events fired by the different components can be viewed and handlers can be created for the events?
3) If the above is not possible, is it possible to use standard components in the Developer Console? When I try to open Lightning Resources, the only components I see are custom ones.
4) Is there some documentation that details the various events that are fired by the standard components?

Thanks for the help.
It seems bizarre that in lightning when you open Accounts, Leads or contacts the default is not to open in the details tab but in another less useful one.  Is there any way of changing this default?  

We moved to Lightnng to help encourage users by making it simpler and more obvious.  This strange default makes it less obvious.

Hi in absence of select distinct can somebody please send me the alternative logic for select distinct in sfdc please?

 

I tried the following link but this logic is not working

 

http://developinthecloud.wordpress.com/2009/06/28/soql-distinct-keyword/

  • March 31, 2010
  • Like
  • 0
How can i get distinct elements from the database? Does SOQL not provide something like unique or distinct?