• GauravGarg
  • PRO
  • 2922 Points
  • Member since 2015
  • Salesforce Developer
  • Accenture / People4u INC


  • Chatter
    Feed
  • 95
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 9
    Questions
  • 989
    Replies
how to iterate over map of Map<ID,List<String>>in apex
  • October 02, 2018
  • Like
  • 0
So if the output is blank or a default value I would like it to highlight, is this possible, if so how?
User-added image
visualforce page:
<apex:form >    
         <apex:pageBlock title="Your Carts:"> 
            
            <apex:pageblockTable value="{!MapProducts}" var="a"> 
                <apex:column >
                    <apex:image width="100" height="100" value="{!URLFOR($Resource.ProductImage, 'ProductImage/' & MapProducts[a]['ImageName__c'])}"></apex:image>
                </apex:column>
                
                <apex:column headerValue="Name" value="{!MapProducts[a]['Name']}"/> 
                <apex:column headerValue="Price" value="{!MapProducts[a]['Price__c']}"/> 
                <apex:column headerValue="Amount" > 
                    <apex:inputText style="text-align:right;width:100px;" value="{!MapProducts[a]['Amount']}"/>
                </apex:column>
                <apex:column headerValue="Money" value="{!MapProducts[a]['Total']}"/> 
                <apex:column >
                    <apex:commandLink action="{!deleteItem}" reRender="MapProducts" ><apex:param assignTo="{!iKey}" value="{!a}" name="assignvalue" /> Remove Row</apex:commandLink>
                </apex:column>
            </apex:pageblockTable>   
          <apex:pageBlock title="Total Money:"> 
             <apex:outputText >{!iTotalMoney}</apex:outputText> 
          </apex:pageBlock>
        </apex:pageBlock> 
   </apex:form>

apex function:
public void deleteItem()
  {
      System.Debug('deleteItem') ;
      iTotalMoney=0;      
      System.Debug(iKey) ;
      MapProducts.remove(iKey);
      for (Integer key : MapProducts.keySet()) {     
        iTotalMoney +=Double.valueOf(MapProducts.get(key).get('Total'));
      }
  }

Log debug output
43.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;NBA,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WAVE,INFO;WORKFLOW,INFO
03:14:43.0 (94306)|USER_INFO|[EXTERNAL]|0057F000002yTNz|daitb@vnitsolutions.com|Pacific Standard Time|GMT-07:00
03:14:43.0 (138242)|EXECUTION_STARTED
03:14:43.0 (143358)|CODE_UNIT_STARTED|[EXTERNAL]|0667F000009PMhv|VF: /apex/carts
03:14:43.0 (360015)|VF_DESERIALIZE_VIEWSTATE_BEGIN|0667F000009PMhv
03:14:43.0 (7435075)|VF_DESERIALIZE_VIEWSTATE_END
03:14:43.0 (9840462)|SYSTEM_MODE_ENTER|true
03:14:43.0 (14743313)|SYSTEM_MODE_ENTER|true
03:14:43.0 (15488240)|VF_SERIALIZE_VIEWSTATE_BEGIN|0667F000009PMhv
03:14:43.0 (17250235)|VF_SERIALIZE_VIEWSTATE_END
03:14:43.20 (20160362)|CUMULATIVE_LIMIT_USAGE
03:14:43.20 (20160362)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

03:14:43.20 (20160362)|CUMULATIVE_LIMIT_USAGE_END

03:14:43.0 (20198901)|CODE_UNIT_FINISHED|VF: /apex/carts
03:14:43.0 (21042239)|EXECUTION_FINISHED
log not exist text: deleteItem
Why delete row action not call apex function?

Hi,

How to get the record type name in before insert.

Requiremnet is need to check in if condition for record type name 
Ex : if(record type name= 'A' ) 

We have a custom EmailService for inbound messages written in apex, which is processing Inbound email messages and then showing them in a lightning component.
The type od the received email object is EmailMessage. On the production org, when the system administrator is logged in, he sees all the needed incoming emails (the component is showing them as it should be, querying also works). It all worked well in our sandbox though.
The problem is when the user is logged in. The component does not show any emails and they are not visible also by querying. The problem is I suppose with some permissions, but the EmailMessage object in our org is not customizable when it comes to permissions (everything is set to default and is not changeable). The user has a company community licence. Any help or suggestion would be greatly appreciated.
HI All,

