• Anupama@28
  • NEWBIE
  • 55 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 41
    Questions
  • 22
    Replies
Hi,

I have a lighting component to delete the related list (child objects) records. after deleting the child records the parent view page is not getting refreshed i.e. the related list record count is not setting to 0 after deleting all of them. When I manually refresh the tab the related list's record count is updating. please help me in fixing this issue.
or how to delay the refresh ?

below is my code...
var action = component.get("c.clearRS");   //calling server-side method
        action.setParams({
        	"lstSelectedPL":selectedRecords
    	});
        action.setCallback(this, function(response){
            var state = response.getState();
            if(state === 'SUCCESS'){
                helper.doInitHelper(component, event);
                $A.get('e.force:refreshView').fire();
            }
            ...
            ...
            ...


 
Hi,

I have a lightning compnent exactly same as given in below link... 
http://sfdcmonkey.com/2018/10/22/data-table-pagination-checkbox-lightning/.

<aura:if isTrue="{!v.bNoRecordsFound}">
       <div class="slds-notify slds-notify_alert slds-theme_alert-texture slds-theme_info" role="alert">
            <span class="slds-assistive-text">Error</span>
            <h2> ERROR MESSAGE </h2>
        </div>
        <aura:set attribute="else">
         --------------
             <table>
                   <!---- TABLE WITH DATA --->
             </table>
         -----------------
            </aura:set>    
     </aura:if>

Here, when the lightning component is loaded, even if there are no records to display in table of else section... still a blank table is displayed for a while and goes off... and later error message from if section is shown.
how to avoid this ?
We strictly want to show error message immediately if the given condition is true else display the else section(table).

Thanks,
Anupama


    

 
We have a requirement to send email notification before 'X' min the milestone gets violated.
How to get the milestoneId or milestone name, and timeRemaining of that particular Casemilestone in VF email template that is going to violate.

e.g. A case has 3 milestones 'First response', 'Return to service' and 'Resolution'. I need to build a common email template, if 'First response' is going to violate in 'X' min then our email body should have the name and TimeRemaining of 'first response' milestone and same for other 2 respectively.

here is my sample code I have tried with

VF email template
---------------------------------------------------------------------
<messaging:emailTemplate subject="SLA violation alert : Case# {!relatedTo.caseNumber}" recipientType="User" relatedToType="Case">
    <messaging:htmlEmailBody >
        <html>
            <body>

               <!--------- HOW TO GET THE BELOW VALUE ? ------------------------>
                mileston Name : {!relatedTo.CaseMileStone.Name}          
                Time remaining : {!relatedTo.CaseMileStone.timeRemaining}  
                <!------------------------------------------------------------------------------------->
                                                                                   
            </body>
        </html>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>


VF custom component
--------------------------------------------------------------------


 
Hi,
We have a requirement to count the number of active entitlements under an account.
An entitlement is considered as acitve if "Status = Active AND  EndDate >= Today() and Support level (Text formula field) = 'GOLD or SILVER or PLATINUM' "

we have tried with the below ...
1: Created a rollup summary field on 'Account' to count the active entitlements which meet above criteria , but the problem here is we cannot filter the entitlements using the field status and support level since formula using product object

2:  > Created a custom checkbox field 'isActiveEntitlement' on entitlement object so that we can create a rollup summary field on account to count entitlements with isActiveEntitlement = true
> Created a trigger to set if entitlement is active or not. below is Sample code of trigger

if(Status = Active && EndDate >= Today() AND (Support level = GOLD / SILVER / PLATINUM))
{
      isActiveEntitlement = True;
}
else
{
     isActiveEntitlement = False;
}
Update Entitlement records;

The problem here is if I edit and change the endDate of entitlement manually, the status becomes expired and the trigger is firing and everything is working good but if the date is expired automatically then state is setting to expired but trigger is not firing, isActiveEntitlement is not setting to false hence count is not getting updated on account

3: Created a process builder with same logic as above trigger , this also works good if the entitlement is edited manually and not for automated / backend process.
Please help me to fix the issue or suggest any other ways to count active entitlements.

Thanks,
Anupama




 
Hi, 

How to get sObject's dependent picklist in lightning component.
I have tried through <force:inputfield> but no luck.

Thanks,
Anupama


 
Hi,

We have a requirement where we need to update the communty user contact details, Is there a way to get the logged in community user information either through lightning component or community builder page or site.com page etc....

I have tried the below

> Created a VF page to get current user information and related contact information
> Created site and given link to the above VF page
> Created a community builder page and given llink to the above site

Here, If i hardcode the contactId in VF page / apex then its working fine but our requirement is to get the current logged in community user info and then fetch his/her contactId.
When i run this as community user the first step i.e. fetching user details itself is failing. 

Please help me to get the requirement done
thanks in advance.

Thanks,
anupama
 
We have a visualforce page where we have used actionsupport with rerendering  attribute for refreshing a output panel which worked good till 6th-May-2016 IST, and then suddenly stopped working i.e. currently rerendering is not working for outputpanel i. I just want help kin knowing is it because the latest release or something wrong in our code.

The code sample is as below
<apex:outputPanel id="Newcase" >                                          
                                        <apex:outputPanel rendered="{!IF(editAccount,true,false)}">
                                            <label>Account: </label>
                                            <apex:selectList size="1" value="{!selectedPartneraccount}" styleClass="form-control" >                             
                                                <apex:selectOptions value="{!partneraccountoptions}"/> 
                                                <apex:actionSupport event="onchange" reRender="Newcase" status="loading" />                                 
                                            </apex:selectList>
                                            
                                            <label>Machine ID: </label>                                                               
                                            <apex:selectList size="1" value="{!selectedMachineId}" styleClass="form-control" id="mId">
                                                <apex:selectOptions value="{!machineIdoptions}" />
                                                <apex:actionSupport event="onchange" reRender="Newcase" status="loading"/>    
                                            </apex:selectList>
                                        </apex:outputPanel>
                                    </apex:outputPanel>


Thanks in advance.


 
Hi,

I  have a method in a controller, which takes to the edit page of a contact where user can edit the contact and save.
How do i compare the old and new values of that contact ?

apex Controller
==============

public pageReference gotoContactEditPage()
{
             PageReference conEditPage = new PageReference('/' + contactId+ '/e');         
             conEditPage.setRedirect(true);
            // Here i want to compare the old and new values of contact (before save and after save)
             return conEditPage
           


}

 
Hi,

I am creating a pageblock table and usign the below component to have pagination.
http://blogforce9.blogspot.com/2013/11/pageblocktableenhanceradv-yet-another.html
Now I want to have checkboxes in the table with the below functionalities
1: select all
2: select individual records trough paginating.
Currently I have implemented something with wrapper class and js, but it is working only for 2nd option not for first,

Has anyone implemented such requirement?  Pls help.

Thanks,
Anupama

 
Hi,


I am trying to execute the following soql queris using bulk API / workbench / Developer console, but I am not able to retrieve the result without filter on Ids.

SELECT Id FROM IdeaComment;

How do I get the result of soql queries without filter on Id.

Hi,

 

Is there any built in method in apex to convert a random date to user local date format?

or

is there any built in method in apex to get the date format of the user local.

for Ex : UserInfo.getLocale(); gives the user local, same way any built method to get the date format like dd/mm/yy etc..

Hi,

 

I have two dropdown boxes in my visualforce page namely "ListOfObjects and ListOfFields".

ListOfObjects: displays all the objects in the salesforce

ListOfFields : Displays all the fields belong to the selected object in the 'ListOfObjects' drop down box.

 

Once I select the field from ListOfFields it will fetch the metadata of that particular field and keeps on concatinating/Appending to the finalString (a variable)  based on the number of  fields selected.

How to make the variable finaltring to retain the previous String also once the objectname is changed in ListOfObjects box.

 

ex: first time if I select object Account and its fileds id and name , the finalstring contains the metadata of id and name fields,. Next if I select object Contact and field createddate within contact, then my finalString should display metadata of id,name,createddate.

 

Here is my code...

 

<apex:page controller="ListObjects" >    

    
    <apex:messages />

 <apex:pageBlock >
        <apex:form >
                                          
            <apex:ActionFunction name="loadField" reRender="fields"  status="myStatus,result" action="{!loadNewFieldSet}">
            </apex:ActionFunction>    
            
            <apex:ActionFunction name="DescribeSelectedFields" reRender="fieldsLabel,result"  status="myStatus" action="{!LoadFieldsLabel}">
            </apex:ActionFunction>                   
                                   
                <apex:SelectList value="{!selectedObject}" size="1" multiselect="false"  label="ListOfObjects" onchange="loadField();"  id="ObjId" style="width:100%" >
                    <apex:SelectOptions value="{!Names}">
                    </apex:SelectOptions>                                    
                </apex:SelectList>

                <apex:SelectList value="{!FieldValues}" size="10" multiselect="true" label="ListOfFields" onclick="DescribeSelectedFields();" id="fields" style="width:100%">
                    <apex:SelectOptions value="{!fieldsList}">
                    </apex:SelectOptions>                                       
                </apex:SelectList>
                                          
                                                             
                 </apex:form>    
                 
             <apex:outputlabel id="result">
                 {!value1}
                 </apex:outputlabel>                
                               
      
    </apex:pageBlock>
 
</apex:page>

 

====================

public  class ListObjects
{

   /* public PageReference CheckObjExists1() {
         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Your Message'));
        return null;
    } */

     public ListObjects()
       {
          fieldsList = new List<SelectOption>();
        
       }
 
   
      public string value1 {get;set;}
  //  List<Schema.DescribeFieldResult>  allesults ;
            
      public List<SelectOption> fieldsList {get;set;}
      public List<SelectOption> DescfieldsLabel { get; set; }
      public String FieldLabels { get; set; }
      public String[] FieldValues { get; set; }
      public String selectedObject { get; set; }
      string finalstring = 'label,type,length,visibleLines';     
      
            
         
     public List<SelectOption> getNames()
      {
            List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();     
            List<SelectOption> options= new List<SelectOption>();
    
                for(Schema.SObjectType f : gd)
                    {
                       options.add(new SelectOption(f.getDescribe().getName(),f.getDescribe().getName()));
                       //  System.debug(gd);
                       options.Sort();
                    }
           return options;
     }
     
     public  void loadNewFieldSet()
     {      
         Map<String, Schema.SObjectField> objectFields = Schema.getGlobalDescribe().get(selectedObject).getDescribe().fields.getMap();
         fieldsList  = new list<SelectOption>();       
         //system.debug(selectedObject);
             
            for(String s : objectFields.keySet())
             {
                  fieldsList .add( new SelectOption(s,s));
                  fieldsList.Sort();
             }        
          
     }
        
       
     public void LoadFieldsLabel()
     {
     
         Map<String, SobjectField> fieldMap = Schema.getGlobalDescribe().get(selectedObject).getDescribe().fields.getMap();
        // DescfieldsLabel  = new list<SelectOption>();
         List<Schema.DescribeFieldResult>  fresults = new List<Schema.DescribeFieldResult>();
         string header = 'fullName,label,type,length,visibleLines \n';
         string finalstring = header;     
         
               for(String f:FieldValues)                 
            
               {
                    fresults.add( fieldMap.get(f).getDescribe());             
                    String name = fieldMap.get(f).getDescribe().getName();         
                    String label = fieldMap.get(f).getDescribe().getLabel();
                    DisplayType fieldtype = fieldMap.get(f).getDescribe().getType();
                    Integer length = fieldMap.get(f).getDescribe().getLength();
                    
                    string recordString =   name + ',' +label + ',' + fieldtype + ',' + length + '\n';
                   // String newlinestr = recordString;
                   
                 finalstring = finalstring + recordString;          
                // displaySelectedFieldsMetadata(recordString);
                value1 = finalstring ;                     
                    
                   
                                       
               }      
           }    
               
       /* public void displaySelectedFieldsMetadata(String recordString)
              {
             
                  finalstring = finalstring + recordString;
                  value1 = finalstring ;            
                    
            }    */    
                 
  }

 

Pls help..

Thanks in advance :)