• chandrashekar Jangiti
  • NEWBIE
  • 35 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 26
    Replies
I need one solution for below code in LWC in Javascript..actually i need to show 'No results found' while searching in search box ,if no results found shows in below search box it should not selectable..

if (storeResponse.length == 0) {
                    component.set("v.Message", 'No Result Found...');
                } else {
                    component.set("v.Message", '');
                }
code is:
List<Id> rectypeId=new List<Id>();
            for(RecordType r:[Select Id,Name from RecordType where sObjectType ='Contact' AND DeveloperName IN('Contact')]){
              rectypeId.add(r.Id);
              }
Here how we can add constant variable for "DeveloperName IN('Contact')".

thanks,
Chandu
Hi Folks,

Can you help me on this below query..

"how we can check in developer console whether  current Loggedin user user having perticuler record type permission or not?"


Thanks,
Chandu
Hi All..

Will formula field work for permissions for logged in user for formula field?


Thanks,
Chandu
Hi All..
Could you please give sample code for
delete record based on conditions like if >0 delete record and >1 should not delete..
Hi friends..

how we can write junction object record creation and deletion via  apex code 
Hi Folks...

can we pass a parameter to a constructor from lightning component?

Thanks,
Chandu
Hi Folks...

am having one scenario like "when we click on button should open differenet pagelayout using recordtype based on user condition... " how many ways ways we can achieve this?? 

Thanks,
Chandu
is there any free Lightning component developed for Gridbuddylike related list editable,mass updates  in salesforce?
how we can add visual force pages in lightning dashboard?
Hi Friends...

How we can add QuickActions in recordlistview buttons...any idea please help me...reference find below image..


Thanks,
ChanduUser-added image
Hi Friends...
I have one scenario in Lightning Component please help me..
Whenever On click of Help, a popup should open where any sample text needs to be displayed like in the 2nd screenshot(with expand(+) and collapse(-) option)..



User-added imageUser-added image

Thanks,
Chandu
Hi friends...
Am struggling to write Test class for below code for Getting Lead...please help me t's urgent..



public static Lead getLead(String recordId) {
  Lead lead = [Select id,Status,Status__c  from Lead where id=:recordId]; 
  return lead;
    } 



Thanks
Chandu
Hi Folks,I want to you guys to write Test class for below code, i did only 44% code coverage...
below is 
Apex class:
public with sharing class UpdatesOnOpptySave{
    public static void updateRecs(List<Opportunity> lstafterUpdateOppties){
        System.debug('Method invoked');
        for(Opportunity oppObj: lstafterUpdateOppties){
        if(oppObj.bizfin_pending__c == true &&(((oppObj.StageName == 'Shortlisted' || oppObj.StageName == 'Negotiation' ) && oppObj.Amount >= 1000000) || oppObj.CustomerType__c=='EE')) {
                oppObj.bizfin_pending__c = false;
                System.debug('----------------------------2nd If-------------------------'+oppObj.bizfin_pending__c );
            }
            
                      
            //If the opportunity stage is "Proposal Stage" and amount is less than 1 million uncheck pricing pending checkbox
            if((oppObj.StageName == Label.Opportunity_Phase_Proposal_Stage || oppObj.StageName == 'Shortlisted' || oppObj.StageName == 'Negotiation' ) && oppObj.Amount <1000000 ) {
                //Recall the opportunity from approval
                UpdatesOnOpptySave.recallOpportunity(oppObj.id);
                oppObj.Pricing_Approval_Pending__c = false;
            }
            
            if(oppObj.stagename==Label.Opportunity_Phase_Qualified_Lead && oppObj.Opportunity_Work_Type__c=='Staff Aug' && oppObj.Qualified_by_manager__c==false)
            {
                UpdatesOnOpptySave.recallOpportunity(oppObj.id);
                oppObj.Qualified_by_manager__c=true;
            }
    }
        
  } 
  
   public static void recallOpportunity(Id oppId){
        List<ProcessInstanceWorkitem> piwi = [SELECT Id, ProcessInstanceId, ProcessInstance.TargetObjectId FROM ProcessInstanceWorkitem WHERE ProcessInstance.TargetObjectId =: oppId];
        
        if(!piwi.isEmpty()){
            
            Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest();
            req.setAction('Removed');        
            req.setWorkitemId(piwi.get(0).Id);
            req.setComments('Recalling the record as amount is less than 1 million');
            Approval.process(req,false);
           
            
        }
    } 
}

