• @@@we@@@
  • NEWBIE
  • 17 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 38
    Replies
i want to open  some popup  four diffrenent  condition in lightnnig
1  Simpleily resset if i m not apply  any search   click search

2  if i am apply any change   search  data (button ) then   click  clear search  its ask to     one popup open do you want update

3 when  i  come or redirect    clear  search  reset  agin   

4  if i come any redirect     and append data  or change some data  and   click clear search    it open another new popup

5  if  i add some change   and search the data   append and click clear search  it show same 4 popup 

 also i dont know  how manage add   value and new add value array
Please help it urgent

 
Hello
I have requriment 
I have list of  data
I want to perform  lazy loading with pagnation
Ex first time display 20record with scroll page
When i scroll  loading more logo
And other 20show
In lighting
Without data table
Its urgent
Please help me it urgent
 Iam Upload All  Contact , Opportunity  , Adventure 
What Can  i do now

Challenge Not yet complete... here's what's wrong:
Please check that all of the relationships are maintained for Opportunity Contacts and Adventure Packages that you upload from the spreadsheet.
Trailhead Superbadge : App Customization Specialist - Cannot pass step 1


Challenge Not yet complete... here's what's wrong: 
The Account object's 'Volunteer Organization Status' field couldn't be found. Ensure that you use the correct label and API name when creating fields. In this example the validation is looking for 'Volunteer_Organization_Status__c'.

Where Iam Doing Wrong

 
Hello
I have requriment 
I have list of  data
I want to perform  lazy loading with pagnation
Ex first time display 20record with scroll page
When i scroll  loading more logo
And other 20show
In lighting
Without data table
Its urgent
public class BatchApexController{
 
      public void callBatch(){
      
        database.executebatch(new LoanofficerBatch());
    database.executebatch(new RealtorBatch());
    database.executebatch(new BuilderBatch());
      }
}
please help
 
Hi All,
I have used wrapper class and I have implemented checkbox but I can't able to write "Select all" beside  the topmost checkbox.

User-added image

Thanks in advance
 
  • April 08, 2019
  • Like
  • 0
Hi all, 
Currently i have two External object with relationship External Lookup Relationship with A__x is parent B__x is child. B have 5 records.
From A__x  i want to query B__x just one query
Select id, name ,(Select id, name from B__r ) where id = '123456789'. But result of child is null?
Can you help me find to query child record success?
 
Hello everyone,
I have a visualforce page thatreside on a public website.
The user enters information on 2 fields.  Then completes a  captcha. 
The user then clicks a button on the VF page.
Assuming the Captcha is succesful I need to go back to the Salesforce org to return Acount data based on the 2 field and populate fields on the same VF page.  I am familiar passing information from Salesforce to a VF page but I am not sure how to retrieve the data from Salesforce based on user input on a VF page.  Any suggestions would be greatly appreciated.

Thanks
Trailhead Superbadge : App Customization Specialist - Cannot pass step 1


Challenge Not yet complete... here's what's wrong: 
The Account object's 'Volunteer Organization Status' field couldn't be found. Ensure that you use the correct label and API name when creating fields. In this example the validation is looking for 'Volunteer_Organization_Status__c'.

Where Iam Doing Wrong

 
Quiero configurar una dependencia de campo en el objeto "Oportunidades" para que según la "cantidad de cuotas" (number of cuotes) se muestren distintas posibilidades de "etapas" (stages). El problema es que no me deja que el campo dependiente sea un campo standard. Por eso creé otro campo personalizado que en vez de llamarse "stage" se llama "stages". Me salió bien la dependencia de campo, pero el campo standard "stage" no lo puedo borrar porque está marcado como obligatorio. Y no veo la posibilidad de anular su obligación. Tampoco me deja sacarlo del formato de página. Aparece un cartel que dice: "Este campo se muestra en el formato de página y no se puede eliminar." Alguien me puede ayudar a que no se vea el campo "stage" para que los usuarios puedan utilizar el campo "stages" que yo creé como reemplazante? Hay forma de elliminar u ocultar este campo standard?
@RestResource(urlMapping='/IsPOrequiredForIP/*')
global class SalesforceCaseEntitlementCheck {
    

    @HttpGet
    global static AssetCls isPOrequired() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        String IP_ID = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        system.debug('APR  --> '+IP_ID );
        case c = new case();
        List<Case> caseList = new List<Case>();
        c.RecordTypeId = SMCUtils.getRTMap().get(P_Constant.NameTechnical_Support);
        c.SV__Component__c = IP_ID;
        caseList.add(c);
        SMCUtils.updateCaseFromComponent(caseList, null, false);
        SMCUtils.updateCaseEntitlementFromContract(caseList, null);
        system.debug('Is Po Required --> '+c.SV_Require_PO__c );
        
        return (new AssetCls(IP_ID, c.SV_Require_PO__c));
    }
    
    global class AssetCls {
        public String assetId;
        public Boolean poRequired;

        public AssetCls (String assetId, Boolean poRequired) {
            this.assetId = assetId;
            this.poRequired = poRequired;
        }
    }
}
can anybody explain with a example where this scenario is used  in a simple manner,  i have gone through differnt examples , bt iam unable to understand it >>ApexPages.currentPage().getParameters().get('recordId') 
I have a batch apex class and a test class. But im getting only 60% of code coverage please help me to get above 75%