can anyone provide me a solution on how to update the ownerId field in the ContentDocument object. i have tried doing this with a trigger on ContentDocument object but it does not seems to work
Hi,

I have this trigger that I would like to convert to an apex class and I would like to add some code to the class.  The trigger changes contacts to the account owner id when the account owner is changed.  What I would like to add is something that also changes the contact owner when a contact is created or added to the account.

Here is the trigger I have.

trigger AlignContactownertoAccountOwner on Account (after insert,after update) {
      Set<Id> accountIds = new Set<Id>();
      Map<Id, String> oldOwnerIds = new Map<Id, String>();
      Map<Id, String> newOwnerIds = new Map<Id, String>();
      List<Contact> contactUpdates = new List<Contact>();
      for (Account a : Trigger.new)
      {
         if (a.OwnerId != Trigger.oldMap.get(a.Id).OwnerId)
         {
            oldOwnerIds.put(a.Id, Trigger.oldMap.get(a.Id).OwnerId);
            newOwnerIds.put(a.Id, a.OwnerId);
            accountIds.add(a.Id);

         }

      }

        if (!accountIds.isEmpty()) {

         for (Account acc : [SELECT Id, (SELECT Id, OwnerId FROM Contacts) FROM Account WHERE Id in :accountIds])

            {

            String newOwnerId = newOwnerIds.get(acc.Id);
            String oldOwnerId = oldOwnerIds.get(acc.Id);

            for (Contact c : acc.Contacts)

            {

               if (c.OwnerId == oldOwnerId)
               {

               Contact updatedContact = new Contact(Id = c.Id, OwnerId = newOwnerId);

               contactUpdates.add(updatedContact);

               }

            }

             

            }

       }
            update contactUpdates;

}

Any help would be great.

Thanks,

Michael 
Hello Devs, I have the following Trigger and Class that was working fine until this morning when I received the following error of Too Many future calls: 51. 

Any idea how to alleviate gettign this error?  Here is my trigger and class code....thank you all for any help you can provide....

Trigger:
 
trigger DeleteExtraBookingsTrigger on Opportunity (after insert) {

    For(Opportunity opps : Trigger.new){
        If(opps.Auto_Bookings__c == True){
            
            
        DeleteExtraBookingsClass.deleteRecords(Trigger.newMap.keySet());    
            
        }
    }
    
    
}

Class code:
 
public class DeleteExtraBookingsClass {

    @future
    public static void deleteRecords(Set<ID> oppIdsToDelete){
        List<Opportunity> opp = [SELECT ID, Armor_Product_Category__c From Opportunity WHERE ID IN : oppIdsToDelete AND Auto_Bookings__c = True
                                AND (Armor_Product_Category__c = null or Armor_Product_Category__c = 'Armor | null')];
        
        If(opp.size()>0){
        delete opp;
        database.emptyRecycleBin(opp);
        }
    }
    
}

Hello everyone.
I have a requirement to store information from different Contacts in Google Drive. My problem is that I would like to create a directory dynamically for each new contact and I have not found much information on how to do it from apex. Has anyone had success performing this functionality?

Greetings thank you!
Hi,

The below trigger was fired after updating the field twice, but it was not fired before update.
 
trigger age on Account (before update) {

  Map<Id,Account> ageMap = new Map<Id,Account>(); 
  Account[] acct = [SELECT Id,Age__c FROM Account WHERE Id IN : Trigger.newMap.keySet()];
    
     for(Account a : trigger.new){
           

            if(a.age__c != null){
             
                ageMap.get(a.Id);
                a.Is_Age_Updated__c = true;
               
            }
            else{
                
             ageMap.get(a.Id);
             a.Is_Age_Updated__c = false;
            }                  
    }

}


 
  • February 02, 2018
  • Like
  • 0
Hi All,
          I have two objects called product and product details. Product field is lookup on product details.
          In product details object, if I have a product detail record pd1 with product p1, I shouldn't be able to create or update 
          another product detail pd2 with product p1.
         
           How can I achieve this?
Hi,

    I have written a trigger .I want this trigger to be executed when clicked on a custom button in a VF page. Can anyone help me out with this?
