• David Kingery
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Is there a way to ignore the case when comparing string with a Map Key? 

 

I tried tolowercase (), toupperCase, but for my requirement that's not a viable solution. 

 

Any other way?

 

Map<string, string> colorCodes = new Map<String, String>();

string s1='RED';
string s2='BLUE';

 

colorCodes.put(s1.tolowercase(), 'FF0000');
colorCodes.put(s2.tolowercase(), '0000A0');

Boolean contains = colorCodes.containsKey('BluE');
System.assertEquals(contains, True);    // Assertion fails

Hello,

 

I've created a Visualforce Page to generate PDF orders from a custom object (Orders).

In this page there are datatable merging data from Related list of Orders. 

When the pdf is generated those related lista are not in the same order as in the Order Detail Page.

I read that some Apex controller  need to be added to the page.

Can some one help me on this?

 

Thanks,

Stefano di Leone