• Prakash GB
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 15
    Replies
How can I upload a larger file from a lightning custom component? I don't have record ID at the time of file selection
Hi,

is it possible to have custom toast message on list view page? my requirement is, i have inlcuded list buttons on list view. after completeing action need to show alert message to user.

Thanks in advance
Prakash GB
Hi,
Does anyone know how to have a custom button on lightning service console case detail page.
I tried enough but no luck.

Or any alternative to call a flow or lightning component from Lightning case console.

Thanks
Prakash GB
Hi,

i have requirement to upload a file clicking on a link on lightning component. is it possible to fire lightning:fileupload from controller.js?

Thanks
Prakash GB
Hi,

Can anyone help me, How to manage sessions when SF & other applications are connected?

Assume i make a callout to External application and authenticate and recieve session id. next when i am making a post request, how can i use the session id to bypass authentication again? what is the best way to store session id in salesforce?

Thanks
Prakash GB
 
I need to get user infromation from the user profile(Not salesforce, from web application profile) and store it in the transcripts. can anyone help me?

live chat will be residing in a web application. user needs to login to web application to initiate chat.

Can this be done with any API or modifying JS?

Thanks
Prakash GB
i need to redirect to a detailed record page after clicking on a button in the record detail page. how should i achieve this with apex code for a community page.
i need to send more than 10 emails by apex code from my developer- org. does email relay helps? or any other way to achieve this?
hi,
how can i rerender a lightning componet after closing a ui:message in it.
 
Hi,

User-added image

i need to disbale these buttons when i click on it. these are salesforce object buttons which will call a vf page and a controller, then it renders back to same page with some fileds updation. could anyone fix this.

Thank you.
unable to upload a file using REST callout from one salesforce org to another org. the following JSON parser error i'm getting. could anyone solve the issue.
13:00:59:056 USER_DEBUG [48]|DEBUG|[{"message":"Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [line:1, column:2]","errorCode":"JSON_PARSER_ERROR"}]

here is the code which i've written.
 
attachment att=[Select Id, Name, Body, ContentType,parentid from attachment where ID = '00P7F000000mF2JUAU'];
blob file_body=att.body;
string file_name=att.name;
String boundary = '--741e90d31eff--';
ContentType="'+att.ContentType+'";\nContent-Type: application/octet-stream';
String header ='--'+boundary+'\nContent-Disposition: form-data; name="entitydocument";\n';
header +='Content-Type : application/json;\n';
header +='{\n"Keywords":"marketing",\n"Name" : "Marketing",\n"parentid" : "0019000000ldtMWAAY",\n "ContentType" : "'+att.ContentType+'"\n}\n--'+boundary+'----';
String footer ='--'+boundary+'--';             
String headerEncoded = EncodingUtil.base64Encode(Blob.valueOf(header+'\r\n\r\n'));
while(headerEncoded.endsWith('='))
{
    header+='  ';
    headerEncoded = EncodingUtil.base64Encode(Blob.valueOf(header+'\r\n\r\n'));
}
String bodyEncoded = EncodingUtil.base64Encode(file_body);
Blob bodyBlob = null;
String last4Bytes = bodyEncoded.substring(bodyEncoded.length()-4,bodyEncoded.length());
if(last4Bytes.endsWith('==')) {
    last4Bytes = last4Bytes.substring(0,2) + '0K';
    bodyEncoded = bodyEncoded.substring(0,bodyEncoded.length()-4) + last4Bytes;
    String footerEncoded = EncodingUtil.base64Encode(Blob.valueOf(footer));
    bodyBlob = EncodingUtil.base64Decode(headerEncoded+bodyEncoded+footerEncoded);
} else if(last4Bytes.endsWith('=')) {
    last4Bytes = last4Bytes.substring(0,3) + 'N';
    bodyEncoded = bodyEncoded.substring(0,bodyEncoded.length()-4) + last4Bytes;
    footer = '\n' + footer;
    String footerEncoded = EncodingUtil.base64Encode(Blob.valueOf(footer));
    bodyBlob = EncodingUtil.base64Decode(headerEncoded+bodyEncoded+footerEncoded);              
} else {
    
    footer = '\r\n' + footer;
    String footerEncoded = EncodingUtil.base64Encode(Blob.valueOf(footer));
    bodyBlob = EncodingUtil.base64Decode(headerEncoded+bodyEncoded+footerEncoded);  
}
HttpRequest req = new HttpRequest();
req.setHeader('Content-Type','multipart/form-data; boundary='+boundary);
req.setHeader('accept','application/octet-stream');
req.setMethod('POST');
req.setHeader('Authorization','Bearer 00D7F000000yKem!ARoAQGPBdNrjxwJMHE9Buos1MUd4KwYfxmIb1Hchy8PyolBqzyEeNAV*************************************');

req.setEndpoint('https://ap5.my.salesforce.com/services/data/v40.0/sobjects/Attachment/');
req.setBodyAsBlob(bodyBlob);
req.setTimeout(120000);
Http http = new Http();
HTTPResponse res = http.send(req);
system.debug(res.getbody());
system.debug(header);

thanks.​
How can I upload a larger file from a lightning custom component? I don't have record ID at the time of file selection
Hi,

is it possible to have custom toast message on list view page? my requirement is, i have inlcuded list buttons on list view. after completeing action need to show alert message to user.

Thanks in advance
Prakash GB
Hi,

i have requirement to upload a file clicking on a link on lightning component. is it possible to fire lightning:fileupload from controller.js?

Thanks
Prakash GB
Hi,

Can anyone help me, How to manage sessions when SF & other applications are connected?

Assume i make a callout to External application and authenticate and recieve session id. next when i am making a post request, how can i use the session id to bypass authentication again? what is the best way to store session id in salesforce?

Thanks
Prakash GB
 
Hi,

I'm trying to validate a class but I'm stuck in this error:

System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out 
Stack Trace: Class.TeacherApplyNewController.adBloomRequest: line 153, column 1


This is the block of code causing the error:
@future(callout=true)
    public static void adBloomRequest(String contactId, String transactionId) {
        if( !String.isBlank(transactionId) && !String.isBlank(contactId) ) { 
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            req.setEndpoint('https://trk.adbloom.co/SPMj?transaction_id=' + transactionId + '&adv_sub=' + contactId );
            req.setMethod('GET');
            HttpResponse res = h.send(req);
        }
    }

I'm not familiar with writing classes, so in this scenario how could I modify the code to make sure it doesn't produce the aforementioned error?

Thanks in advance.
Stefano
Hi,
I am planing to take pd2 certification. I came to know that pd1 is mandatory for pd2. 

I want to know that how to take pd1 certification also do we need to complete any other certification for pd1?
i need to send more than 10 emails by apex code from my developer- org. does email relay helps? or any other way to achieve this?
Hello,

I'm getting the following error after I use Username-Password OAuth Authentication Flow, and it returns a token successfully. This error appears intermittently. Can anyone assist me? I'd grealty appreciate it.

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

​Thanks
  • November 15, 2017
  • Like
  • 0
hi,
how can i rerender a lightning componet after closing a ui:message in it.
 
Is there any way we can find out how many agents of a skill are online through apex code? We can see the number of agents online through supervisor console, but I need to get it on run time throgh code. The requirement is to disable the button when the chat queue reaches 150% of available online agents. 
I need to have lists refresh when a new record is added. I would think that the Choose How Lists Refresh option and Push Notifications handle this, but that does not seem to work. Please help!