• Gopi chand 11
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
System.JSONException: Unexpected character (',' (code 44)): was expecting a colon to separate field name and value at [line:1, column:15]
I am having an issue in a test class where I am generating a mock JSON string.
 I am getting an exception error on the string,
 but I am not sure what is wrong with the string format. In the debug log I received the following error message:
System.JSONException: Unexpected character (',' (code 44)): was expecting a colon to separate field name and value at [line:1, column:15]
I have included the JSON string below:

My Class code:

HttpRequest accessTokenReq = new HttpRequest();
        HttpResponse accessTokenRes = new HttpResponse();
        Http accessTokenHttp= new Http();
        accessTokenReq.setMethod('POST');
        accessTokenReq.setEndpoint('My Url');
        accessTokenRes = accessTokenHttp.send(accessTokenReq);
        Map<String,Object> responseMap = (Map<String, Object>) JSON.deserializeUntyped(accessTokenRes.getBody());
        String access_token = (String)responseMap.get('access_token');
        System.debug(access_token);
My test class code :

isTest
global class MockHttpResponseGenerator implements HttpCalloutMock {
   
    global HTTPResponse respond(HTTPRequest req) {
        
    
        HttpResponse res = new HttpResponse();
        res.setHeader('Content-Type', 'text\\csv');
        res.setBody('{"EVENT_TYPE","TIMESTAMP","REQUEST_ID","ORGANIZATION_ID","SESSION_ID","USER_ID","USER_TYPE","CONTEXT","ENTITY","LANGUAGE","LAST_VERSION","ARTICLE_STATUS","ARTICLE_ID","ARTICLE_VERSION_ID","USERNAME","ARTICLE_VERSION","TIMESTAMP_DERIVED"\n"KnowledgeArticleView","20171106090422.918","4EGnl6nFNZWltlF1v7x_4-","00D1g0000008bXG","5Frlit+6RHn683d4AUh2Y87rsBNcNKZpCju+0yUIo5Y=","00536000006CZAI","A","apex","Knowledge__kav","en_US","1","o","kA01g000000CahZ","ka01g000000CanM","","2","2017-11-06T09:04:22.918Z"\n"KnowledgeArticleView","20171106090510.556","4EGnntNC_IDBUGF1v7liV-","00D1g0000008bXG","5Frlit+6RHn683d4AUh2Y87rsBNcNKZpCju+0yUIo5Y=","00536000006CZAI","A","apex","Knowledge__kav","en_US","1","o","kA01g000000Cahe","ka01g000000CanR","","1","2017-11-06T09:05:10.556Z"}');
        
        res.setStatusCode(200);
        return res;
    }
}

Does anyone have any idea what could be incorrect with this string format in relation to the error message?

Thanks so much!
Could any one worked on the knoweldge article??
I want to know the one atrice how time viewed by particular one User (Total count of  artical view times for each User)?? I need to create report for that data??

My Way Answer:
I gone through the Event file log is an object.. In this object we have field called Event type=Knowledgeviewstate (Winer 18 update ). So i am thinking is we have a data in knowledgeviewstate but that was stored in file .. i want store the data into one cutsom object and show report from that custom object?
see below screen?
Test
in logfile i have data i want the data into csv file through apex and store in to my custom object? 
Any one have  idea how to concert data and store into Custom Object ??
 i would like to know ecah and every user and view count saparetly ??...Expl..one articel each user how many times viewd and that user name also i want display ??
Thank you!
How to Delete the Managed Package Workflow Outbound Message ??Can any One give any guidence for how to delete the Workflow outbound Message (The Workflow in Managed Package I dont Have Delete Option ) 
Maximum view state size limit (135KB) exceededHow can I avoid this error? I read similar post without getting any working solutions for me. When I try to upload file larger than about 900KB, I get the error. Please guide me .
Could any one worked on the knoweldge article??
I want to know the one atrice how time viewed by particular one User (Total count of  artical view times for each User)?? I need to create report for that data??

My Way Answer:
I gone through the Event file log is an object.. In this object we have field called Event type=Knowledgeviewstate (Winer 18 update ). So i am thinking is we have a data in knowledgeviewstate but that was stored in file .. i want store the data into one cutsom object and show report from that custom object?
see below screen?
Test
in logfile i have data i want the data into csv file through apex and store in to my custom object? 
Any one have  idea how to concert data and store into Custom Object ??
 i would like to know ecah and every user and view count saparetly ??...Expl..one articel each user how many times viewd and that user name also i want display ??
Thank you!
Hello,

Hello,

I have a email template like below, I want to add a link to custom object flash__c.


Hello,

A new flash is created for: {!Opportunity.Name} 

Thanks
  • August 27, 2015
  • Like
  • 0

Hi,

 

I am trying to use the href html tag in an email template.  When the email comes through it looks just like I enterd it on the template when I am in edit mode!!!

 

Can email templates use html tag and if they can, how can I get the href tag to work.

 

See below which is not working in an HTML template...

 

HTML Edit Mode:

Name: <a href="https://na7.salesforce.com/{!Opportunity.Id}">{!Opportunity.Name}</a>

 

 

Results in the email: 

Name: <a href="https://na7.salesforce.com/006A0000009NRAP">Edge SLA TESTING</a>