Thanks.
What happens to the secondary master detail relationship if the primary master detail relationship is changed to lookup?
Hello,
I'm new to triggers and struggling with this. I need a trigger that pulls the Opportunity name and creates a new record in my custom object, AE Opp. I do not need it to create a lookup or link it to the opp, i just need it to create a whole new record so that I can create a task on it.. Is this feasible?
Hi all,

I'm new to Salesforce and would like to ask for more information about different salesforce editions and versions. Our team wants to use an organization, with Force.com account to be used as PaaS for custom application development. This means without the standard CRM features, which Salesforce.com provides like Campaigns, Leads, Opportunities, or Cases. But to get access to the “Core” functionality of Accounts and Contacts, Reports, Dashboards, Documents, and Activities and Custom Objects.  I know the Salesforce platform (https://www.salesforce.com/products/platform/lightning/?d=70130000000f27V&internal=true) can be used for this case. I have a free trial to test it out but still, it provides me features for Salesforce standard license, not for Salesforce platform license. Would please tell me which edition and licenses are best to be used when I want to use Force.com as a platform.
How to check whether two users are in the same queue in apex trigger?
  • January 08, 2018
  • Like
  • 0
Hello All,
I am an admin not a developer and I have written a simple before delete trigger and test class. The test is getting 80% coverage which is fine as I can deploy it, but for my own curiosity can anyone tell me how I can get 100% coverage please?

Thanks in advance

Trigger
trigger CheckGiftPledgeCount on Session__c (Before Delete) {
If(trigger.isBefore){
   If(Trigger.isDelete){
       for(Session__c a: trigger.old){
           if(a.TotalMembersRecruited__c>=1){
               a.adderror('You cannot delete a session if the count of total members recruited is greater than 0');
                 }
             }

        }
   }
}

Test Class
@isTest

private class CheckGiftPledgeCountTest{
     static testMethod void testTrigger(){
     Session__c ses = new Session__c() ;
     ses.Recruiter__c = '0035800000tXTlw';
     ses.Booking__c = 'a005800000K5yKl';

     insert ses;
     delete ses ;
     }
}

 
I am getting json data from an external webservice. The format of json data is as follows.
      Fullname=Michael$stone
      homephone=239923923 
I need to map the firstname and lastname to the Lead object standard fields.
so firstname=Michael and lastname=stone.

so my query is how to split the fulname in json data and then store into lead object fields.

Thanks
Smita B
 
I want to clone a record through Apex using a trigger to customize staging and update date fields.
I've run into two problems:

1. My original record isn't saved. I want the original record to save and a copy to be made from it. I'm looking for an automatic cloning action essentially.

The copy is known by the addage "planning" onto the name of the Opportunity.

2. The trigger is acting on all updates, meaning I can't change and save a field without activating the trigger. Do
I just need to change the parameters? Is there a way to check and limit with Trigger.Old?