Class:

global class FacultyearnGFCBatch implements Database.Batchable<sObject>


    
    global Database.QueryLocator start(Database.BatchableContext bc)
    { 
       integer year = system.today().year();
        string str1 = (year-1)+'-'+(year);
        string Campus1 = 'Boston';
        string Campus2 = 'BRD';
        string Campus3 = 'BOS';
        string inputCampus1 = '\''+'%'+ Campus1+'%'+'\'';
        string inputCampus2 = '\''+'%'+ Campus2+'%'+'\'' ;
        string inputCampus3 = '\''+'%'+ Campus3+'%'+'\'' ;
        String[] Str = new string[]{str1};
        string result = '\''+String.join(Str,'\',\'')+'\'';    
        string Class1 = 'No Payment for this Class';
        string Class2 = '\''+'%'+ Class1+'%'+'\'';
        
        
        
Id strFacultyTeachingAssignment = NEUSFIDHelper.retrieveRecordTypeId(APIPConstants.REC_TYPE_FACULTY_TEACHING_ASSIGNMENT, 'Contract');
string query1 = 'SELECT id,Account.Name,Cancelation_Fee_Scheduled__c,Canceled_Contract_Fee__c,Course_Section_ID__r.course_section_status__c,Compensation_Rate__r.name,Course_Section_ID__c,AccountId FROM Contract WHERE ';
query1=query1+'RecordType.Id IN('+'\''+strFacultyTeachingAssignment+'\''+')';
query1=query1+'AND Cancelation_Fee_Scheduled__c = True ';
query1=query1+'AND Course_Section_ID__r.course_section_status__c = \'Cancelled\' ';
query1=query1+'AND  Canceled_Contract_Fee__c  IN ( \'100% GFC Fee\',\'75% GFC Fee\') ';
query1=query1+'AND (NOT Compensation_Rate__r.name like '+Class2+')';


List<Contract> cancContractLst = Database.query(query1);
        
    string query2 = 'SELECT ID,Account.Name,AccountId,Course_Sections__c,Course_Section_ID__c,Account.Faculty_Employment_Status__pc,Account.CPS_faculty_type__pc,Campus__c,Academic_Year__c,Term__c,Account.Union_Member__c,Account.NU_Id__c,Status From Contract  WHERE ' ;
    query2=query2+'RecordType.Id IN('+'\''+strFacultyTeachingAssignment+'\''+')';
    query2=query2+'AND  Academic_Year__c IN ('+result+')';
    query2=query2+'AND Status = \'Activated\'';
    query2=query2+'AND Account.Union_Member__c = True ';
    query2=query2+'AND Account.Faculty_Employment_Status__pc = \'Active\'';
    query2=query2+'AND Account.CPS_faculty_type__pc NOT IN ( \'Full Time Faculty\',\'Half Time Faculty\') ';
    query2=query2+'AND (Campus__c Like '+inputCampus1+'OR Campus__c Like '+inputCampus2+'OR Campus__c Like '+inputCampus3+')';
   
     List<Contract> activeContractLst = Database.query(query2);

    List<Id> contractLst = new List<Id>();
      for(Contract c2 : activeContractLst) {
            contractLst.add(c2.Id);
        }
        for(Contract c1 : cancContractLst) {
            contractLst.add(c1.Id);
        }
        
    List<Faculty_Good_Faith_Consideration__c> facLst = [Select id,name,Contract__c,Course_Section__r.Course_Section_Status__c from Faculty_Good_Faith_Consideration__c where Contract__c IN : contractLst];
    List<Id> idList = new List<Id>();
    List<Faculty_Good_Faith_Consideration__c> updateAboutlst = new List<Faculty_Good_Faith_Consideration__c>();

    for(Faculty_Good_Faith_Consideration__c fac : facLst) {
          if(fac.Course_Section__r.Course_Section_Status__c == 'Cancelled') {
            Faculty_Good_Faith_Consideration__c gc = new Faculty_Good_Faith_Consideration__c(id=fac.Id);
            gc.Accepted_Buyout__c = true;
            gc.GFC_For_Given_Course__c = false;
              updateAboutlst.add(gc);
          }
          idList.add(fac.Contract__c);          
    }

    if(updateAboutlst.size()>0)
      update updateAboutlst;

    Set<Id> newConSet = new Set<Id>(contractLst);
    Set<Id> exConSet = new Set<Id>(idList);
    List<Id> dupes = new List<Id>();
    for(Id ct : newConSet) {
      if(exConSet.contains(ct)) {
        dupes.add(ct);
      }
    }
    newConSet.removeAll(dupes);

    String query = 'Select id,Account.Name,AccountId,Course_Sections__c,Course_Section_Status__c,Course_Section_ID__c,Account.Faculty_Employment_Status__pc,Account.CPS_faculty_type__pc,Campus__c,Academic_Year__c,Term__c,Account.Union_Member__c,Account.NU_Id__c,Cancelation_Fee_Scheduled__c,Canceled_Contract_Fee__c,Status,Compensation_Rate__r.name from Contract where ID IN';
            query = query + ' :newConSet';
     
        return Database.getQueryLocator(query);
    }
   
    global void execute(Database.BatchableContext bc, List<Contract> scope)
    {                 
        list<Contract> updateContractList  = new list<Contract>();
        list<Faculty_Good_Faith_Consideration__c> gfcLst = new List<Faculty_Good_Faith_Consideration__c>();
        List<Faculty_Good_Faith_Consideration__c>  updategfcLst = new List<Faculty_Good_Faith_Consideration__c>();
        Map<id,String> gfcCancelled = new Map<id,String>();
        
        for(Contract Con : scope)
        {          

          if(con.Status == 'Activated'){

          Faculty_Good_Faith_Consideration__c facl = new Faculty_Good_Faith_Consideration__c();
             facl.Name   = con.Account.Name ;
             facl.Contract__c = con.Id;
             facl.Course_Section__c = con.Course_Section_ID__c;
             facl.AccountName__c  = con.AccountId;
             facl.GFC_For_Given_Course__c  = True;
           gfcLst.add(facl);
             
        }  
        
        if(con.Course_Section_Status__c == 'Cancelled') {            
             gfcCancelled.put(con.Id,con.Course_Section_ID__c);             
        }
      
      }           
          
            
        try {         
              if(gfcLst.size()>0)
                insert gfcLst;

              if(gfcCancelled.size()>0) {
                 List<Faculty_Good_Faith_Consideration__c> gfcCancLst = [Select id,name,Course_Section__r.Course_Section_Status__c from Faculty_Good_Faith_Consideration__c where Course_Section__c IN :gfcCancelled.values()];
                    
                   for(Faculty_Good_Faith_Consideration__c gfcCanc: gfcCancLst) {
                   
                   Faculty_Good_Faith_Consideration__c gf = new Faculty_Good_Faith_Consideration__c(id = gfcCanc.Id);
                   gf.Accepted_Buyout__c  = True;
                   gf.GFC_For_Given_Course__c = false;
                   updategfcLst.add(gf);
                   
                   }
                }
              if(updategfcLst.size()>0) {
              database.SaveResult[] srlist = database.update(updategfcLst,false);             

              for(database.SaveResult sr : srlist)
              {
                  if(sr.isSuccess())
                  {
                      system.debug('Successfully updated GFC Records:'+sr.getId());
                  } 
                  else
                  {                         
                      for(database.Error err : sr.getErrors())
                      {
                          system.debug(err.getStatusCode()+':'+err.getMessage());
                      }
                         
                   }
                  }                                                     
               }
               
           }catch(Exception e){
                System.debug(e.getMessage());
            }   
     }       
    global void finish(Database.BatchableContext BC)
    {
       
    }
}
------------------------------------------------------------------------------------------------------------------------------------------------------------
Test Class:


