How to Unit Test Recieving Email in Apex

Suppose you have a class like this for recieving email/** * Email services are automated processes that use Apex classes * to process the contents, headers, and attachments of inbound * email. create account from email subject create contacts from email cc create text and binary attachments if any */ global class EmailDemoReceive implements Messaging.Inboundemailhandler […]

Continue Reading »

Creating dependant pickist in visualforce from custom settings

Creating dependant pickist in visualforce from custom settingsHi,Today, i got a requirement for creating a dependant picklist which gets its values from custom setting. I thought of sharing it with you all.In my example, i am selecting name of countries and its associated city from custom settings.Steps :1) Create a new list type custom setting, […]

Continue Reading »

Solution for “INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session”

System.out.println(“LOGGING IN NOW….”);enterpriseConnection connection = new enterpriseConnection(); loginResult = connection.login(userName, Password);System.out.println(“Succesfully logged IN”);connection._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, loginResult.getServerUrl());SessionHeader sessionHdr = new SessionHeader();sessionHdr.setSessionId(loginResult.getSessionId());connection.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),”SessionHeader”, sessionHdr)

Continue Reading »