Trigger that conditionally stages.
trigger FinancialPlanning on Opportunity (before update) {
 List<Opportunity> oppList = new List<Opportunity>();
    //creating list of opps in which items will live  
    for(Opportunity x : Trigger.new) {
          x.Name = x.Name + ' planning';
          
      
          if (x.StageName == '0 - Deferred'){
    			x.StageName = '1 - Research';
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '0 - Declined'){
                x.StageName = '1 - Research';
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
                
          }else if (x.StageName == '0 - Unresponsive') {
                x.StageName = '1 - Research';
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
               
          }else if (x.StageName == '1 - Research') {
				x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
               
          }else if (x.StageName == '2 - Intro'){
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '3 - Educate'){
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '4 - Ask Ready'){
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '5 - Request'){
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '6 - Verbal'){
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '7 - Committed'){
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else{
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
          }
          //get this picklist's value and update field with method. 
          x.Designated_Fiscal_Year__c = x.Designated_Fiscal_Year__c ; 
		  
        if (oppList.size() > 0) insert oppList;
            oppList.add(x);
      }
     
}
Here is what I've got in my controller class:
public class FinancialCloningController {
    //added an instance varaible for the standard controller
    private ApexPages.StandardController controller {get; set;}
    
    //instance for the variables being passed by id on the url
	private Opportunity opp {get;set;}
    
    //set the id of the record that is created
    public ID newRecordId {get;set;}
    
    public FinancialCloningController(ApexPages.StandardController controller) {
        this.opp = (Opportunity)controller.getRecord();
        this.controller = controller;
        opp = (Opportunity)controller.getRecord(); 
         
    }
    
    public PageReference cloneOpportunity() {

         // setup the save point for rollback
         Savepoint sp = Database.setSavepoint();
         Opportunity newOpp;

         try{

             //Copy the Opportunity - only include the records you want to clone 
             opp = [SELECT Id, Name, StageName FROM Opportunity WHERE ID = :opp.id];
             insert newOpp;
             newOpp.clone(false, false, false, false);

             //set the id of the new po created for testing
             newRecordId = newOpp.id;
             

         } catch (Exception e){
             // roll everything back in case of error
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

          return new PageReference('/'+newOpp.id+'/e?retURL=%2F'+newOpp.id);
        
    }

}
I'm not sure that I can isolate a triggers actions to a button. Obviously, I'm very new to Salesforce and don't know if there is a way to do this without triggers. I feel the trigger is too powerful in this case. Why is the original record saving as a new record (conditional logic is fine and works), and can this trigger be isolated to a button action?

Thanks.





 
I am working on lightning flow for a month. My flow, there are about 5 screens and on every screen has 1 or 2 pick-list / radio buttons which are marked as mandatory.
The problem I am facing here is, the customer selects the choice values and navigates forward (next) but in-case if he returns back to the screen, the selected value is reset to default i.e. the choice has been reset.

 Can you please provide an optimal solution out-of-the-box to fix this issue. Thanks
Can we convert List<account> to Map<String, String> i.e. Map<FieldLabel, FieldValue> pair. 


Thanks in advance. 
I am able to upload documents in Lightning Flow using Standard lightnign component "forceContent:fileUpload" and attached related record to "current user id". 

My Requirement is to display the "files name" of uploaded document. I have attribute "Uploaded file names" and store into a collection variable, but when I choose this option, my flow screen is showing blank. 

I want to display all the file name that are uploaded. 

Any idea?

Thanks in advance. 
 
Hi All,

I am new to lightning. My requirement is to load external Minify javascript file which will run a demo or walkthru over the object records, Dashboard to enlight customer to use Lightning. 

Currently, the same has been working in salesforce classic, but in lightning it is not allowed and throwing error. 

Do anyone facing the same issue? 
My client require to have two way integration between Salesforce - Siebel. 

Is there any third party (app exchange) tool. 
Or we should go with customized code. 

Please suggest. 
I want to create Opportunity Share records for two custom fields "Manager" and "Senior Manager"  lookup to User on Opportunity object. 

My Batch job is working as expected and creating those record perfectly. 

But, the issue is in Test Class:
  • I have created one createOpportunity() method, and create two Opportunities. 
  • Both the opportunities have Manager / Senior Manager field populated with User. 
  • Now, when I run this method, It will cover my Batch job and create sharing records ( that I can debug in batch job).
  • If I am trying to query those sharing record in Test Class using below query, it is giving 0 records. 
  • SELECT Id, manager__c, senior_manager__c, rowcause from Opportunity. 
Any ideas please. 
We have some VF page, that we visible as Public Site on my client website. The VF page are working fine but due to salesforce Standard Javascripts. The website perform is quite down. 

Can you please provide me some idea to avoid running these standard Javascript libraries. 

 
Hi All,

I have completed my Lightning Superbadge two months ago and since then it is showing in active module. Please help me out how can I fix this. I already had contacted with salesforce trailhead but they are providing no help. 

Thanks,
Gaurav
Hi All,

Today I have completed my Lightning super badge module, still it is showing under Active module.

User-added image

Please suggest how can I fix this. 

Thanks,
Gaurav
Somebody please help me on how to update Contact’s field value if I subtract two Custom Setting’s fields?
Hello all, 
I am looking for a SOQL request that could get me both the value and etiquette of a field on a custom object ; is this somehow possible in SOQL?
Thanks in advance
how to iterate over map of Map<ID,List<String>>in apex
  • October 02, 2018
  • Like
  • 0
I am facing this particular issue in which If anyone tries to modify the contact for a customer, an address of all contacts created by one user changes to modified address at the same time..
Kindly suggest how to correct this issue.
So if the output is blank or a default value I would like it to highlight, is this possible, if so how?
User-added image
Hi all,

I'd like to write a trigger which would send Order ana order item data after Order insert to a third party syshtem through http request post. Do you have any examples for this kind of request post?
Hi All,

I have a scenario where I need to create a VF page with these details:
whenever a parent record from (Auctions__c) object is selected, automaically option for creating a child record in 
(SellerAuctionItem__c) object opens up in which Auction field(read only) (master detial relationship) is autopopulated with the parent record selected. And rest can be filled and saved
Hi,

I want to upload files to opportunity. Only one file by opportunity. And I want to display the file on the page.

Is it possible?

I try to make some design but I can't see how I can capture the Opportunity ID.

https://help.salesforce.com/articleView?id=vpm_files.htm&type=0

Is it possible to explain me the inputs and the outpouts setup?

Thank you.
Has any one heard of Marketing Cloud Lite?
 

Hey Guys,

i am looking for a "best practice" solution, to create a conditionally url button. The button should be placed on the standard page layout.
Related to a value of the object, the button button should redirect the user to a page.

For example, if the status is x, redirect to a new task.
if the status is y, redirect to the homepage.
if the status is z, redirect to an external page.

Unfortunately, a javascript button is not a soultion for lightning.

I have created a controller and a methode to create a conditionally PageReference for each case. I dont think that this solution is best practice. Moreover, i used simply urls like
1new PageReference('https://...............+lead.id');
what is definitely not best practise.  So my button opens the page which is fireing the action methode automatically.

Conclusion, i am looking for : 
- a solution for lightning and classic
- a button placed on the standard page layout
- the button should redirect to different pages related to a value of the object
- a more best practice solution than mine 

I appreciate your help ! 

Cheers, 
Marry
I was planning to bring in data from an external database and found that it will cost us 13+GB of storage. The data has more than 7 million records across 4 tables, so at 2kb per record, the total cost would be 7000000*2/(1024*1024) = 13.4 GB. We would like to search and report on the data and add associated contacts and accounts to campaigns. What are our options?  
Hello Everyone, Hope all are doing good i have some information for you all go through it and give me a reply for that!

Amazon EC2 (AWS Certified)is an Infrastructure as a Service which offers pay-by-hour servers (EC2), storage (S3) etc. You bring your own software to the table – OS (Red Hat, Windows, whatever), Database (MySQL, Oracle, DB2, whatever), Search (your pick), Business Intelligence (Cognos, Oracle BI, whatever) – and then you piece it together and get it all to work. The benefits are that you can do whatever you want – and the con is you have to manage complexity yourself.

Force.com, by contrast, is a Platform as a Service that provides a pre-integrated offering that already has a database, search, BI Reports, identity/security etc. all built in – that you program using a Java-like language (Apex). With the newly announced VMforce, a VMware and Salesforce.com offering, you will be able to use Java soon. Force.com automatically backs up your data, manages upgrades (your apps don’t need to know if Force.com is running on database version 11i or 11g, Dell boxes or Sun boxes, Linux or Windows etc.)

Regards
Sarahjohn
{!REQUIRESCRIPT("/xdomain/xdomain.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")}
{!REQUIRESCRIPT("/support/console/39.0/integration.js")}

var Program='{!Program_Member_MVN__c.Program_Name__c}';
var Pname=sforce.connection.query("Select Program__c from Program_Names__c");
var rec16 = Pname.getArray('records');
var status='{!Program_Member_MVN__c.Status_MVN__c}';
var PmId='{!JSENCODE(Program_Member_MVN__c.Id)}'; 
var PName='{!Program_Member_MVN__c.Program_Name__c}'; 
var url;
if (sforce.console.isInConsole()) {
if(Program == rec16){
alert("You are on the wrong Program")
} 

else if(status == 'On Therapy')
{
url = "/apex/Milestone_skip?id="+PmId;
window.open(url,'_blank','toolbar=0,location=0,menubar=0,width=800,scrollbars'); 
}  
else
{
alert("Patient must be ‘On-Therapy’ before skipping to a milestone");
}
}

This is my java script on click button code.In this i am querying  custom setting here:var Pname=sforce.connection.query("Select Program__c from Program_Names__c");
And i want to compare to field to show a alert.So i have to multiple values in custom setting.So how can i access all the values given in the custom setting in the java script code?