-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
1Likes Given
-
3Questions
-
3Replies
How to Access dependent picklist(MailingState) in apex ?
I have enabled state and picklist value in client's unlimited org. I need to access only dependent state based on selected Country code. There are some integration and other apex changes where I need only dependent state value in a Map( like : 'MH'=> 'Maharastra')... I am using below code but It will give all the state values. I need only states based on country values. e.g. : For Indian it should have only 35 state which belong to India only.
Schema.DescribeFieldResult F = Contact.MailingStateCode.getDescribe();
List<Schema.PicklistEntry> P = F.getPicklistValues();
System.debug('-----P--->>'+P[0]);
Map<String, String> tempMap = new Map<String, String>();
for(Schema.PicklistEntry sp : P){
tempMap.put(sp.getValue(), sp.getLabel());
}
System.debug('----tempMap-----'+tempMap.get('MH')); // Here it is returning 'Meath' as MH will be state code for some other states as well
System.debug('----tempMapVALUE-----'+tempMap.get('UP'));
Any help will be appreciated. Thanks in Adance !!
-
- NitishMishra
- June 01, 2015
- Like
- 0
- Continue reading or reply
how to convert message/rfc822 content type to application/pdf
Hi ,
Is there any possible way to convert message/rfc822 to application/pdf content type in salesforce apex email Service.
Attachment should be inserted as pdf .
Thanks,
Nitish
-
- NitishMishra
- July 11, 2013
- Like
- 0
- Continue reading or reply
Apex Email Service Attachment content type issue
Hi Everyone,
I am using Inbound email processing to insert an attachment in salesforce. When we send email from our mail box to salesforce email It gets attached and we can read that pdf attachment as well. But When SAP sends email with pdf attachment It gets attached properly to targeted record. But we can't read that atttachment. When same email is sent from SAP to our mail box we get a pdf attachment and read it as well.
I used debug to check the content type of attachment It shows :: |[163]|DEBUG|****Content type of attachmnet received *****message/rfc822
But the same attachment received to our mail box from SAP shows :: application/pdf content type.
If any one have any idea to fix this issue that will be great help for me.
Any idea to resolve this issue will be appreciated. Please Help
Below is the code , its standard salesforce code for apex email service ::
if (email.binaryAttachments != null && email.binaryAttachments.size() > 0) {
for (integer i = 0 ; i < email.binaryAttachments.size() ; i++) {
Attachment attachment = new Attachment();
// attach to the Conversation record
attachment.ParentId = newOpp.Id;
if(!email.binaryAttachments[i].filename.endsWith('.eml')){ // Validation check to avoid .eml extension that will not allow email body content to insert as an attachment
System.debug('*****email.binaryAttachments[i].filename***2**'+email.binaryAttachments[i].filename);
attachment.Name = email.binaryAttachments[i].filename;
attachment.Body = email.binaryAttachments[i].body;
System.debug('****Content type of attachmnet received *****'+email.binaryAttachments[i].mimeTypeSubType);
attachment.ContentType = 'application/pdf';
//attachment.ContentType = email.binaryAttachments[i].mimeTypeSubType;
insert attachment;
}
}
}
Thanks,
Nitish
-
- NitishMishra
- July 10, 2013
- Like
- 0
- Continue reading or reply
How to Access dependent picklist(MailingState) in apex ?
I have enabled state and picklist value in client's unlimited org. I need to access only dependent state based on selected Country code. There are some integration and other apex changes where I need only dependent state value in a Map( like : 'MH'=> 'Maharastra')... I am using below code but It will give all the state values. I need only states based on country values. e.g. : For Indian it should have only 35 state which belong to India only.
Schema.DescribeFieldResult F = Contact.MailingStateCode.getDescribe();
List<Schema.PicklistEntry> P = F.getPicklistValues();
System.debug('-----P--->>'+P[0]);
Map<String, String> tempMap = new Map<String, String>();
for(Schema.PicklistEntry sp : P){
tempMap.put(sp.getValue(), sp.getLabel());
}
System.debug('----tempMap-----'+tempMap.get('MH')); // Here it is returning 'Meath' as MH will be state code for some other states as well
System.debug('----tempMapVALUE-----'+tempMap.get('UP'));
Any help will be appreciated. Thanks in Adance !!
- NitishMishra
- June 01, 2015
- Like
- 0
- Continue reading or reply
Date Time Question
I am trying to capture the specific Date/time an email was sent in Saleforce. Currently have Workflow with a field update but it's not returing any values. Any suggestions?
Here is my current setup.
Workflow Rule Detail
Task equals Completed
Subject contains Email:
Field Update
Custome field = Completed Date/Time
Formula NOW()
- Rung41
- May 12, 2015
- Like
- 0
- Continue reading or reply
How do you escape an apostrophe in a Merge field when using Javascript button
I have a custom button which populates the account name on a custom activity field using Javascript OnClick. Works great except if the account name has an apostrophe. How would I escape any potential apostrophes from Account.Name in the following javascript?
navigateToUrl('00T/e?who_id={!Account.Primary_Contact_Lookup__c}&retURL={!Account.Id}&00N80000004QVPs={!Account.Name}');
- tedevang
- May 20, 2010
- Like
- 0
- Continue reading or reply
How to use style sheets in VF pages in Service Cloud
- Shelley Griffin
- May 12, 2015
- Like
- 1
- Continue reading or reply