• force_arch
  • 0 Points
  • Member since 2011

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
  • 3
We are trying to migrate our visualforce pages to lightning by setting lightningStyleSheets = "true". We have a pageblocksection with two columns in the vf page. One of the fields in the left side of this section is the Owner field and we are using the apex:inputField tag for it. The Owner field became unusually long when we added  lightningStyleSheets = "true" to the apex:page tag, and it has widened the left side of the section and narrowed the right side of the section. We added the following styleClass to reduce the width of the Owner field but it isn't working. The styleClass worked when we removed the lightningStyleSheets attribute though.
    .FieldWidth input{

Please let me know if there are any work-arounds for this? Thanks.



I have developed a new webservice class to return a set of account records. Following is the code:


global class AccountMinesiteWebService

// Object to be returned by the webservice
global class Minesite{
webservice String msId;
webservice String msName;
webservice String msMineType;
webservice String msMineral;
webservice String msExternalId;
webservice String msAccountStatus;
webservice String msPhone;
webservice String msFax;
webservice String msParentName;
webservice String msIsActive;
webservice String msMineLatitude;
webservice String msMineLongitude;

webservice static List<Minesite> minesiteDetails(){
List<Minesite> minesites = new List<Minesite>();
Minesite ms;

//Query for the minesite Accounts
List<Account> accountList = new List<Account>([SELECT Id, Name, Mineral__c, External_ID__c, Mine_Type__c,
Account_Status__c, Phone, Mine_Latitude__c, Mine_Longitude__c,
Fax, Parent.Name, Is_Active__c, Jitterbit_Update__c
FROM Account
WHERE Type = 'Mine Site' AND Jitterbit_Update__c = 'YES']);

// Add all the minesite Accounts to the webservice class object that will be sent out to the external system
for(Account acc: accountList){
ms = new Minesite();
ms.msId = acc.Id;
ms.msName = acc.Name;
ms.msMineType = acc.Mine_Type__c;
ms.msMineral = acc.Mineral__c;
ms.msExternalId = acc.External_ID__c;
ms.msAccountStatus = acc.Account_Status__c;
ms.msPhone = acc.Phone;
ms.msFax = acc.Fax;
ms.msParentName = acc.Parent.Name;
ms.msIsActive = String.valueOf(acc.Is_Active__c);
ms.msMineLatitude = acc.Mine_Latitude__c;
ms.msMineLongitude = acc.Mine_Longitude__c;

return minesites;


public static testMethod void testAccountMinesiteWebService(){
List<Minesite> testMinesites = new List<Minesite>();
testMinesites = AccountMinesiteWebService.minesiteDetails();


When I run the test, it is just covering 18% of the class. The reason is, it is not entering the for loop at all (which means the accountList has no records in it). But I executed the same query in developer console, there it is successfully returning the records that satisfy the query conditions and it is entering the for loop as well. I can't figure out why the same query is failing to return any records in the webservice class (there are some account records in our sandbox that satisfy the query conditions). Please help me if there is any mistake in my code! Thanks much.

Hi all,


I'm using the following trigger to change the parentId of a Case Email Attachment (outbound email message) from EmailMessageId to CaseId so that the attachment will be automatically saved under the Case Attachments related list.


trigger aaa_Case_PopulateAttachments on EmailMessage (after insert) {
    List<Id> eMsgIds = new List<Id>();
    for(EmailMessage msg:trigger.new){
            System.debug('Email Message: '+msg.Id);

    List<Attachment> attachList = [Select Id,ParentId from Attachment where ParentId in :eMsgIds];
    System.debug('List of Attachments:' + attachList); //This is returning 0 rows!!

    Map<Id,EmailMessage> eMsgMap = new Map<Id,EmailMessage>([Select ParentId from EmailMessage where Id in :eMsgIds]);
    System.debug('Map of Email Messages:' + eMsgMap);

    List<Attachment> attachUpdateList = new List<Attachment>();

    for(Attachment att:attachList){
            System.debug('Attachment Parent Email Message : '+att.ParentId);
        update attachUpdateList;


If I click on the Case Email Attachment after the email is sent, it does show a recordid for that attachment. I hope that the attachment is saved somewhere in SFDC as a record of some object (because it has a recordid). But I can't figure out where it is being saved!


I've used a trigger on 'Attachment' to find if the Email Attachments are saved under 'Attachments' or not. The trigger is executed for the attachments created directly under Case record but not for those created under Case Email!!


trigger aaa_Attachment on Attachment (after insert) {
    for(Attachment a:trigger.new){
        System.debug('Attachment Name: '+a.Name+'Attachment Id: '+a.Id+'\nRelated To: '+a.ParentId);


Can anyone please help me out? Thanks.

throw new IllegalArgumentException('Strings must not be null');



How do i give the above java line in  Apex



I have some "System.debug" statement in my apex class.. where can I see the output of these statements in eclipse after executing the class?




  • March 27, 2012
  • Like
  • 0

Hi All,

     Is there any way to get the index of picklist inside the validation rule????  I have a picklist having value a,b,c,d . So if i have selected c as picklist value next time when i update this record with picklist value as a,b it will through an error since this value is less in indexing(for example index of a is 1,b is 2 , c is 3 and d is 4). I can update the value of pickist which having greter than equal index value then existing.