@isTest
public class FacultyearnGFCBatchTest {      

    @TestSetup
    public static void setup() {    
    
    Id CPS_ACCOUNT_REC_TYPE = NEUSFIDHelper.retrieveRecordTypeId(CPSConstants.REC_TYPE_ACCOUNT_APPLICANT, 'Account');
    Id TEACHING_ASSIGNMENT_REC_TYPE = NEUSFIDHelper.retrieveRecordTypeId(CPSConstants.FACULTY_TEACHING_ASSIGNMENT_RECORD_TYPE_NAME, 'Contract');

     Account acc = new Account(FirstName = 'Novak', LastName = 'Djokovic', CPS_faculty_type__pc = 'Lecturer' ,Faculty_Employment_Status__pc ='Active', Union_Member__c = true, NU_ID__c = '1112229', RecordTypeId = CPS_ACCOUNT_REC_TYPE);
     insert acc;
     Term__c term = 
       new Term__c(
                        Name = 'Winter 2022 CPS Quarter',
                        Term_External_Id__c = '006A',
                        Academic_Year__c = '2022');
       insert term;

       Part_of_Term__c partofTerms =
       new Part_of_Term__c(
                    Name = '8',
                        Term__c = term.Id,
                         Short_Name__c = 'Spring 2022, First Six-week Session',
                         Part_of_Term_External_Id__c = 'A10008',
                        Start_Date_Part_of_Term__c = Date.parse('4/1/2022'));
       insert partofTerms;


         Course_Catalog__c courseCatalog = 
            new Course_Catalog__c(Name = 'cat-1');

         insert courseCatalog;

          Course_Section__c cSec = new Course_Section__c(
                        Name = '202215-80001',
                        CRN__c = '80001',
                        Course_Catalog__c = courseCatalog.id,
                        Part_of_Term__c = partofTerms.Id,
                        Credit_Hours__c = 3,
                        Payroll_Actual_Enrollment__c = 0,
                        Course_Section_Status__c  = 'Active');
          insert cSec;

           Compensation_Rate__c compensationRate =
           new Compensation_Rate__c(
                        Name = 'No Payment for this Class',
                        RecordTypeId = CPSCompensationRateUtil.getRecordTypeId('Base Contract Pay'),
                        Rate_Type__c = 'Flat Amount',
                        Amount__c = 8000);
           insert compensationRate;
           Contract contract =null;
                    contract = new Contract(
                    AccountId = acc.Id,
                    Academic_Year__c = '2018-2019',
                    Is_Canceled__c = false,
                    StartDate = Date.newInstance(2018, 10, 10),
                    RecordTypeId = TEACHING_ASSIGNMENT_REC_TYPE,
                    Course_Section_ID__c = cSec.id,
                    Type__c = 'Primary',
                    Status = 'Draft',
                    Campus__c = 'Boston',
                    Canceled_Contract_Fee__c = '100% GFC Fee',
                    Compensation_Rate__c = compensationRate.id);
            insert contract;
            
            Course_Section__c cs = new Course_Section__c(Id=cSec.Id);
            cs.Course_Section_Status__c ='Cancelled';
            update cs;

            Contract con = new Contract(Id = contract.Id);
            con.Status ='Activated';
            update con;

            Faculty_Good_Faith_Consideration__c fac = new Faculty_Good_Faith_Consideration__c();
            fac.Contract__c = con.Id;
            fac.Course_Section__c = con.Course_Section_ID__c;
            fac.AccountName__c = con.AccountId;
            fac.GFC_For_Given_Course__c = true;
            insert fac;
                                    

    }


