-
ChatterFeed
-
0Best Answers
-
2Likes Received
-
0Likes Given
-
13Questions
-
6Replies
How to track workflow email actions in Case Activities.
Hi All
We have a requirement like sending email notification to the case contact while creating case in salesforce. For this we have created a workflow email alert on case creation. Its working fine but we need to track email details in salesforce under cases. Is it possible to track email details?
Thanks in Advance!!!
Sravan
- sravan36
- October 31, 2013
- Like
- 0
- Continue reading or reply
REST API Test class code coverage issue
Hi All,
I am trying to write test class for my REST API (POST method) class, i didn't get any errors but i.e showing 0% code coverage. Below are my class and test class.
API class:
@RestResource(urlMapping='/FieldCase/*')
global Class AddComment{
@HttpPOST
global static string addComment(){
String statuscode = '1';
String datetimevalue;
String JSONString;
//Map for returning output Response
Map<String, String> returnMap = new Map<String, String>();
RestRequest req = RestContext.request;
RestResponse res = RestContext.Response;
Blob body = req.requestBody;
String bodyString = body.toString();
Wrapclass deserializedinput = (Wrapclass)JSON.deserialize(bodyString, Wrapclass.class);
Case parentCase = [ Select ID, CaseNumber from Case where CaseNumber =: deserializedinput.Casenum];
CaseComment Commentobject = new CaseComment();
Commentobject.ParentId = parentCase.Id;
Commentobject.CommentBody = deserializedinput.Description;
insert Commentobject;
CaseComment CreatedComment = [Select a.LastModifiedById,LastModifiedDate From CaseComment a where id =:Commentobject.Id];
Datetime dttime =CreatedComment.LastModifiedDate;
datetimevalue = string.valueOf(dttime);
statuscode = '0';
returnMap.put('CreatedDatetime', datetimevalue);
JSONString = JSON.serialize(returnMap);
System.debug('+++Output details+++'+JSONString);
return JSONString ;
}
public class Wrapclass{
public string Casenum;
public string Description;
}
}
Test class:
@isTest(seeallData=true)
Public class AddCommenttest{
public static void AddCommenttest(){
Case cs = new Case(status = 'open');
insert cs;
Case csnum = [select casenumber from Case where Id =: cs.Id];
AddComment.Wrapclass reqst=new AddComment.Wrapclass();
reqst.Casenum= csnum.casenumber;
reqst.Description ='Test comment';
String JsonMsg=JSON.serialize(reqst);
RestRequest req = new RestRequest();
RestResponse res = new RestResponse();
req.requestURI = 'https://ap1.salesforce.com/services/apexrest/FieldCase';
req.httpMethod = 'POST';
req.requestBody = Blob.valueof(JsonMsg);
RestContext.response= res;
RestContext.request = req;
String returnMap = AddComment.addComment();
}
}
Thanks in Advance!!
- sravan36
- October 18, 2013
- Like
- 0
- Continue reading or reply
JSON Deseriolization for Attachments not working
Hi All,
We are trying to do Seriolize and Deseriolize for list of attachments using JSON. But we came across some issue while deseriolizing attachments list the error is like Cannot deserialize instance of base64 from START_OBJECT value . Is it possible to Deseriolize list of attachments? Is there any problem with Blob data to deseriolize?
Below is the JSON code snippet.
list<Attachment> Attchmentslist = [select name,id,Body from Attachment where ParentId =: CId];
String JSonserlz = JSON.serialize(Attchmentslist);
list<Attachment> deserializedAttchmts = (list<Attachment>)JSON.deserialize(JsonSerlz, list<Attachment>.class);
Thanks in Advance!!!
- sravan36
- October 10, 2013
- Like
- 0
- Continue reading or reply
Case Attachments within SOQL Joined query.
Hi All,
I am trying to retrieve Case attachments along with case records as part of my client requirement. But i am getting an error like Binary fields cannot be selected in join queries. Is there any way to get Case and related attachments within a single query . Below is my query
[SELECT Status,casenumber,(SELECT id,name,Body FROM Attachments) FROM Case]
Note: "Body" is must in attachments.
Thanks in Advance!!
Sravan.
- sravan36
- October 03, 2013
- Like
- 1
- Continue reading or reply
Standard API's for CASE,NOTE and ATTACHMENT
HI
We have a requirement for Integration btw SFDC system and External system(Java).
We need to Create different API's for each process like Create Case, Update Case, add Attachment and add Notes.
Is thare any standard API's for Create Case, Update Case, Add Notes and Add Attachment i.e. providing by Salesforce. I think there is a way for Accounts but any possibilites for above requirement.
Thanks,
Sravan.
- sravan36
- September 13, 2013
- Like
- 1
- Continue reading or reply
Single Controller for multiple VF pages
Hi All,
What are the limits/Disadvantages, if we use a single controller/class for multiple VF pages.
Thanks in advance.
- sravan36
- May 20, 2013
- Like
- 0
- Continue reading or reply
Adding Notes&Attachments image file to Visualforce page PDF in Customer Portal.
Hi Guys,
I would like to add Notes&Attachments(From Account object related list) signature image(png) to the PDF page in customer portal, the image is not showing on the pdf file but that is showing as a file. Is this permissions issue
or some other?.
we have used image tag like
<apex:image url="/servlet/servlet.FileDownload?file={!imageid}" rendered="{!image}" height="100" width="300"/>
Thanks.
Thanks.
- sravan36
- April 29, 2013
- Like
- 0
- Continue reading or reply
Text Encrypted Fields on customer portal?
Hi All,
I want to display text encrypted Fields as input text or input field on customer portal with same behavior of text encrypted Fields, but it is showing the original values inplace of mask(means with out XXXXXXXX) please help on this.
Thanks.
- sravan36
- March 23, 2013
- Like
- 0
- Continue reading or reply
Standard objects in sales cloud & Service cloud.
Hi All,
What are the standard objects in sales cloud & Service cloud? is cases object is available in both are not?
Thanks for your help.
- sravan36
- February 18, 2013
- Like
- 0
- Continue reading or reply
Customer Portal Single Sign On.
Hi All,
For customer portal SSO is there any flag/setup in users by which it will not ask them "Change password" on first time login
Thanks,
Sravan
- sravan36
- December 13, 2012
- Like
- 0
- Continue reading or reply
Customer Portal Single Sign On using Web Service call.
Authorization Required
You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SFDCApplication.sforce;
using System.Web.Services.Protocols;
{
public partial class _Default : System.Web.UI.Page
{
private SforceService newService;
protected void Page_Load(object sender, EventArgs e)
{
{
try
{
string userName = "*********@******";
string passWord = "**********";
string orgId = "**************";
string portId = "****************";
LoginScopeHeader header = new LoginScopeHeader();
header.organizationId = orgId;
header.portalId = portId;
newService.LoginScopeHeaderValue = header;
try
{
logRes = newService.login(userName, passWord);
}
catch (SoapException ex)
{
Console.WriteLine(ex.Code);
Console.WriteLine("An unexpected error has occurred: " + ex.Message);
Console.WriteLine(ex.StackTrace);
throw new Exception();
}
{
Console.WriteLine("An error has occurred. Your password has expired.");
throw new Exception();
}
newService.SessionHeaderValue = new SessionHeader();
newService.SessionHeaderValue.sessionId = logRes.sessionId;
{
string redirectURL = "https://<CompanyName>.testing.cs10.force.com/customerportal /apex/viewcases?sessionid=" + logRes.sessionId;
Response.Redirect(redirectURL);
}
}
catch (Exception ex)
{
lblErr.Text = ex.Message;
}
}
}
Also i am getting the same session id again and again instead of different session id's each and every time. Then i just changed my code a little bit.
Instead of redirecting i called the logout() method, which flushes the existing session and again i called the Login() method, which creates a new session id for me. Code change as below
if (logRes.sessionId != "" && logRes.sessionId != string.Empty)
{
this.newService.logout();
logRes = newService.login(userName, passWord);
string redirectURL = "https://<CompanyName>.testing.cs10.force.com/customerportal /apex/viewcases?sessionid=" + logRes.sessionId;
Response.Redirect(redirectURL);
}
- luckily it worked and i was getting a new session id each and every time.
After this also i am getting the same error as
Error: File Not Found.
Authorization Required
You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
What is wrong in this, am i missing out anything in code. Any suggestions and ideas will be appreciated.
Thanks in advance.
- sravan36
- December 11, 2012
- Like
- 0
- Continue reading or reply
Customer Portal Single Sign On using Web Service call.
Authorization Required
You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SFDCApplication.sforce;
using System.Web.Services.Protocols;
{
public partial class _Default : System.Web.UI.Page
{
private SforceService newService;
protected void Page_Load(object sender, EventArgs e)
{
{
try
{
string userName = "*********@******";
string passWord = "**********";
string orgId = "**************";
string portId = "****************";
LoginScopeHeader header = new LoginScopeHeader();
header.organizationId = orgId;
header.portalId = portId;
newService.LoginScopeHeaderValue = header;
try
{
logRes = newService.login(userName, passWord);
}
catch (SoapException ex)
{
Console.WriteLine(ex.Code);
Console.WriteLine("An unexpected error has occurred: " + ex.Message);
Console.WriteLine(ex.StackTrace);
throw new Exception();
}
{
Console.WriteLine("An error has occurred. Your password has expired.");
throw new Exception();
}
newService.SessionHeaderValue = new SessionHeader();
newService.SessionHeaderValue.sessionId = logRes.sessionId;
{
string redirectURL = "https://<CompanyName>.testing.cs10.force.com/customerportal /apex/viewcases?sessionid=" + logRes.sessionId;
Response.Redirect(redirectURL);
}
}
catch (Exception ex)
{
lblErr.Text = ex.Message;
}
}
}
Also i am getting the same session id again and again instead of different session id's each and every time. Then i just changed my code a little bit.
Instead of redirecting i called the logout() method, which flushes the existing session and again i called the Login() method, which creates a new session id for me. Code change as below
if (logRes.sessionId != "" && logRes.sessionId != string.Empty)
{
this.newService.logout();
logRes = newService.login(userName, passWord);
string redirectURL = "https://<CompanyName>.testing.cs10.force.com/customerportal /apex/viewcases?sessionid=" + logRes.sessionId;
Response.Redirect(redirectURL);
}
- luckily it worked and i was getting a new session id each and every time.
After this also i am getting the same error as
Error: File Not Found.
Authorization Required
You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
What is wrong in this, am i missing out anything in code. Any suggestions and ideas will be appreciated.
Thanks in advance.
- sravan36
- December 11, 2012
- Like
- 0
- Continue reading or reply
Customer Portal Single Sign On using Web Service call.
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SFDCApplication.sforce;
using System.Web.Services.Protocols;
{
public partial class _Default : System.Web.UI.Page
{
private SforceService newService;
protected void Page_Load(object sender, EventArgs e)
{
{
try
{
string userName = "*********@******";
string passWord = "**********";
string orgId = "**************";
string portId = "****************";
LoginScopeHeader header = new LoginScopeHeader();
header.organizationId = orgId;
header.portalId = portId;
newService.LoginScopeHeaderValue = header;
try
{
logRes = newService.login(userName, passWord);
}
catch (SoapException ex)
{
Console.WriteLine(ex.Code);
Console.WriteLine("An unexpected error has occurred: " + ex.Message);
Console.WriteLine(ex.StackTrace);
throw new Exception();
}
{
Console.WriteLine("An error has occurred. Your password has expired.");
throw new Exception();
}
newService.SessionHeaderValue = new SessionHeader();
newService.SessionHeaderValue.sessionId = logRes.sessionId;
{
string redirectURL = "https://<CompanyName>.testing.cs10.force.com/customerportal /apex/viewcases?sessionid=" + logRes.sessionId;
Response.Redirect(redirectURL);
}
}
catch (Exception ex)
{
lblErr.Text = ex.Message;
}
}
}
Also i am getting the same session id again and again instead of different session id's each and every time. Then i just changed my code a little bit.
Instead of redirecting i called the logout() method, which flushes the existing session and again i called the Login() method, which creates a new session id for me. Code change as below
if (logRes.sessionId != "" && logRes.sessionId != string.Empty)
{
this.newService.logout();
logRes = newService.login(userName, passWord);
string redirectURL = "https://<CompanyName>.testing.cs10.force.com/customerportal /apex/viewcases?sessionid=" + logRes.sessionId;
Response.Redirect(redirectURL);
}
- luckily it worked and i was getting a new session id each and every time.
After this also i am getting the same error as
Error: File Not Found.
Authorization Required
You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
What is wrong in this, am i missing out anything in code. Any suggestions and ideas will be appreciated.
Thanks in advance.
- sravan36
- December 11, 2012
- Like
- 0
- Continue reading or reply
Case Attachments within SOQL Joined query.
Hi All,
I am trying to retrieve Case attachments along with case records as part of my client requirement. But i am getting an error like Binary fields cannot be selected in join queries. Is there any way to get Case and related attachments within a single query . Below is my query
[SELECT Status,casenumber,(SELECT id,name,Body FROM Attachments) FROM Case]
Note: "Body" is must in attachments.
Thanks in Advance!!
Sravan.
- sravan36
- October 03, 2013
- Like
- 1
- Continue reading or reply
Standard API's for CASE,NOTE and ATTACHMENT
HI
We have a requirement for Integration btw SFDC system and External system(Java).
We need to Create different API's for each process like Create Case, Update Case, add Attachment and add Notes.
Is thare any standard API's for Create Case, Update Case, Add Notes and Add Attachment i.e. providing by Salesforce. I think there is a way for Accounts but any possibilites for above requirement.
Thanks,
Sravan.
- sravan36
- September 13, 2013
- Like
- 1
- Continue reading or reply
JSON Deseriolization for Attachments not working
Hi All,
We are trying to do Seriolize and Deseriolize for list of attachments using JSON. But we came across some issue while deseriolizing attachments list the error is like Cannot deserialize instance of base64 from START_OBJECT value . Is it possible to Deseriolize list of attachments? Is there any problem with Blob data to deseriolize?
Below is the JSON code snippet.
list<Attachment> Attchmentslist = [select name,id,Body from Attachment where ParentId =: CId];
String JSonserlz = JSON.serialize(Attchmentslist);
list<Attachment> deserializedAttchmts = (list<Attachment>)JSON.deserialize(JsonSerlz, list<Attachment>.class);
Thanks in Advance!!!
- sravan36
- October 10, 2013
- Like
- 0
- Continue reading or reply
Code coverage
Hi I am testing my triggers and getting problems to write test method for triggers as i am new to test methods. Here is my trigger. the problem that i facing is due to three different objects are used in my trigger. Please review this code for trigger that i wrote. Thanks in advance.
Trigger Code:
trigger RiskConvInsert on JunctionRiskRiskSearch__c (after insert)
{
List<JunctionRiskSearchConvJunc__c> juncRRSCJ = new List<JunctionRiskSearchConvJunc__c>();
for(JunctionRiskRiskSearch__c jrsc: Trigger.New)
{
List<Risk_Conversation__c> riskConv = [Select Id from Risk_Conversation__c where Risk_Search__c =: jrsc.Risk_Searches__c];
for(Risk_Conversation__c riskConvRec: riskConv)
{
JunctionRiskSearchConvJunc__c junRec = new JunctionRiskSearchConvJunc__c();
junRec.Risk_Conversations__c = riskConvRec.Id;
junRec.JunctionRiskSearch__c = jrsc.Id;
juncRRSCJ.add(junRec);
}
insert juncRRSCJ;
}
}
- sandip87
- October 04, 2013
- Like
- 0
- Continue reading or reply
Custom field not writeable for Sites user
Hello.
I am writing a Visualforce controller that creates a custom object. The controller is for a page in a Sites site.
The code compiles ok, but when I run it, I get the error "Field is not writeable".
When I go to the Sites user profile, all the fields are visible and the object has all the permissions (read/create/edit/delete/view all/modify all)
Any thoughts?
Carl
- CarlB
- October 03, 2013
- Like
- 0
- Continue reading or reply
Case Attachments within SOQL Joined query.
Hi All,
I am trying to retrieve Case attachments along with case records as part of my client requirement. But i am getting an error like Binary fields cannot be selected in join queries. Is there any way to get Case and related attachments within a single query . Below is my query
[SELECT Status,casenumber,(SELECT id,name,Body FROM Attachments) FROM Case]
Note: "Body" is must in attachments.
Thanks in Advance!!
Sravan.
- sravan36
- October 03, 2013
- Like
- 1
- Continue reading or reply
Roll-up feature for Assets object
I seriously need to be able to create a Roll-up field on Accounts for the Assets object, but it doesn't display as an option in the "Summarize Object" drop down when I go to create the field.
Can anyone tell me how to get Assets as an object there?
Thanks!
- adrissel
- September 06, 2013
- Like
- 0
- Continue reading or reply
Popup for individual field
i want to dispaly the popup for the field value when i doubleclick on that particular field value............example plz(Using javascript or Vf)
thanks
=============
VenkatSforce89
- venkatsforce
- March 06, 2013
- Like
- 0
- Continue reading or reply