Test class:
@isTest
public class TestOppBeforeUpdate {
  @isTest static void TestUpdateOpportunity() {
       Profile p = [select id from Profile where profile.name='System Administrator' limit 1];

           User u = new User(ProfileId = p.id,LastName = 'Test', FirstName = 'Test', Username ='test7778@gmail.com',
                             Alias='test',Email='test7778@gmail.com', TimeZoneSidKey='America/Los_Angeles', 
                             LocaleSidKey='en_US', EmailEncodingKey='UTF-8', LanguageLocaleKey='en_US');
            Insert u;
            System.runAs(u) {

      List<Opportunity> opplist=new List<Opportunity>();
            Account acc=new Account();
          acc.Name='test';
            insert acc;
      Contact con=new Contact();
      con.LastName='test';
      insert con;
      
Opportunity opp=new Opportunity();
      opp.Name='test';
      opp.StageName='test';
      opp.Type='test';
      opp.CloseDate=system.today()-3;
      opp.Description='test';
      opp.AccountId=acc.Id;
      opp.Account_Contact__c=con.Id;
      opp.Value_Proposition__c='test';
      opp.Contact_Role__c='test';
      opp.Start_Date__c=system.today()-5;
      opp.Winnability__c='test1';
      opp.Amount=1000;
      opp.BizFin_pending__c=false;
      opp.Qualified_by_Manager__c=true;
      opp.Pricing_Approval_Pending__c=false;
      opplist.add(opp);
          /*   Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
            req.setComments('Submitting request for approval.');
             req.setNextApproverIds(new Id[] {UserInfo.getUserId()});
            req.setObjectId(opp.Id);
           Approval.ProcessResult resu = Approval.process(req);

           System.assert(resu.isSuccess());
           System.assertEquals('Pending', resu.getInstanceStatus(),'Instance Status'+resu.getInstanceStatus());
           system.debug('status for approval::'+resu.getInstanceStatus());
            List<Id> newWorkItemIds = resu.getNewWorkitemIds();
            system.debug('newWorkItemIds ::'+newWorkItemIds );
                
                
            Approval.ProcessWorkitemRequest req2 =  new Approval.ProcessWorkitemRequest();
            req2.setComments('Approving request.');
            req2.setAction('Approve');
            req2.setNextApproverIds(new Id[] {UserInfo.getUserId()});//UserInfo.getUserId()
            system.debug('req2::'+req2);
           
           req2.setWorkitemId(newWorkItemIds.get(0));
            system.debug('req3::'+req2);
           Approval.ProcessResult result2 =  Approval.process(req2);           
            System.assert(result2.isSuccess(), 'Result Status:'+result2.isSuccess());
            System.assertEquals(  'Approved', result2.getInstanceStatus(),'Instance Status'+result2.getInstanceStatus());
          ApexPages.currentPage().getParameters().put('id',opp.id);
            ApexPages.StandardController sc = new ApexPages.standardController(opp);
             UpdatesOnOpptySave rp = new  UpdatesOnOpptySave(sc);
            rp.appRej('Approve');
            rp.approveAll();
            rp.ApproveUnderCon();
            rp.getProsInsts();
            rp.rejectAll();

*/

      Test.startTest();
      UpdatesOnOpptySave.updateRecs(opplist);
      UpdatesOnOpptySave.recallOpportunity(opp.Id);
      Test.stopTest();
  }
  }
}


Thanks,
Chandu

Hi  Folks,

I need one trigger it is urget,
I have 3 objects like Alerts,Subscriptions,AlertSubscriptions...Subscriptions obj have Lookup User,Country picklist fields and Alerts objetct have picklist Country__c ,Name text field,

so here whenever in Alerts object selected Country field as "India" need to display India subscription user records in Junction object AlertSubscription..

Hi Code player's..

Iam new to Lightning and i have one query "How we can pre-populate values while creating record in lightning component page..." please help with some example codes...


