• Tejender Mohan 9
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 28
    Replies
Hi Everyone 
I am New in Salesforce I am Beginner
So Please Help Me Out For this Scenario1
When an Account's BillingPostalCode is changed:
1.Change the Account Owner to the Sales Representative assigned to the new zip code

Sales Representative is in Another Object Territory(Territory__c)
in this object two Fileds one is ZipCode(Text) and other One is Owner(Lookup Field (User Lookup))
In First Requirement Change the Account Owner to the Owner Field in Territory and BillingPostalCode is also Mapp from ZipCode in territory Object and then Assign the AccountOwner to the Owner(Lookup) of Territory Object

2.Change the Owner field of all the Account’s Contacts to the same OwnerFiled in Territory Object(Sales Representative).

3.Change the Owner field of all the Account’s Open Opportunities to the same OwnerFiled in Territory Object(Sales Representative).


Please Replay as Soon Possible
How to use trigger i dont know about trigger So Please Help me out for this Scenario  this is my First Trigger to write So Please Help

Thanks in Advance       
Neeraj Sharma
 

Hello
I am trying to keep to scroll bar of a scrollable division always visible.
If you check the following help page of salesforce 
https://www.lightningdesignsystem.com/utilities/scrollable/#CSS-Class-Overview
You can notice that scroll bars are visible only when the user first starts scrolling using a mouse or touchpad but I am looking for a way to always have a scrollbar on the screen so that the user can scroll using left-click drag as well.
Could you please help me to know how to keep the Scroll bar always visible on a Scrollable division using 'slds-scrollable' class.

Thanks 

Hello
I noticed that the Aura Custom Lightning Component's JS code is easily readable on the browser when the components are used in a custom public site.
Is there any way to Obfuscate that JS code?
I understand that JS code can be easily un-obfuscated and it should carefully be written to avoid any server data manipulation hack but there should at least the Obfuscation of JS code for public custom sites to avoid any easy to perform hacks on the browser.

If currently there is no way to Obfuscate custom lightning components code on custom sites then could you please upvote this idea?


https://trailblazer.salesforce.com/ideaView?id=0874V000000LzYqQAK

Thanks

Hello,
How many Email Alerts and Tasks can be created on an Object?
Is there any documentation that gives details about the limits of creating Metadata Components in salesforce?
Thanks
Hi
I have one lightning component named "Add/Edit Invoice Line Item" (as seen on screenshot) I want to reload this component every time a user clicks on this tab. Is there any way or event which can be used to handle this? 
User-added image
My lightning component's controller has an array named newResources and using aura:iteration to show a table based on the values in it. There is a method in js "removeNewResourceColumn" which removes one element from that array and then the aura:itration updates the view with one less row but when the method removes the last element of array the aura iteration view is not getting updated.

E.g. If I have 8 records in the array then the table will show 8 rows. If removeNewResourceColumn removes 6th element the table will show 7 records but if removeNewResourceColumn removes 8th element the table still shows 8 records.
Has anyone ever faced this problem?
Hi,
While saving the below code, Following Error Occurs: "Variable does not exist: DeveloperName"
 
List<Dashboard> listAllDashboards = [SELECT DeveloperName,Type,FolderName,Folder.DeveoperName FROM Dashboard];
for(Dashboard d1 : listAllDashboards){
 System.debug(d1.Folder.DeveloperName);
}

 
I have been trying to update the Assignment Rule's Rule Entry assignTo field using UpdateMetadata Call. I have tried several ways but still not able to update it. Can someone please suggest any solution? Below is the code snippet :
MetadataService.IReadResult readResult = new MetadataService.ReadAssignmentRulesResult();

readResult = service.readMetadata('AssignmentRules', new String[]{'Lead'}); 

MetadataService.Metadata[] mdInfo = readResult.getRecords(); 

MetadataService.AssignmentRules TempAssignmentRules = (MetadataService.AssignmentRules) mdInfo[0];

 System.debug('Assignment Rule Name :---> '+ TempAssignmentRules.AssignmentRule[0].fullname); 

System.debug('Assigneee Name :---> '+TempAssignmentRules.AssignmentRule[0].ruleEntry[0].assignedTo);

 //Updating Value Here 
TempAssignmentRules.AssignmentRule[0].ruleEntry[0].assignedTo='teXYZ.com'; 
//Update 
MetadataService.SaveResult[] results = service.updateMetadata(new MetadataService.Metadata[] { TempAssignmentRules});
 System.debug('ERROR : '+ results[0].errors[0].message); //Error is "unexpected metadata".

 
