• ssikora
  • NEWBIE
  • 35 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies

Ok, I know there are a lot of posts on this topic, and I am familiar with the two Visualforce techniques for doing this (using an outputField bound to an SObject currency field, and using the outputText value="{0,number,###,##0.00}" ). However, in my use case, I'm trying to display a currency value in the title of a pageBlock:

 

 

<apex:pageBlock title="Refund Amount: {!refundAmount}" >

 

I can't really use the outputText or outputField options here, so I think I need to do the formatting in my controller. The Apex documentation states that String.format(String, List<String>) works "in the same manner as apex:outputText." Has anyone actually used this method to format a Decimal value into a properly formatted currency String in Apex code?

  • November 17, 2010
  • Like
  • 0
When using the latest version of the IDE, there are 2 fields on the Campaign Member object that are available in the report and history list (as of Spring 07). The fields are:

  1. Member First Associated Date
  2. Member Status Update Date
The fields get downloaded correctly into the XML. When we try to deploy the report type to another ORG, it complains that the fields are not there. These fields are not available in the API. Has anyone else seen this?

Are there any workarounds other than manually recreating the Report types?


Message Edited by ssikora on 11-03-2008 02:37 PM
Are there any known limitations on the size of the XML message that can be processed by the XMLStreamReader class. The idea is to expose the webservice with an input parameter of string so the customer can call the Apex code with the XML and the code can parse the XML and upsert data into SFDC.
Has the Eclipse update for API 11.0 and/or 11.1 been released?

Ok, I know there are a lot of posts on this topic, and I am familiar with the two Visualforce techniques for doing this (using an outputField bound to an SObject currency field, and using the outputText value="{0,number,###,##0.00}" ). However, in my use case, I'm trying to display a currency value in the title of a pageBlock:

 

 

<apex:pageBlock title="Refund Amount: {!refundAmount}" >

 

I can't really use the outputText or outputField options here, so I think I need to do the formatting in my controller. The Apex documentation states that String.format(String, List<String>) works "in the same manner as apex:outputText." Has anyone actually used this method to format a Decimal value into a properly formatted currency String in Apex code?

  • November 17, 2010
  • Like
  • 0

I have a field that has text in it that I am outputting to a PDF using visualforce and the text is wrapping and not holding the CR formatting.  Any suggestions on how to keep the formatting of the text when displayed in visualforce?

 

Thanks,
Terry

I'm new to SalesForce, Apex, and Visual Pages and am trying to figure out how to call a very simple web service from a Visualforce Page. After spending several days going through tutorials, various samples and reading through these forums I feel I am very close. I've addressed all the error messages during the WSDL generation but still haven't been able to put everything together to get my much anticipated "Hello World".

 

I am working with a the very simple Microsoft Dot Net "Hello World" web service that can be accessed here: http://demo4.leaseteam.com/GeorgeTest/Service.asmx There are no inputs and the expected out put is a simple "Hello World".  This is what I have in place so far:

 

1) My site is configure under Administration Setup / Remote Site Settings

2) After some manual hacking of the WSDL with XML Spy I have WSDL generated and in an Apex Class. See below

 

//Generated by wsdl2apex

public class tempuriOrg {
public class HelloWorld_element {
private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
private String[] field_order_type_info = new String[]{};
}
public class ServiceSoap {
public String endpoint_x = 'http://demo4.leaseteam.com/GeorgeTest/Service.asmx';
public Map<String,String> inputHttpHeaders_x;
public Map<String,String> outputHttpHeaders_x;
public String clientCert_x;
public String clientCertPasswd_x;
public Integer timeout_x;
private String[] ns_map_type_info = new String[]{'http://tempuri.org/', 'tempuriOrg'};
public String HelloWorld() {
tempuriOrg.HelloWorld_element request_x = new tempuriOrg.HelloWorld_element();
tempuriOrg.HelloWorldResponse_element response_x;
Map<String, tempuriOrg.HelloWorldResponse_element> response_map_x = new Map<String, tempuriOrg.HelloWorldResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'http://tempuri.org/HelloWorld',
'http://tempuri.org/',
'HelloWorld',
'http://tempuri.org/',
'HelloWorldResponse',
'tempuriOrg.HelloWorldResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.HelloWorldResult;
}
}
public class HelloWorldResponse_element {
public String HelloWorldResult;
private String[] HelloWorldResult_type_info = new String[]{'HelloWorldResult','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
private String[] field_order_type_info = new String[]{'HelloWorldResult'};
}
}

 

3) I have another Apex Class written as the "controller". It is thus...

 

 

public class WSContoller

{

String output;
String input = 'detroit';

public void getRecord()

{

tempuriOrg.ServiceSoap stub = new tempuriOrg.ServiceSoap();

output= stub.HelloWorld();
//output= 'Test 2';

}

public String getOutput()

{

return output;
//return 'test me';

}

}

 

 4) My Visualforce Page is this...

 

<apex:page controller="WSContoller" tabStyle="Account">
It will be a nice to get output from the controller
<p>You belong to the {!Output} account.</p>
</apex:page>

 

Drum roll ..... I get the output without the expected "Hello World". My page shows:

 

It will be a nice to get output from the controller

You belong to the account.

 

If you've read this far, thank you and I'd appreciate any help or advise that you could give me.

 

Hi there,

Can we use a SWITCH control statement in the APEX class? Is it possible and supported by APEX?

thanks
I've deployed all my triggers and classes to a full sandbox (structure and data) without any problems.  All my tests create their own test objects/data so it doesn't rely on instance data.  This one in particular uses two hardcoded users that exists in all instances but since I'm creating the test accounts any existing data should not interfere with the queries.

Yet when I try to deploy to our production instance I get a "too many query rows: 501" error on this line:


Code:
System.assertEquals(60, [SELECT COUNT() FROM SFDC_Assignment__c WHERE Account__c IN :oAccounts AND OwnerId = :oOriginalUser.Id AND Resource__c = :oOriginalUserResource.Id]);

 Is this error saying that too many rows are being returned?  The documentation says that 1,000 is the max number of records that can be retrieved through a query but it's flagging it on 501 and this is a COUNT() query so it shouldn't matter.


Message Edited by kpeterson on 12-12-2007 06:30 AM
I'm trying to do a switch statement in Apex, I'm assuming the syntax will be like java, but I can't seem to get it to compile; I get an "unexpected token: {" error message. Am I missing something obvious?  I have many more cases to add and I'm hoping I don't have to do if statements for each one.

Code:
switch (ce_days) {
 case 180:
  milestone = 180;
}//end switch