- salesforcesss_deveoper211
- NEWBIE
- 0 Points
- Member since 2012
-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
8Questions
-
6Replies
Salesforce Omni-channel "Units of Capacity" in routing configurations
- salesforcesss_deveoper211
- September 29, 2016
- Like
- 0
- Continue reading or reply
JSON Parser to Parse LinkedIn education response
Can someone pls help me to derive a method to parse this linkedin education response. I want to store this data into custom sfdc object. Thanks.
{"educations": {
"_total": 2,
"values": [
{
"activities": "Debate team",
"degree": "Bachelor of Commerce (B.Com.)",
"endDate": {"year": 2014},
"fieldOfStudy": "",
"id": 219318342,
"schoolName": "The University of Texas at Austin",
"startDate": {"year": 2010}
},
{
"endDate": {"year": 2007},
"id": 219316871,
"schoolName": "University of California, Los Angeles",
"startDate": {"year": 2005}
}
]
}}
The method which I developed only captures one set of education data and igonres other, so just wanted to confirm my method. Also how can I parse startDate and endDate into date field of sfdc.
public void parseEduJSON(String JSONEduStr){
if (JSONEduStr != null){
linkedInEducation = new List<Education__c>();
JSONParser parser = JSON.createParser(JSONEduStr);
while (parser.nextToken() != null)
{
if (parser.getCurrentToken() == JSONToken.START_OBJECT)
{
while (parser.nextToken() != JSONToken.END_OBJECT)
{
if (parser.getCurrentToken() == JSONToken.START_ARRAY)
{
Education__c ei = new Education__c();
while (parser.nextToken() != JSONToken.END_ARRAY)
{
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'activities'))
{
parser.nextToken() ;
ei.Activities__c = parser.getText();
}
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'degree'))
{
parser.nextToken() ;
ei.Degree__c = parser.getText();
}
/*if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'endDate'))
{
parser.nextToken() ;
ei.End_Date__c = parser.getDateValue();
} */
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'fieldOfStudy'))
{
parser.nextToken() ;
ei.Field_of_Study__c = parser.getText();
}
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'id'))
{
parser.nextToken() ;
ei.LinkedIn_Educations_ID__c = parser.getText();
}
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'schoolName'))
{
parser.nextToken() ;
ei.Name = parser.getText();
}
/*if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'startDate'))
{
parser.nextToken() ;
ei.Start_Date__c = parser.getDateValue();
}*/
}
linkedInEducation.add(ei);
system.debug('>>>>>>>>>>>>>>>>final education'+linkedInEducation+'<<<<<<<<<<');
}
}
}
}
if(linkedInEducation.size()>0 || linkedInEducation.isEmpty() == False){
upsert linkedInEducation LinkedIn_Educations_ID__c;
}
}
}
- salesforcesss_deveoper211
- May 13, 2014
- Like
- 0
- Continue reading or reply
JSON Parser to Parse LinkedIn education responce.
Can someone pls help me to derive a method to parse this linkedin education response. I want to store this data into custom sfdc object. Thanks.
{"educations": {
"_total": 2,
"values": [
{
"activities": "Debate team",
"degree": "Bachelor of Commerce (B.Com.)",
"endDate": {"year": 2014},
"fieldOfStudy": "",
"id": 219318342,
"schoolName": "The University of Texas at Austin",
"startDate": {"year": 2010}
},
{
"endDate": {"year": 2007},
"id": 219316871,
"schoolName": "University of California, Los Angeles",
"startDate": {"year": 2005}
}
]
}}
The method which I developed only captures one set of education data and igonres other, so just wanted to confirm my method. Also how can I parse startDate and endDate into date field of sfdc.
public void parseEduJSON(String JSONEduStr){
if (JSONEduStr != null){
linkedInEducation = new List<Education__c>();
JSONParser parser = JSON.createParser(JSONEduStr);
while (parser.nextToken() != null)
{
if (parser.getCurrentToken() == JSONToken.START_OBJECT)
{
while (parser.nextToken() != JSONToken.END_OBJECT)
{
if (parser.getCurrentToken() == JSONToken.START_ARRAY)
{
Education__c ei = new Education__c();
while (parser.nextToken() != JSONToken.END_ARRAY)
{
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'activities'))
{
parser.nextToken() ;
ei.Activities__c = parser.getText();
}
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'degree'))
{
parser.nextToken() ;
ei.Degree__c = parser.getText();
}
/*if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'endDate'))
{
parser.nextToken() ;
ei.End_Date__c = parser.getDateValue();
} */
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'fieldOfStudy'))
{
parser.nextToken() ;
ei.Field_of_Study__c = parser.getText();
}
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'id'))
{
parser.nextToken() ;
ei.LinkedIn_Educations_ID__c = parser.getText();
}
if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'schoolName'))
{
parser.nextToken() ;
ei.Name = parser.getText();
}
/*if((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&(parser.getText() == 'startDate'))
{
parser.nextToken() ;
ei.Start_Date__c = parser.getDateValue();
}*/
}
linkedInEducation.add(ei);
system.debug('>>>>>>>>>>>>>>>>final education'+linkedInEducation+'<<<<<<<<<<');
}
}
}
}
if(linkedInEducation.size()>0 || linkedInEducation.isEmpty() == False){
upsert linkedInEducation LinkedIn_Educations_ID__c;
}
}
}
- salesforcesss_deveoper211
- May 13, 2014
- Like
- 0
- Continue reading or reply
apex:datatable join column headers
Hi
I want to create table which has column headers spanning over 2 rows & 3columns please find attached sample table.
Please let me me know how can I do it with apex:datatable & apex:column.
Thanks.
- salesforcesss_deveoper211
- August 17, 2012
- Like
- 0
- Continue reading or reply
Put page no on visualforce page print page (renderAs html)
Hi,
I am setting "printurl" attribute of apex:sectionHeader tag which is set to a visualforce page and this VF page is renderAs "html". What I am looking for is, can I put page number on this VF page whichis renderAs html, in community I can find code to embed page number for pdf rendered VF pages but how can I embed page numbers for html render VF page.
Thanks.
- salesforcesss_deveoper211
- June 18, 2012
- Like
- 0
- Continue reading or reply
Apex:InutField html table with required red mark
Hi,
I have created a metrics using html table & apex:inputfield, here I set required attribute to true for field, but as I am adjusting the size of the inputfield the mandatory red mark appears on border of the table instaed of on field. Here is the code snipet,
Also attached below how the field looks like in table. So how can i get the red mark near field.
- salesforcesss_deveoper211
- June 18, 2012
- Like
- 0
- Continue reading or reply
line breaks on apex:inputfield when set required="true"
Hi,
I am using html table to create matrics, but on header row when I set required=ture for inputfield the line break gets added.
Please find below code snipet. I am not able to upload screenshot but the header cell has 2 rows instead of 1. So how can I put both inputfield & text in one line. Thanks!
<Table border="1" STYLE="border: 1px solid gray; border-collapse: collapse; border-spacing: 10pt 5pt" class="AItable" id="AITable">
<tr>
<th STYLE="background-color: #DDECF3; text-align:center;">Col1</th>
<th STYLE="background-color: #DDECF3; text-align:center; width:12%;">Col2</th>
<th STYLE="background-color: #DDECF3; text-align:center; vertical-align:middle;">YTD:
<apex:inputField value="{!CustomObj.Date1__c}" required="True" label="" style="width:40%;"/>
</th>
</Table>
- salesforcesss_deveoper211
- June 12, 2012
- Like
- 0
- Continue reading or reply
Get profile name in apex trigger
Hi,
Can we get $Profile.Name = "System Administrator" in apex trigger.
If no then how can I check if the current user is system admin or not.
Thaks.
- salesforcesss_deveoper211
- May 29, 2012
- Like
- 0
- Continue reading or reply
apex:datatable join column headers
Hi
I want to create table which has column headers spanning over 2 rows & 3columns please find attached sample table.
Please let me me know how can I do it with apex:datatable & apex:column.
Thanks.
- salesforcesss_deveoper211
- August 17, 2012
- Like
- 0
- Continue reading or reply
Apex:InutField html table with required red mark
Hi,
I have created a metrics using html table & apex:inputfield, here I set required attribute to true for field, but as I am adjusting the size of the inputfield the mandatory red mark appears on border of the table instaed of on field. Here is the code snipet,
Also attached below how the field looks like in table. So how can i get the red mark near field.
- salesforcesss_deveoper211
- June 18, 2012
- Like
- 0
- Continue reading or reply
line breaks on apex:inputfield when set required="true"
Hi,
I am using html table to create matrics, but on header row when I set required=ture for inputfield the line break gets added.
Please find below code snipet. I am not able to upload screenshot but the header cell has 2 rows instead of 1. So how can I put both inputfield & text in one line. Thanks!
<Table border="1" STYLE="border: 1px solid gray; border-collapse: collapse; border-spacing: 10pt 5pt" class="AItable" id="AITable">
<tr>
<th STYLE="background-color: #DDECF3; text-align:center;">Col1</th>
<th STYLE="background-color: #DDECF3; text-align:center; width:12%;">Col2</th>
<th STYLE="background-color: #DDECF3; text-align:center; vertical-align:middle;">YTD:
<apex:inputField value="{!CustomObj.Date1__c}" required="True" label="" style="width:40%;"/>
</th>
</Table>
- salesforcesss_deveoper211
- June 12, 2012
- Like
- 0
- Continue reading or reply
How to override the 'submit for approval' button?
In my opportunity object.When the stage is changed.I need different approval process.I want to add different button for different approval process.I think I can write the Apex for calling the approval process.But how to use the default approval dialog?
Thanks
- miku
- December 02, 2011
- Like
- 0
- Continue reading or reply
VisualForce transposed table - help with design options, please
Hi,
I need to display rows of a Salesforce object for data entry (eg product line items).
Each object has numerous fields (more than 20), and there are only a few rows (eg 5).
It would be much more practical my objects as columns in a VisualForce datatable, but that will be very complicated
- 1 or several transient classes to transform the Salesforce model into the displayed model
- 1 custom component for each different "complex" Salesforce type (date, lookup, selection list, etc.), since the VF page will no longer be displaying sObjects
- etc.
Is there a quicker way to benefit from all the standard Salesforce and VisualForce stuff (eg InputField instead of Inputtext) in a view where standard rows are transposed into columns ?
Thanks for any intelligent design ideas,
Rup
- @altius_rup
- November 10, 2011
- Like
- 0
- Continue reading or reply