On "SOQL Injection Demo" tab of SQL injection tab , when I perform search with age (e.g. 22) it gives the below error .
Please check !

sObject type 'security_thail__Personnel__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.
Error is in expression '{!whereclause_search}' in component <apex:commandButton> in page soql_injection: Class.SOQL_Injection.whereclause_search: line 21, column 1

An unexpected error has occurred. Your development organization has been notified.

 
Hi,
For test purpose i have created an approval process on goal object but now i am not able to delete it.
Can someone please suggest some solution .

Below is the errror  (getting same error on 2 of my dev org while deleting approval process of Goal Object )

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 
I want use the Custom Quote Calculator Plugin on Salesforce SteelBrick CPQ.
I have gone through many posts/Forum What I have understood is that this can be done using APEX or javascript code which have the methods like onInit,onBeforeCalculate etc as per the need.
But I am not able to understand how to use the custom Apex or javascript code? Where should I put it?
I have tried putting a JS code on static resource and tried to put the name of static resource on 'Quote Calculator Plugin' box on settings but it was not able to access it.
Assertion Failed: A Quote Calculator Plugin called OnInitTest is defined in your settings, but cannot be found.
I can not find the way of using these custom JS or APEX on SteelBrick CPQ setting.
How can I use my custom code for "Quote Calculator Plugin" ?
Hello Everyone,

Below given is the syntax for readMetadata call for fetching WorkflowRule specific to an object .
ReadResult = metadataConnection.readMetadata(string WorkflowRule, string[] fullNames);
I want to know that Is there any way to use a variable(which has the object name) in place of "string[] fullNames" ?

Below is the code snippet from my code,
while I am trying to execute it , it gives NULL for mdInfoWorkflow.fullname
Note: Cobj is a FileProperties type list of all object
 
... for (MetadataService.FileProperties n : Cobj)
 { readResultWorkflow = service.readMetadata('WorkflowRule', new String[] {n.fullname});
mdInfoWorkflow = readResultWorkflow.getRecords(); system.debug('mdInfoWorkflow :' +mdInfoWorkflow); ...

Please suggest.
Thanks in Advance :)
 
Hello Everyone,

Below given is the syntax for readMetadata call for fetching WorkflowRule specific to an object .
ReadResult = metadataConnection.readMetadata(string WorkflowRule, string[] fullNames);
I want to know that Is there any way to use a variable(which has the object name) in place of "string[] fullNames" ?

Below is the code snippet from my code,
while I am trying to execute it , it gives NULL for mdInfoWorkflow.fullname
Note: Cobj is a FileProperties type list of all object
.... for (MetadataService.FileProperties n : Cobj)
 { readResultWorkflow = service.readMetadata('WorkflowRule', new String[] {n.fullname}); 
mdInfoWorkflow = readResultWorkflow.getRecords(); system.debug('mdInfoWorkflow :' +mdInfoWorkflow); ...

Please suggest.
Thanks in Advance :)
 
Hello everyone,

For learnig purpose, I was creating a tigger with following functionality :

There is a canditate object with a checkbox "Active" ,
Trigger functionality is to create a new record in "Review" object whenever Active becomes True.

This is the code of Trigger :
 
trigger create_review_on_active on Candidate__c (after update) {
	//Creating a list of new record of Review__c
	list <Review__c> newrecord = new list<Review__c>();
	
	for (Candidate__c objacc : Trigger.new){
		if (objacc.active__c == True)
		{
			Review__c objectr = new Review__c();
			objectr.name = 'Tejender Review'; // Just Creating record with fixed name for test Purpose. (Please suggest a way to use candidate name here.)
			newrecord .add(objectr);
 }

	insert newrecord ;
}
}



To Test the Above code, Following  is the Testclass :
@isTest
public class Candidate_Review {
    
    @isTest static void candidate_review_test(){
    Candidate__c necan = new Candidate__c(name = 'TMJ');
    
    insert necan;
    
        
        Test.startTest();
        necan.Active__c = True;
        
		//At this point , i am not able to understand , how to Test whether the trigger is working fine or not ?
		
        Test.stopTest();
        
        
    }
}




Question : 
As per my knoweldge, for test class it is good to create a sample data so that i have created "necan" in test class but i am not able to understand how should i
verify the new record of Review__c after Active__c becomes true and how should i get the proper code coverage.

Please suggest any solution so that can i verify this trigger using test class and
also please provide your expert comments about any good practice that should have been used in above codes as i am a beginer to APEX. :)

