• code developer
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 31
    Questions
  • 14
    Replies
Hi,

We need to implement document preview in visualforce. the document may be image, pdf,ppt,word.
This is similar to chatter file previewer. I have gone through some hacks in salesforce,but if salesforce changes might reflect the functionality in future.

Any inputs or code samples are highly appreciated. Thank you

Hi,

We are currently using salesforce standard email approval process.We enabled "Enable Email Approval Response"  checkbox in approval settings.
When a user submits a record for approval, approver will get an email.

Requirement :

We need to capture "Reply to " address of the email which is received by approver.

Can we get the email specified in screen shot  through apex?

Is the mail id specified in below screen shot specific to org or will it change for each approval email?


  User-added image
Hi,

We are approving a record using apex.

We are updating the actor id in Process InstanceWorkitem object with desired approver.
But, the record is not getting approved with actual approver.

Can we change the actual approver of the record?

Hi,

 

We have https://json2apex.herokuapp.com  to deserialize json to apex class.

 

Similarly I need to deserialise XML to apex class.

 

Are there any tools like above mentioned url to deserialise xml to apex.

 

Thanks

Hi,

 

 

I need to  override pagblock section title.

I am using customer portal. the   pagblock section titles look different in color in portal and dev org.

 

I want the pagblock section titles to be in the same color as they are in portal.

 

Any pointers on this is highly appreciated.

 

Thanks.

 

 

Hi,

 

Scenario 1:

--------------------

I am using a Wrapper class to prepare a List<Wrapper> in ctrlr using action function.

 

When the action function gets invoked, I am able to prepare the List<Wrapper>.

 

I have declared the  List<Wrapper>. as Controller variable.

 

Scenario 2:

----------------

 

Upon another ui action(say on click of radio button), am invoking another action function.

 

In the controller,when I tried to access the List<Wrapper> prepared earlier, I am getting null.

 

The constructor doesnot get invoked between scenario1 and scenario 2.

 

Could any one please help me.

 

 

 

 

Hi all,

 

 

I am using apex out put text in customer portal.

 

the text is overflowing out of the pageblock section.could any one pls help me how to wrap the text in customer portal.

the page is well when viewed in salesforce org.

 

thanks

Hi,

 

I am displaying a percent field in a vf page.

By default the field is getting populated with value 0.

But i need the field to be blank by default.

pls help me out.

Hi ,

 

We need to develop an application which contains some Terms & Conditions.

 

These terms and conditions contains nested question and answers.

 

we need to design in such a way that if end user creates a new question in custom object,the reflection should be done in vf page.

 

Kindly respond if any one has implemented such an usecase.

Hi,

 

I am getting this error Getting Organisation Administration locked Error  even there were no schedulable jobs or batch jobs or test classes in queue or running. I have tried the following :

 

 

List<AsyncApexJob> ctList = [Select a.Status From AsyncApexJob a where status!='Completed' ];
for(AsyncApexJob ct : ctlist){
system.abortjob(ct.id);
}

 

 

List<ApexTestQueueItem> items = [Select Id,ApexClassId,Status,ExtendedStatus,ParentJobId from ApexTestQueueItem where Status != 'Completed'];
for(ApexTestQueueItem atqi : items) {
atqi.Status = 'ABORTED';
}
update items;

 

 

 

List<CronTrigger> ctList = [Select c.State, c.Id From CronTrigger c where state!='COMPLETE' limit 50000];
for(CronTrigger ct : ctlist){
system.abortjob(ct.id);
}

 

 

But I didnt find any change. Please help me out.

 

Thanks

 

Hi,

 

I am new to Salesforce Knowledge base. I am unable to see Translations Tab in View area of Article management Tab.

 

From the url : https://help.salesforce.com/HTViewHelpDoc?id=knowledge_article_manage.htm&language=en_US

 

in the Choosing Articles to View  section, I have not found any Translations Tab.

 

 

Please help me out.

Hi

 

 

I have a List<Object>. I need to cast this to List<A> say :

 

(List<A>) List<Object>.

 

 

but  I am getting System.TypeException: Invalid conversion from runtime type LIST<ANY> to LIST<A>.

 

 

pls help me out

 

 

 

Is there any way to get  object from json response other than deserialize untyped(As it supports only for primitive data types)?

 

 

Hi,

 

I am new to Chatter development. I have the following usecase:

 