Thanks,
Chandu
Hi 
Folks, I new to Lightning component for creating Lookup fields for Custom Object ,that Lookup field for the custom object are Account,Contact and Opportunity..so how we can imlement this in component..

thanks,
Chandu

Hi i need to have help "I created VFpage and i return javascript like below but when am clicking on CANCEL and SAVE buttons it is not redirecting to Same record page.."

my script in VFpage:
<script language="JavaScript" type="text/javascript">
        function CloseAndRefresh(){
            window.opener.location.href="/{!$CurrentPage.parameters.OppId}"; 
            window.top.close();
            }
    </script>

and buttons:
<apex:commandButton action="{!saveCurrentStep}" value="Save" oncomplete="javascript:CloseAndRefresh()" status="Status"  />
            
           <apex:commandButton action="{!CancelCurentStep}" value="Cancel" oncomplete="javascript:CloseAndRefresh()"  />

So..here i need  below methods need to be execute..so i need below entire code foe save and cancel..
public void SaveCurrentStep(){
}
and 
public Void CancelCurentStep{
}

Hi

I have one vfpage it is having names and tables ,but i want that to be show like some added styles and lok like lightning UI ,here we are not going to use Lightning component
Hi,am sharing screen shot for need to dipsly related contacts of Account and selected record needs to be delete for this I need VF page code and controller 
User-added image
code is:
List<Id> rectypeId=new List<Id>();
            for(RecordType r:[Select Id,Name from RecordType where sObjectType ='Contact' AND DeveloperName IN('Contact')]){
              rectypeId.add(r.Id);
              }
Here how we can add constant variable for "DeveloperName IN('Contact')".

thanks,
Chandu
Hi All..
Could you please give sample code for
delete record based on conditions like if >0 delete record and >1 should not delete..
Hi friends..

how we can write junction object record creation and deletion via  apex code 
how we can add visual force pages in lightning dashboard?
Hi Friends...

How we can add QuickActions in recordlistview buttons...any idea please help me...reference find below image..


Thanks,
ChanduUser-added image
Hi friends...
Am struggling to write Test class for below code for Getting Lead...please help me t's urgent..



public static Lead getLead(String recordId) {
  Lead lead = [Select id,Status,Status__c  from Lead where id=:recordId]; 
  return lead;
    } 



Thanks
Chandu

Hi  Folks,

I need one trigger it is urget,
I have 3 objects like Alerts,Subscriptions,AlertSubscriptions...Subscriptions obj have Lookup User,Country picklist fields and Alerts objetct have picklist Country__c ,Name text field,

so here whenever in Alerts object selected Country field as "India" need to display India subscription user records in Junction object AlertSubscription..

Hi Code player's..

Iam new to Lightning and i have one query "How we can pre-populate values while creating record in lightning component page..." please help with some example codes...


Thanks,
Chandu
Hi 
Folks, I new to Lightning component for creating Lookup fields for Custom Object ,that Lookup field for the custom object are Account,Contact and Opportunity..so how we can imlement this in component..

thanks,
Chandu

Hi i need to have help "I created VFpage and i return javascript like below but when am clicking on CANCEL and SAVE buttons it is not redirecting to Same record page.."

my script in VFpage:
<script language="JavaScript" type="text/javascript">
        function CloseAndRefresh(){
            window.opener.location.href="/{!$CurrentPage.parameters.OppId}"; 
            window.top.close();
            }
    </script>

and buttons:
<apex:commandButton action="{!saveCurrentStep}" value="Save" oncomplete="javascript:CloseAndRefresh()" status="Status"  />
            
           <apex:commandButton action="{!CancelCurentStep}" value="Cancel" oncomplete="javascript:CloseAndRefresh()"  />

So..here i need  below methods need to be execute..so i need below entire code foe save and cancel..
public void SaveCurrentStep(){
}
and 
public Void CancelCurentStep{
}

Hi

I have one vfpage it is having names and tables ,but i want that to be show like some added styles and lok like lightning UI ,here we are not going to use Lightning component
Hi,am sharing screen shot for need to dipsly related contacts of Account and selected record needs to be delete for this I need VF page code and controller 
User-added image