Thanks in advance :)


 

Hello
I am trying to keep to scroll bar of a scrollable division always visible.
If you check the following help page of salesforce 
https://www.lightningdesignsystem.com/utilities/scrollable/#CSS-Class-Overview
You can notice that scroll bars are visible only when the user first starts scrolling using a mouse or touchpad but I am looking for a way to always have a scrollbar on the screen so that the user can scroll using left-click drag as well.
Could you please help me to know how to keep the Scroll bar always visible on a Scrollable division using 'slds-scrollable' class.

Thanks 

Hello
I noticed that the Aura Custom Lightning Component's JS code is easily readable on the browser when the components are used in a custom public site.
Is there any way to Obfuscate that JS code?
I understand that JS code can be easily un-obfuscated and it should carefully be written to avoid any server data manipulation hack but there should at least the Obfuscation of JS code for public custom sites to avoid any easy to perform hacks on the browser.

If currently there is no way to Obfuscate custom lightning components code on custom sites then could you please upvote this idea?


https://trailblazer.salesforce.com/ideaView?id=0874V000000LzYqQAK

Thanks

Hello,
How many Email Alerts and Tasks can be created on an Object?
Is there any documentation that gives details about the limits of creating Metadata Components in salesforce?
Thanks
Hey Dev Community!

Im currently working on a Custom Lightning Component and there are a few edge cases that I'm trying to account for. This lightning component makes a few API calls and therefore, may take some time to complete. I need a way to determine if the user bailed mid stream and I can do this easily with a 'Cancel' button with an onclick event that does some logic before calling $A.get("e.force:closeQuickAction").fire();

However, if the user bails with the 'X' in the top right hand corner the API calls cease and I cannot figure out how to handle this. The two ways I have theorized are either react the same way as the button, or make the button the only option but I dont know if I can react to the 'X' click nor if I can hide the 'X' with CSS or some equivalent. 

Any advice would be appreciated!! 
In Account object I have two fields which is taking the values from the Invoice related objects. How to write test class? I am new in development so please help me out to learn to write test classes. 
What are the best practices for test classes on related objects.
Thanks
Hi all,
You can help me, I have a ticket in the sales force support, because when my sales team and my operation team change the computer, example windows 10, windows 7, dell, accer, mac.
The screen does not show all the values ​​in the list of options by reason lost and disqualifies the reason selected by pipeline. This is because the zoom of the computer changes, the page does not respond.
This is terrible because in windows 10 it is necessary to zoom 80% on the page for work, the person with eye problem, it does not work hauhaua.
Has anyone ever been in this situation?
Salesforce closed my ticket, the answer is that the system is working as expected, but it is not.
The site must be responsible.
Thanks :)
Hi
I have one lightning component named "Add/Edit Invoice Line Item" (as seen on screenshot) I want to reload this component every time a user clicks on this tab. Is there any way or event which can be used to handle this? 
User-added image
My lightning component's controller has an array named newResources and using aura:iteration to show a table based on the values in it. There is a method in js "removeNewResourceColumn" which removes one element from that array and then the aura:itration updates the view with one less row but when the method removes the last element of array the aura iteration view is not getting updated.

E.g. If I have 8 records in the array then the table will show 8 rows. If removeNewResourceColumn removes 6th element the table will show 7 records but if removeNewResourceColumn removes 8th element the table still shows 8 records.
Has anyone ever faced this problem?
We have two custom fields on leads pardot hard bounced and pardot hard bounced cloned. if pardot hard bounced is true, we need to make pardot hard bounced cloned, if a lead updates a field on the record.

For this i have written Trigger and the code coverage is 0%. I want to deploy it to production. If i need to deploy  need to write a test class and apex class. Can someone help me with this. I am new to coding.

below is the trigger i have written:


trigger UpdateLead on Lead (before update) {
for(Lead l: Trigger.new) {
        If (l.pi__pardot_hard_bounced__c == true ){
           l.Pardot_Hard_Bounce_Cloned__c = true;
        }
        else {
        l.Pardot_Hard_Bounce_Cloned__c = False;
        }
    }
    }
  • March 19, 2019
  • Like
  • 0
Hi Everyone 
I am New in Salesforce I am Beginner
So Please Help Me Out For this Scenario1
When an Account's BillingPostalCode is changed:
1.Change the Account Owner to the Sales Representative assigned to the new zip code