I need to post the response that I get from REST API call (Http request call out made to a Url ) to chatter.

 

Please suggest me the required documentation as well as approach to solve this use case.

 

Thanks in Advance.

Hi,

I am new apex and visualforce. I have simple question. Why we write "static" keyword for test methods.

Thanks in advance.

Hi,

 

I am using Force.com ide plugin in Eclipse Helios. Currently it is version 23.0.

could any one suggest me on how to update the force.com ide to version 26.0?

Hi,

 

Is there any way to do multiple call outs in a single txn where there are DML operations?

Hi,

 

I am using MultiStaticResourceCalloutMock for testing callouts. 

 

I need to use multiple static resource files, so I have zipped the files into single file and uploaded it to static resources.But the setStaticResource() takes only name of staticresource file.

 

The syntax of setStaticResource() is setStaticResource(String endpoint, String resourceName).

 

As mentioned in the syntax we can give only resourceName ,but not path of resource.

 

So,Is there any way to give the path of static resource file to setStaticResource()  or any other alternative ?

 

Any pointers on this will be highly appreciated.

 

 

Hi, I have the following scenario

 

public class master{//this is an empty class.

 

}

 

 

public class child1 extends master{

 

public static integer a;

public static integer b;

}

 

public class child2 extends master{

 

public static integer a2;

public static integer b2;

}

 

public class child1Data {

 

public List<master> data;

 

}

 

 

now suppose I get a list of child1 classes in json, I need to parse it.

 

so to parse

 

 

child1Data  Data = (child1Data )JSON.deserialize(response.getBody(), child1Data .class);

 

 

but after deserialization I am getting List<master>  as empty.

 

this is because master class is empty,but need the list of child1 classes in that list to be parsed

 

Please help me out.

Hi,

 

I am getting Json response from an api callout as shown below:

 

{"hint":"value"}.

 

In order to deserialize the json to my apex class, I have to declare a String variable hint,but hint is a reserved keyword.So, how should I map this json to my apex? please help me out.


Hi,

We are currently using salesforce standard email approval process.We enabled "Enable Email Approval Response"  checkbox in approval settings.
When a user submits a record for approval, approver will get an email.

Requirement :

We need to capture "Reply to " address of the email which is received by approver.

Can we get the email specified in screen shot  through apex?

Is the mail id specified in below screen shot specific to org or will it change for each approval email?


  User-added image

Hi,

I am new apex and visualforce. I have simple question. Why we write "static" keyword for test methods.

Thanks in advance.

Hi,

 

Is there any way to do multiple call outs in a single txn where there are DML operations?

Hi,

We are approving a record using apex.

We are updating the actor id in Process InstanceWorkitem object with desired approver.
But, the record is not getting approved with actual approver.

Can we change the actual approver of the record?

Hi,

 

Scenario 1:

--------------------

I am using a Wrapper class to prepare a List<Wrapper> in ctrlr using action function.

 

When the action function gets invoked, I am able to prepare the List<Wrapper>.

 

I have declared the  List<Wrapper>. as Controller variable.

 

Scenario 2:

----------------

 

Upon another ui action(say on click of radio button), am invoking another action function.

 

In the controller,when I tried to access the List<Wrapper> prepared earlier, I am getting null.

 

The constructor doesnot get invoked between scenario1 and scenario 2.

 

Could any one please help me.

 

 

 

 

Hi all,

 

 

I am using apex out put text in customer portal.

 

the text is overflowing out of the pageblock section.could any one pls help me how to wrap the text in customer portal.

the page is well when viewed in salesforce org.

 

thanks

Hi

 

 

I have a List<Object>. I need to cast this to List<A> say :

 

(List<A>) List<Object>.

 

 

but  I am getting System.TypeException: Invalid conversion from runtime type LIST<ANY> to LIST<A>.

 

 

pls help me out

 

 

 

Is there any way to get  object from json response other than deserialize untyped(As it supports only for primitive data types)?

 

 

Hi All,

I have a JSON response in this format ,


{"response":[{
        "field1" : "Developer",
        "field2":{"type":"Entery Level"},
        "field3":{"dynamicdata":{"Objectfield":{"Objectfield":"abc"}}}
        },
        {
        "field1" : "Developer",
        "field2":{"certification":"501 certified"},
        "field3":{"language":"Apex"}}
        },
        {
        "field1" : "Developer",
        "field2":{"hasBlog":"true"},
        "field3":{"Grade":{"A":{"marks":10}}}
        },
        {
        "field1" : "Developer",
        "field2":{"isContributor":"true"},
        "field3":{"Rank":{"A":{"marks":10}}}
        }
        ]
}


