• Swapna
  • NEWBIE
  • 25 Points
  • Member since 2009

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

HI All

 

I'm trying to display picklist values specific to a recordtype.

I have a visual force page which uses standard controller and an extension.


We are assigning the recordtype based on specific criteria with in the constructor.

http://developer.force.com/releases/release/Winter11/Visualforce+Support+for+Record+Types

As per the documentation, by using inputfield and version 20. I should be able to achieve what im trying to do.

But it is not working..

 

Im sure there is something wrong with my method.

 

Any pointers will be great help.

 

Thanks

Swapna

 

  • January 19, 2011
  • Like
  • 0

Hi,

 

I have a query in APEX Trigger in which im comparing a field with a value.

This value can have & in it.

Whenever there is an & in the value, my query is not returning any values.

Can any one help me overcome it.

How to escape & in a SOQL query.

 

Please help.

 

Thanks

Swapna

  • August 07, 2009
  • Like
  • 0

Hi,

 

We are trying to use HTML Email Templates.

We want the user to provide the ability to edit the template after selecting it in Send an email page so choosed HTML(With Letter heads) instead of Custom HTML Templates.

 

But we are facing an issue in terms of dynamically inserting an image.

We are using same Template for different brands. But based on the Brand we want to change the image instead of creating multiple email templates with same content but different images.

 

Im not sure how to handle this.

Any pointers will be of great help. ANy work around is greatly appreciated.

 

We want to use the same template but with dynamic images. with the ability to edit the Template after selection.

 

Thanks

Swapna

 

 

  • August 03, 2009
  • Like
  • 0

I have an opportunity object and a custom object called members. On both objects, I have custom fileds called Original_ID set as an ID field of external system. Members object has a look up field to Opportunity object.

 

 

When I load up  the data into opportunity object, all went perfectly fine.

 

I am just wondering what's the best way to load up the data into the Members object without having do downad all the SF opportunity ID and put those in the relevant members data before upload?

 

Otherwise the system wouldn't know which members belong to which opportuity?

 

Hope it makes sense.

 

 

Thanks, 

  • March 26, 2010
  • Like
  • 0

After having filled in the information from a new event, there is the choice between "save", "save & new task" and "save & new event".

 

Is it possible to create an extra custom button "save & new case" in the event edit layout ?

 

There is the possibility to add custom buttons, but these will only appear in the event detail layout (so after having saved), and I'd like them to appear in the event edit layout (so while entering/editing the event).

 

Any help/suggestions would be much appreciated!

 

 

Regards,

 

Martin

 

 

I needed a way to shorten URLs I'm including in outgoing emails, so I wrote a quickie integration to bit.ly. Public domain... Hope it helps.

 

 

/*
Class to connect to bit.ly API to shorten a long URL
*/
global class bitly {
private static final String APIKEY = 'your_api_key';
private static final String LOGIN = 'your_bit.ly_login';


global static String shorten(String url) {
Http h = new Http();
HttpRequest request = new HttpRequest();
request.setEndPoint('http://api.bit.ly/shorten?version=2.0.1&format=xml&login='+LOGIN+'&apiKey='+APIKEY+'&longUrl='+EncodingUtil.urlEncode(url, 'UTF-8'));
request.setMethod('GET');

try {
HttpResponse response = h.send(request);

if (response.getStatusCode() == 200) {
XMLStreamReader reader = response.getXmlStreamReader();
String shortUrl = parseResponse(reader);
return shortUrl;
}
} catch (System.CalloutException e) {
System.debug('\n**** bit.ly CalloutException: '+e);
}

// if the callout was unsuccessful for any reason
return null;
}

private static String parseResponse(XmlStreamReader reader) {
String shortUrl;
while (reader.hasNext()) {
if (reader.getEventType() == XmlTag.START_ELEMENT && reader.getLocalName() == 'shortUrl') {
reader.next();
shortUrl = reader.getText();
break;
}

if (reader.getEventType() == XmlTag.START_ELEMENT && reader.getLocalName() == 'errorMessage') {
reader.next();
if (reader.getEventType() != XmlTag.END_ELEMENT) {
String errorMessage = reader.getText();
System.debug('\n* Error message from bit.ly: '+errorMessage);
return null;
}
}
reader.next();
}

return shortUrl;
}

private static testMethod void testBitly0() {
bitly.shorten('http://www.salesforce.com/');
}

private static testMethod void testBitly1() {
String responseXml = '<bitly><errorCode>0</errorCode><errorMessage></errorMessage><results><nodeKeyVal><userHash>15pXjJ</userHash><shortKeywordUrl></shortKeywordUrl><hash>M2FqH</hash><nodeKey><![CDATA[http://www.salesforce.com]]></nodeKey><shortUrl>http://bit.ly/15pXjJ</shortUrl></nodeKeyVal></results><statusCode>OK</statusCode></bitly>';
XmlStreamReader reader = new XmlStreamReader(responseXml);
Test.startTest();
String shortUrl = parseResponse(reader);
System.assertNotEquals(null, shortUrl);
}

private static testMethod void testBitly2() {
String responseXml = '<bitly><errorCode>203</errorCode><errorMessage>You must be authenticated to access shorten</errorMessage><statusCode>ERROR</statusCode></bitly>';
XmlStreamReader reader = new XmlStreamReader(responseXml);
Test.startTest();
String shortUrl = parseResponse(reader);
System.assertEquals(null, shortUrl);
}
}

 

 

 

Message Edited by ryanhca on 10-13-2009 10:14 AM

Hi,

 

We are trying to use HTML Email Templates.

We want the user to provide the ability to edit the template after selecting it in Send an email page so choosed HTML(With Letter heads) instead of Custom HTML Templates.

 

But we are facing an issue in terms of dynamically inserting an image.

We are using same Template for different brands. But based on the Brand we want to change the image instead of creating multiple email templates with same content but different images.

 

Im not sure how to handle this.

Any pointers will be of great help. ANy work around is greatly appreciated.

 

We want to use the same template but with dynamic images. with the ability to edit the Template after selection.

 

Thanks

Swapna

 

 

  • August 03, 2009
  • Like
  • 0