    public static testmethod void test_GFCexecute() {
        // Implement test code
        List<Contract> conLst = new List<Contract>();
        Database.BatchableContext bc;
        Test.startTest();
        
        try {
            conLst =[Select Id,name,Status,Course_Section_Status__c,Course_Section_ID__c,AccountId from Contract];
            
            FacultyearnGFCBatch gfcBatch = new FacultyearnGFCBatch();           
            Database.executeBatch(gfcBatch);
            
            gfcBatch.execute(bc,conLst);            

        } catch(Exception ex) {
            System.debug(ex.getMessage());
        }       

        Test.stopTest();

        System.assert(conLst[0].Status=='Activated');
        System.assert(conLst[0].Course_Section_Status__c=='Cancelled');
        


    }

    
    public static testmethod void testStart() {
        List<Faculty_Good_Faith_Consideration__c> facl = new List<Faculty_Good_Faith_Consideration__c>();
        Database.BatchableContext bc;
        Test.startTest();

        facl =[Select id,name,Course_Section__r.Course_Section_Status__c from Faculty_Good_Faith_Consideration__c];
        FacultyearnGFCBatch gfcBatch = new FacultyearnGFCBatch();
        gfcBatch.start(bc);

        Test.stopTest();
        System.assert(facl[0].Id!=null);


    }   
    
    
}
Hello All,

I have tried to redirect to another lightning page when clicking on the button but I have encountered the below error.
This page has an error. You might just need to refresh it.
Action failed: c:L_Redirect_to_Otherpage$controller$handleClick [Cannot read property 'setParams' of undefined]
Failing descriptor: {c:L_Redirect_to_Otherpage$controller$handleClick}

Snippet below.

Component:
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
	
    <aura:attribute name="url" type="String" />
    
    <p><a onclick="{!c.handleClick}">link to record</a></p>

</aura:component>

JS Controller:
 
({
    handleClick: function (component, event, helper) {
        var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
            "url": "http:www.google.com"
        });
        navEvt.fire();
    }
})

Please help me where I did a mistake.

Regards,
VSK98

 
  • July 12, 2018
  • Like
  • 0
Send Email and Log a Call Actions not showing on Activity History Related List in lightning.
I have added on page layout related list.
Pleas help me out regarding this.