Using JSONParser parser = JSON.createParser(response.getBody());  to parse it.
I am able to get the proper values for field1. However, for fields "field2" & "field3" getting values like "{" as it is refering object.But parser class doesnt contain any method to get the Object.
As this fields hold JSON with no specified format.And I want to map this fields value to class field as a String like ApexClass.field3 = '{"Grade":{"A":{"marks":10}}}'.

In this scenario, I cannt use deserializeuntype as it only deals with primitive data types and I have a Apex class to map this JSON response.

The code looks like

JSONParser parser = JSON.createParser(response.getBody());
while (parser.nextToken() != null) {
                if (parser.getCurrentToken() == JSONToken.START_ARRAY) {
                    while (parser.nextToken() != null ) {
                        if(parser.getCurrentToken() == JSONToken.START_OBJECT) {
                            while (parser.nextToken() != null){
                              if(parser.getCurrentToken() == JSONToken.FIELD_NAME){
                                 String fieldName = parser.getText();
                                  parser.nextToken();
                                 String fieldvalue = parser.getText();
                                 System.debug('fieldName : '+fieldName + '    fieldValue  :'+fieldvalue);
                                 // After comparision assigning value to apex class fields and adding to a list.
                                
                               }
                            }
                        }
                      }
                   }
               }
 }

 
 If I am missing anything so please correct me .Also please suggest if there would be any better approach to handle this scenario.
 
 Thanks
 FP -

Hi All,


I am using JSON.deserialize(JSONResponse, Sample.class) method for parsing

Below is the sample

public class Sample{

    public String a {get;set;}
    public String b {get;set;}
    public String c {get;set;}
    public String d {get;set;}
    public Sample1 test {get;set;}
    
    
    
    
    public Sample1{ // in response, for this class dont know about the fields. in each and every response the fields are changing.
    }
    
    
}


How to handle such response using JSON.deserialize  and store it in Apex class variable?

Response :- 1
{
     "a": "Sometext",
      "b": "Sometext",
       "c": "Sometext",
        "d": "Sometext",
      "test": {
        "Data1": {
          "score": 2
        },
        "Data2": {
          "score1": 1
        },
        "Data3": {
          "score1": 2
        }
      }
 
 }
 
 Response :- 2
 {
     "a": "Sometext",
      "b": "Sometext",
       "c": "Sometext",
        "d": "Sometext",
      "test": {
        "Data50": {
          "score12": 2
        }       
      }
}

Any pointer's on this would be highly appricate.
Thanks in Advance.

 

 

Hi,

I am new apex and visualforce. I have simple question. Why we write "static" keyword for test methods.

Thanks in advance.

Hi,

Iam sending a request for a pdf document through rest api call.The response I got is of following format

  1. Status Code: 200 OK
  2. Content-Disposition: attachment; filename="xxxxx"
  3. Content-Encoding: gzip
  4. Content-Type: application/pdf
  5. Date: Wed, 16 May 2012 11:02:43 GMT
  6. Server: xxxxxxxxxxxx
  7. Transfer-Encoding: chunked
  8. Vary: Accept-Encoding

But how do I display the pdf response?
It is showing that the content encoding is gzip.How do I unzip it?
Below is the code for the request I have sent.

 

<apex:page controller="TestPdf" renderAs="pdf">
{!Pdf}'
</apex:page>

 

public with sharing class TestPdf
 
{
 
    public String getPdf()
 
    {
        string  Url= 'url';
        Http h = new Http();
        HttpResponse res;
        HttpRequest request= new HttpRequest();
        request.setEndpoint(Url);
        request.setMethod('GET');
        request.setHeader('username', 'username');
        request.setHeader('password', 'password');
        request.setHeader('Content-Type', 'application/pdf');
        res=h.send(request);
        return res.getBody();
    }
  
}

Please help me out.Thank you

 

Hi,

 

I recently attended the Salesforce DEV-501 training course and wondered whether anyone was interested in swapping just the lab / training files with me for other courses such as DEV401 etc?

  • September 21, 2011
  • Like
  • 0