Sales Representative is in Another Object Territory(Territory__c)
in this object two Fileds one is ZipCode(Text) and other One is Owner(Lookup Field (User Lookup))
In First Requirement Change the Account Owner to the Owner Field in Territory and BillingPostalCode is also Mapp from ZipCode in territory Object and then Assign the AccountOwner to the Owner(Lookup) of Territory Object

2.Change the Owner field of all the Account’s Contacts to the same OwnerFiled in Territory Object(Sales Representative).

3.Change the Owner field of all the Account’s Open Opportunities to the same OwnerFiled in Territory Object(Sales Representative).


Please Replay as Soon Possible
How to use trigger i dont know about trigger So Please Help me out for this Scenario  this is my First Trigger to write So Please Help

Thanks in Advance       
Neeraj Sharma
 
Hello,
I have the below code and now need to write a test class to promote code to production.  I have attempted to write a test class but the account trigger is not getting any code coverage. Am I inserting the data in the correct place. Could you help me? 

    trigger AccountTrigger on Account (before insert, before update) 
    {
        TriggerHandler handler = new TriggerHandler();
    
        if(TriggerHandler.runTriggerOnce) {
            TriggerHandler.runTriggerOnce = false;
    
            if(Trigger.IsUpdate) {
                handler.accountBeforeUpdate();
            }    
       }
    }
    
    public class TriggerHandler
    {
        public static boolean runTriggerOnce= true; 
    
        public void accountBeforeUpdate()
        { 
            accountUpdates();
        }
    
        private void accountUpdates()
        {
            for(Account newAcc: (List<Account>)Trigger.New)
            {
                List<Other_Opp__c> opps = [Select Id, Name, Type__c From Other_Opp__c WHERE Opp_Name__c = :newAcc.Id ];
                if(opps.size() > 0){
                     For (Other_Opp__c f : opps) {
                        f.Type__c = newAcc.Field1__c;
                     }
                     update opps
                }
                
            }
    
    @isTest
    private class TriggerHandler_Test{
      @isTest static void test1() {
    Test.startTest();
    
            Account acc = new Account(Name = 'New Acct');
            insert acc;
    
            Opp_Name__c  opp = new Opp_Name__c (Name = 'New Opp');
            insert opp;
            
            
            Account a = [Select Id, Name, Field1__c from Account where Id = :acc.Id];
            a.Field1__c = 'test1';
            update a;
    
    Test.stopTest();
        }
    }
I have a batch job that looks at when a contract end date is greater than today, that it then creates a new record for renewal.  I am trying to dynamically set the name of the record of the original contract and append each time/counter it has been renewed.  For example, contract A is past the end date, contract B is created and Contract B name is 'contract A name' + renewed 01.  Then if contract B is past the end date, contract C is created and Contract C name is 'contract B name' + renewed 02.  Etc...
I have a before insert, before update Trigger:
trigger OpportunityStageUpdate on Opportunity (before insert, before update) {
        
    for(Opportunity opp : trigger.new){
        if(opp.StageName == 'A'){
            opp.StageName = 'B';
        }
    }
}

But I also have a Validation Rule for StageName 'B'. Trigger can't execute. Why? Before trigger must be before Validation Rule.
Hey guys,

is it possible to redirect (or open a new tab) to the task edit page after the master record is updated ? 

Greetings , 

Sandra
Hello,
I have the following ApexTrigger which I want to test. I want to test that the second line in the last condition (first code snippet) is called depending on the size of the payload List. So, my question is, is there a way to assert the number of times the method, "makeCallout" is invoked? I will highly appreciate any pointers.
TriggerCallout.makeCallout(body, type);
 
trigger CaseTrigger on Case (after insert) {
    private String type = 'Case';
    List<Case> payload = new List<Case>();
    
    // Only Cases whose origin is the web are sent.
    for(Case newCase : Trigger.new){
        if(newCase.Origin == 'Web'){
            payload.add(newCase);
        }
    }
    
    // No need making a request with an empty body.
    if(!payload.isEmpty()){
        String body = System.JSON.serialize(payload);
        TriggerCallout.makeCallout(body, type);
    }
}

Cheers
Hi all,

I have one picklist field named DEPT_Function__c. and the values for the field are TTL,SSC,ESS, and LSS 

I have already created an Auto number field named Audit_Number__c

I would like to update the intial auto number criteria based on the slection of the picklist value - Ex - TTL-{YY}-{000} or SSC-{YY}-{000}

Please suggest a formula. I tried a few formulas with no luck :( 

Thanks in Advance