• anil Kumar
  • NEWBIE
  • 90 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 1
    Likes Given
  • 58
    Questions
  • 23
    Replies
Hi All,

I have to compare two string vales in apex whether they are same vales or not. Could anyone please help me.  

String str1 = Pay TV;AVOD;Basic TV;
String str2 = Basic TV;Pay TV;AVOD;

Thanks,
Anil Kumar
Hi All,

We have screen flow it fetchs account fields based on record id and update the record after the save. We have done the translations in Japanese and also translated picklist values. If user site language is Japanese user is not able update the record.  Getting restricted picklist value error. We have translated only picklist labels names not the api names. Is there any we can send label name in English while saving record.

Thanks,
Anil kumar 
Hi All,

Is it possibe to pass multiple record ids as input for Screen Flow. I have scnario where i need to pass Account and Case record Ids as input.

In the getRecords we can select only One object at a time. We can not secelect two objects to get records. 

Thanks,
Anil Kumar
Hi All,

I have requirement where I need to update account record by using  screen flow. We receive account record id as input and query the account fields and show them in the screen with record values. If any of fields are blank user will update them and click on save. The account  record should get updated. 

Could anyone pls help me what are steps i need to follow to accomplish  this.

Thanks in advance...

Thanks,
Anil kumar 

 
Hi All,

I need to create formula field to calculate fields completeness. Please help me on this.
 Name : 30%
 Email: 25%
 Phone: 25%
 Address: 10%
 DOB: 10%
Thanks,
Hi All,

I am trying to create formula field using standard Account field IsCustomerPortal in the formula. But is showing me field does not exist. Please help me on this.

User-added image
Thanks,
Anil Kumar 
Hi All,

I am trying to display custom validation message for lightning Select tag based aura id but validation is not coming on lightning Select tag.

Component Code:

<aura:component >
    <lightning:select name="select1" label="How many tickets?" aura:Id="leadtimesel" messageWhenValueMissing="Please choose one">
        <option value="">choose one...</option>
        <option value="1">one</option>
        <option value="2">two</option>
        <option value="3">three</option>
    </lightning:select>
    <lightning:button variant="brand" label="Brand" title="Brand action" onclick="{! c.handleClick }" />

</aura:component>

JS Code:

({
    handleClick : function(component, event, helper){
      var firstNameField = component.find("leadtimesel");
        var value = firstNameField.get("v.value");
        alert(value);
          if(value===''||value===null) {
             alert(123);
            firstNameField.showHelpMessageIfInvalid();
        
 
        }
    }
})

Thnaks,
Anil Kumar

 
Hi All,

We are trying to get selected checkbox value in the JS controller but selected values as coming as boolean values (True) instead of value. If we use ui namespace tag values are coming but lightning input tag is not working. we also tried with lightning:checkboxGroup it is not working inside aura iteration. Is there anyway where we can read checkbox value by using lightning input tag.


<aura:attribute name="languages" type="Object[]" />

<aura:iteration items="{!v.languages}" var="lang">
    <fieldset class="slds-form--compound">
        <form class="slds-form--inline">
            <div class="slds-form-element__control">
                <div class="slds-form-element__control">
                    <lightning:input type="checkbox" value="{!lang.language}" aura:id="boxPackLanguages" />

                    <!--<ui:inputCheckbox text="{!lang.language}" value="{!lang.isSelected}" aura:id="boxPackLanguages"  change="{!c.uncheckSelectAllLanguages}"  />-->
                </div>
                <label class="slds-form-element__label" for="text-input-01">&nbsp; {!lang.language}</label>
            </div>
        </form>
    </fieldset>
</aura:iteration>
<button class="slds-button slds-button--neutral" onclick="{!c.saveAndCreate}"><span>Save </span></button>

JS Code:

 saveAndCreate: function(component, event, helper) {

     var languagesSelected = false;
     var languages = [];
     var getAllLanguages = component.find("boxPackLanguages");

     if (getAllLanguages != null) {

       languagesSelected = true;
       languages.push(getAllLanguages.get("v.value"));

       console.log('Slected Value' + languages);
     }

Thanks,
Anil Kumar
Hi All,

We are replacing ui names space tags with lightning name space tag in the lightning component since they are going to deprecating soon.
We are displaying multiple languages with checkbox’s . When users selects check box language value should update in backend. While using ui:inputCheckbox tag we are able to update the  language but if we use  lightning:input type="checkbox" language values updating as Boolean value (True) in the back end instead of check box values. Below is the peace of code.

Component :
<aura:attribute name="selectAllLanguages" type="Boolean" default="false" />
  <aura:attribute name="languages" type="Object[]" />
 <aura:iteration items="{!v.languages}" var="lang">
  <lightning:input type="checkbox"  value="{!lang.isSelected}" aura:id="boxPackLanguages" />
   <!--<ui:inputCheckbox text="{!lang.language}" value="{!lang.isSelected}" aura:id="boxPackLanguages" />-->

</aura:iteration>

JS:

var languagesSelected = false;
var getAllLanguages = component.find("boxPackLanguages");
   if(getAllLanguages != null){
            //if there's only one language
            if (getAllLanguages[0] == null) {
                languagesSelected = true;
                languages.push(getAllLanguages.get("v.value"));
            }
           
            for (var i = 0; i < getAllLanguages.length; i++) {
                if (getAllLanguages[i].get("v.value") == true) {
                    languagesSelected = true;
                    languages.push(getAllLanguages[i].get("v.value"));
                }
            }
        }    
Hi All,

Lightning Ui namespace is deprecating soon hence we are migrating Ui namespace tags to lightning name space.  We have used below tag to select multi picklist values with Ui namespace. Now salesforce suggesting to use Use lightning:select or lightning:combobox .   

If we use lightning:select or lightning:combobox  not able to select multiple picklist values. Could anyone please help me on this.

I have tried using 
multiple="true"​​​​​​​ in lightning select tag but is not accepting. 

  <ui:inputSelect multiple="true" class="multiple" aura:id="InputSelectMultiple" change="{!c.onMultiSelectChange}">

            <ui:inputSelectOption text="Any"/>
            <ui:inputSelectOption text="Open"/>
            <ui:inputSelectOption text="Closed"/>
            <ui:inputSelectOption text="Closed Won"/>
     </ui:inputSelect>

Thanks,
Anil Kumar
Hi All,

While doing authorize an org i am getting below error. Please help me how to resolve this error.

ERROR running force:auth:web:login:  Cannot read property 'getInstance' of undefined

Thanks,
Anil Kumar 
Hi All,

I have a requirement where i need to save http resonce (JSON) in static resources and later i have to access the file and parse the response and save it in custom object.

Please let me know how to achive this ?

Thanks,
Anil Kumar
Hi All,

I have installed Salesforce CLI and VS code in my machine. When i try to create project  by using  (Ctrl+Shift+P). it shows as Salesforce CLI is not insalled.

below is path of both installations

salesforce CLI : C:\Program Files\Salesforce CLI\bin
VS Code: C:\Users\paka\AppData\Local\Microsoft VS code

User-added image
Hi All,

I have requirement where i need to show notes and attachmntes file (pfd ) of work order object in the lightning component. Could you please help me on this.

Thanks,
Anil Kumar 
 
Hi All,

I have to show child query count in aura:iteration. Could anyone help me how to  show child query count ?

Below is apex controller:

public without sharing class BH_LocationsListClass {
       @AuraEnabled
        public static List<SVMXC__Site__c>  findAll() {
            
            id persAccId; 
            Set<id> BusAcc = new Set<id>();
            set<id> Locid = new set<id>();
            List<id> SiteIds = new List<id>();
            persAccId = [SELECT AccountID FROM User WHERE id = :  UserInfo.getUserId()].AccountID;//0050V0000070hym  UserInfo.getUserId()
            List<Person_Account_Location_Association__c> AsscoBusList = [select BH_Business_Account__c from Person_Account_Location_Association__c where BH_Person_Account_Association__c =:persAccId];
            system.debug('Account ID '+ persAccId);
                    if(AsscoBusList.size()>0){
            for(Person_Account_Location_Association__c mainAcc : AsscoBusList){
                BusAcc.add(mainAcc.BH_Business_Account__c);
            }
        }
        List<SVMXC__Site__c>  SiteList = [select name from SVMXC__Site__c where SVMXC__Account__c in:BusAcc];
        for(SVMXC__Site__c sites :SiteList){
            SiteIds.add(sites.id);
        }
        List<Person_Account_Location_Association__c> AsscolIst = [select BH_Location_Association__c from Person_Account_Location_Association__c where BH_Person_Account_Association__c =:persAccId and BH_Location_Association__c in: SiteIds];
        system.debug('AsscolIst common'+AsscolIst);
        
        if(AsscolIst.size()>0){
            for(Person_Account_Location_Association__c mainAcc : AsscolIst){
                Locid.add(mainAcc.BH_Location_Association__c);
            }
        }
        system.debug('Locid common'+Locid);
            
        List<SVMXC__Site__c>  AssocLocationLocList = [select name,id,BH_Location_Address__c,Superior_Asset_Count__c,
                                                      SVMXC__Account__c,SVMXC__Account__r.name,SVMXC__City__c,
                                                      SVMXC__State__c,SVMXC__Country__c,
                                                      (select id,name,BH_US_SM_Superior_Asset__c from R00N70000001hzcqEAA__r where BH_US_SM_Superior_Asset__c!=null),
                                                      SVMXC__Zip__c from SVMXC__Site__c where id in:Locid];
        system.debug('AssocLocationList common'+AssocLocationLocList);
        String AssetCount;
        for(SVMXC__Site__c acc : AssocLocationLocList){
            AssetCount  = String.valueOf(acc.R00N70000001hzcqEAA.size());
            }
            system.debug('Number of assets '+ AssetCount );
            AssocLocationLocList.sort();
            return AssocLocationLocList; 
            } 
         
}

Thanks,
Anil Kumar 
Hi All,

We have implemented download all the Assest object records in the CSV file based on the button click in the lightning compnent. Now i need show and hide columns and based other column value in the CSV file.

For example if the column A value equals source i need to hide column E and F in the CSV file and column A value not equals source i need to show column E and F in the CSV.

Below is the code which we have used in component JS to dlownload all the records.



  downloadCsvrecords : function(component,event,helper){
        var lstPositions = component.get("v.fullResults");
        console.log('lstPositions=== : '+ lstPositions.length);
        var data = [];
        var headerArray = [];
        var csvContentArray = [];        
        //Fill out the Header of CSV
        //headerArray.push('Installed Product');
        headerArray.push('Product Line');
        headerArray.push('Serial Number');
        headerArray.push('System ID / Asset#'); 
        headerArray.push('Eligibility');
        headerArray.push('Remote Access');
        headerArray.push('Location');
          
        data.push(headerArray);
        
        for(var i=0;i<lstPositions.length;i++){
            
            //Check for records selected by the user
            if(lstPositions[i]){
                console.log('lstPositions.length : '+ lstPositions.length);
                //Initialize the temperory array
                var tempArray = [];
                //use parseInt to perform math operation
                /*tempArray.push('"'+lstPositions[i].Name+'"');*/
                if(lstPositions[i].Product_Line__c === undefined || lstPositions[i].Product_Line__c == null){
                    tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].Product_Line__c+'"');}
                if(lstPositions[i].Serial_Lot_Number__c === undefined || lstPositions[i].Serial_Lot_Number__c == null){
                    tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].SVMXC__Serial_Lot_Number__c+'"');}
                if(lstPositions[i].Asset_Tag__c === undefined || lstPositions[i].Asset_Tag__c == null){
                    tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].SVMXC__Asset_Tag__c+'"');}
                if(lstPositions[i].SM_Eligibility_Status__c === undefined || lstPositions[i].SM_Eligibility_Status__c ==  null){tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].BH_US_SM_Eligibility_Status__c+'"');}
                if(lstPositions[i].SM_VirtualCare_Enabled__c === undefined || lstPositions[i].SM_VirtualCare_Enabled__c == null){tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].SM_VirtualCare_Enabled__c+'"');}    
                if(lstPositions[i].Site__c === undefined || lstPositions[i].Site__c == null){
                    tempArray.push('"'+''+'"');
                }else{tempArray.push('"'+lstPositions[i].Site__r.Name+'"');}
                             
         
                data.push(tempArray);
            }
            
        }
        console.log('data.length : '+ data.length);
        for(var j=0;j<data.length;j++){
            var dataString = data[j].join(",");
            csvContentArray.push(dataString);
        }
        var csvContent = csvContentArray.join("\n");
        
        
       
        var fileName = "My Assets"; //Generate a file name
        fileName += ".csv";            //this will remove the blank-spaces from the title and replace it with an underscore 
     
        
        if (navigator.msSaveBlob) { // IE 10+
            console.log('----------------if-----------');
            var blob = new Blob([csvContent],{type: "text/csv;charset=utf-8;"});
            console.log('----------------if-----------'+blob);
            navigator.msSaveBlob(blob, fileName);
        }
        else{ 
          var myBlob =  new Blob( [csvContent] , {type: 'text/html'});
         var url = window.URL.createObjectURL(myBlob);
         var a = document.createElement("a");
         document.body.appendChild(a);
         a.href = url;
         a.download = "My Assets.csv";
         a.click();
        //adding some delay in removing the dynamically created link solved the problem in FireFox
         setTimeout(function() {window.URL.revokeObjectURL(url);},0);
            component.set("v.isDownloadcsv",false);
            
        }
 
    }

Thanks,
Anil Kumar 
Hi All,

We have custom navigation bar in lighting community. Onclick of each tab we are navigating to different URLs. How to highlight active tab in custom navigation bar in lightning. Below is my code.

 <nav id="ddmenu" class="ddmenu">
    <ul class="ddmenu_ul" aura:id="mobile_ddmenu_ul">
        <li class="mobile_navbar-brand no-sub" style="display:none;width: 370px;">
        <a class="top-heading" href="{!$Label.c.Home}" onclick="{!c.menuClose}">Home</a>
        </li>

        <li class="no-sub" style="width: 170px;" onclick="{!c.menuClose}" >
            <a class="top-heading" href="{!$Label.c.SalesforceArticles}">Salesforce Articles </a>
        </li>
        <li class="no-sub" style="width: 170px;" onclick="{!c.menuClose}">
            <a class="top-heading" href="{!$Label.c.My_Training}">My Training</a>
        </li>
        <li class="no-sub" style="width: 170px;" onclick="{!c.menuClose}">
            <a class="top-heading" href="{!$Label.c.To_myTeam}">My Team</a>
        </li>
    </ul>
</nav>

Thanks,
Anil Kumar
Hi All,

I want add mouse hover tool tip for the Anchor tag in the lightning component. below is my code. 

<a onclick="{!c.profilePage}">My Profile</a>

i tried with lighting helptext but it is displaying i symble  User-added image  beside My Profile link.
<lightning:helptext content="Cilick on My Profile to see your account details" />

How to show tooltip without i symbol.


Thanks,
Anil Kumar 
We have created process builder (BH_Delete Locations Assocation) on User Approval Object which invokes Approval Process when criteria meet. Below is the condition written in the builder. Process Builder is not invoking Approval process even condition meet. Suppose if we edit User Approval record and Click on Save at that time approval is getting created.

NOT(ISBLANK([BH_User_Approvals__c].Locations__c)) && NOT(ISBLANK([BH_User_Approvals__c].BH_UA_Business_Account__c)) && NOT(ISBLANK([BH_User_Approvals__c].User_Name__c)) && 
NOT(ISBLANK([BH_User_Approvals__c].BH_UA_Person_Account__c)) &&
ISPICKVAL([BH_User_Approvals__c].Location_Delete__c, 'Yes') &&   [BH_User_Approvals__c].BH_Approval_Ready__c = True

In the code level we are creating the user approval records for the approval purpose.

User-added image
Hi All,

We have few web service call outs from salesforce community portal to external system. External system has been upgraded to TLS 1.2 protocol. Now they wants us to upgrade to LS 1.2 protocol version. Kidly help me how to upgrade TLS 1.2 version in salesforce?

Thanks,
Anil Kumar
Hi All,

We have few web service call outs from salesforce community portal to external system. External system has been upgraded to TLS 1.2 protocol. Now they wants us to upgrade to LS 1.2 protocol version. Kidly help me how to upgrade TLS 1.2 version in salesforce?

Thanks,
Anil Kumar
Hi All,

How to Retrieve List of all available apex class and Visualforce page which are not from managed pacakage.

Thanks,
Anil Kumar 
Hi All,

I have VF page, where i have added that page in salesforce sites to acess that VF page for the for the external user. Now my problem is user is able to access my VF page without authentication. Salesforce is not asking any authentication.

I have tried by removing my page acess following below mentioned steps but external user is not able to access VF page. User is getting insufficiant privilege error message.

Go to Setup -> Communities -> All Communities -> click Manage -> Administration -> Pages -> Go to force.com -> Click on public access settings.

Can anyone advise me how to access Salesforce site VF page with authentication

Thanks,

Regards,
Anil Kumar

 
Hi All,

I need to create formula field to calculate fields completeness. Please help me on this.
 Name : 30%
 Email: 25%
 Phone: 25%
 Address: 10%
 DOB: 10%
Thanks,
Hi All,

We are trying to get selected checkbox value in the JS controller but selected values as coming as boolean values (True) instead of value. If we use ui namespace tag values are coming but lightning input tag is not working. we also tried with lightning:checkboxGroup it is not working inside aura iteration. Is there anyway where we can read checkbox value by using lightning input tag.


<aura:attribute name="languages" type="Object[]" />

<aura:iteration items="{!v.languages}" var="lang">
    <fieldset class="slds-form--compound">
        <form class="slds-form--inline">
            <div class="slds-form-element__control">
                <div class="slds-form-element__control">
                    <lightning:input type="checkbox" value="{!lang.language}" aura:id="boxPackLanguages" />

                    <!--<ui:inputCheckbox text="{!lang.language}" value="{!lang.isSelected}" aura:id="boxPackLanguages"  change="{!c.uncheckSelectAllLanguages}"  />-->
                </div>
                <label class="slds-form-element__label" for="text-input-01">&nbsp; {!lang.language}</label>
            </div>
        </form>
    </fieldset>
</aura:iteration>
<button class="slds-button slds-button--neutral" onclick="{!c.saveAndCreate}"><span>Save </span></button>

JS Code:

 saveAndCreate: function(component, event, helper) {

     var languagesSelected = false;
     var languages = [];
     var getAllLanguages = component.find("boxPackLanguages");

     if (getAllLanguages != null) {

       languagesSelected = true;
       languages.push(getAllLanguages.get("v.value"));

       console.log('Slected Value' + languages);
     }

Thanks,
Anil Kumar
Hi All,

We are replacing ui names space tags with lightning name space tag in the lightning component since they are going to deprecating soon.
We are displaying multiple languages with checkbox’s . When users selects check box language value should update in backend. While using ui:inputCheckbox tag we are able to update the  language but if we use  lightning:input type="checkbox" language values updating as Boolean value (True) in the back end instead of check box values. Below is the peace of code.

Component :
<aura:attribute name="selectAllLanguages" type="Boolean" default="false" />
  <aura:attribute name="languages" type="Object[]" />
 <aura:iteration items="{!v.languages}" var="lang">
  <lightning:input type="checkbox"  value="{!lang.isSelected}" aura:id="boxPackLanguages" />
   <!--<ui:inputCheckbox text="{!lang.language}" value="{!lang.isSelected}" aura:id="boxPackLanguages" />-->

</aura:iteration>

JS:

var languagesSelected = false;
var getAllLanguages = component.find("boxPackLanguages");
   if(getAllLanguages != null){
            //if there's only one language
            if (getAllLanguages[0] == null) {
                languagesSelected = true;
                languages.push(getAllLanguages.get("v.value"));
            }
           
            for (var i = 0; i < getAllLanguages.length; i++) {
                if (getAllLanguages[i].get("v.value") == true) {
                    languagesSelected = true;
                    languages.push(getAllLanguages[i].get("v.value"));
                }
            }
        }    
Hi All,

I have requirement where i need to show notes and attachmntes file (pfd ) of work order object in the lightning component. Could you please help me on this.

Thanks,
Anil Kumar 
 
Hi All,

I want add mouse hover tool tip for the Anchor tag in the lightning component. below is my code. 

<a onclick="{!c.profilePage}">My Profile</a>

i tried with lighting helptext but it is displaying i symble  User-added image  beside My Profile link.
<lightning:helptext content="Cilick on My Profile to see your account details" />

How to show tooltip without i symbol.


Thanks,
Anil Kumar 
We have created process builder (BH_Delete Locations Assocation) on User Approval Object which invokes Approval Process when criteria meet. Below is the condition written in the builder. Process Builder is not invoking Approval process even condition meet. Suppose if we edit User Approval record and Click on Save at that time approval is getting created.

NOT(ISBLANK([BH_User_Approvals__c].Locations__c)) && NOT(ISBLANK([BH_User_Approvals__c].BH_UA_Business_Account__c)) && NOT(ISBLANK([BH_User_Approvals__c].User_Name__c)) && 
NOT(ISBLANK([BH_User_Approvals__c].BH_UA_Person_Account__c)) &&
ISPICKVAL([BH_User_Approvals__c].Location_Delete__c, 'Yes') &&   [BH_User_Approvals__c].BH_Approval_Ready__c = True

In the code level we are creating the user approval records for the approval purpose.

User-added image
Hi All,

We have few web service call outs from salesforce community portal to external system. External system has been upgraded to TLS 1.2 protocol. Now they wants us to upgrade to LS 1.2 protocol version. Kidly help me how to upgrade TLS 1.2 version in salesforce?

Thanks,
Anil Kumar
Hi All,

I have requirement where i need schedule batch job 4 times in day. this are the timinings 1AM EST, 10 AM EST, 3PM EST, 8PM EST. I have schedule this using cron expression in dev console. i have prepared script below, please advise is this correct.


className c = new className();
String sch = '0 0 1,10,15,20 * * *';
system.schedule('Four times in day ', sch, c);

Thanks,
Anil Kumar
Hi All,

Can anyone help me i am getting below error in the visualforce page, i am displaying 12 dependent picklist in the pageblock section.

Visualforce pages may not display more than 10 dependent picklists together with their controlling fields

Thanks,
Anil Kumar 
Hi All,

I am trying to change pageblock color using javascript. it is not getting changed getting error colorPageBlock is not defined in the console. please advise.

<script>
function colorPageBlock(pageblock, color) {
if (pageblock != null) pageblock.firstChild.style.cssText = “background-color: ” + color + “;”;

}
</script>


<apex:pageBlockSection id = "pbc" title="SELECT INFORMATION">

<apex:inputField value="{!Opportunity.LSS1__c}"/><br/>
<apex:inputField value="{!Opportunity.LSS2__c}"/><br/>
<apex:inputField value="{!Opportunity.LSS3__c}"/>

<script>colorPageBlock(document.getElementById("{!$Component.pbc}"), "red");</script>
</apex:pageBlockSection> 

Thanks,
Anil Kumar
Hi All,
I would like to prepare Dynamic JSON Body on the below mentioned format.
{
                "MyData": [{
                                "id": "SFDC-Contact1",
                                "name": "SFDC-Contact",
                                "description": "Contact Details",
                                "Popularity": "Public",
                                "dataTypes": [{
                                                "name": "Id",
                                                "description": "ID of Contact",
                                }, {
                                                "name": "Name",
                                                "description": "Complete name of Contact"
                                }],
                                "FCLR": null,
                                "DMS": null
                }]
}

I have used json string generator for a POST request body from salesforce to a third party.

list<FieldDefinition> sct = [SELECT DeveloperName,DataType,Label,LastModifiedDate FROM FieldDefinition WHERE EntityDefinition.DeveloperName = 'Contact'];

system.debug('=============='+sct.size() );

JSONGenerator gen = JSON.createGenerator(true);

  gen.writeStartObject();
  gen.writeFieldName('MyData');
  
  gen.writeStartObject();
  
  gen.writeStringField('id', 'SFDC-Contact1');
  gen.writeStringField('name', 'SFDC-Contact');
  gen.writeEndObject();
  gen.writeEndObject();
  gen.writeStartObject();

  gen.writeFieldName('dataTypes');
  gen.writeStartArray();
 
     for (FieldDefinition s: sct ){
        gen.writeStartObject();
        gen.writeStringField('name', s.Label);
  
        gen.writeStringField('description', 'ID of Contact');
        gen.writeEndObject();
      }         

gen.writeEndArray();

gen.writeEndObject();

String pretty = gen.getAsString();
system.debug('=============='+pretty );

Below is JSON body i am getting. Please advise.
{
  " MyData " : {
    "id" : "SFDC-Contact1",
    "name" : "SFDC-Contact"
  }
} {
  "dataTypes" : [ {
    "name" : "Contact ID",
    "description" : "ID of Contact"
  }, {
    "name" : "Deleted",
    "description" : "ID of Contact"
  } ]
}
Hi All,

I want prepare JSON body dynamically for all the contact fields with mask values, i have queried all the contact fileds dynamically assiged to list now i have to prepare JSON body for the fields with mask values. 
For example contact name is Anil it should returm like "Name":"True",contact Phone is null it should returm like "Phone":"False"

How to achive this in apex.

Thanks,
Anil Kumar 
Hi All,

I have VF page, where i have added that page in salesforce sites to acess that VF page for the for the external user. Now my problem is user is able to access my VF page without authentication. Salesforce is not asking any authentication.

I have tried by removing my page acess following below mentioned steps but external user is not able to access VF page. User is getting insufficiant privilege error message.

Go to Setup -> Communities -> All Communities -> click Manage -> Administration -> Pages -> Go to force.com -> Click on public access settings.

Can anyone advise me how to access Salesforce site VF page with authentication

Thanks,

Regards,
Anil Kumar

 
Hi Friends,

I have a requirement with 2 record types
when i choose X record type it should display opportunity standard page 
when i choose Y record type it should display VF Page with opportunity mandatory fields  

unable to do this , can any one help on this

Thanks
Hi,

Can any one help me how to write vaidation rule for date field where user should enter only future date not current(todays)

Thanks,
Regards,
​Anil Kumar
Hi,

I have scenario that update a custom field(Amount__C) of parent(Account) with sum of all child records (Total_Price) from Child Object(Invoice Line Item).

I have to wirte a trigger for above scenario, if any one have sample code please share it.

Thanks in advance,
Shaik
  • December 21, 2014
  • Like
  • 1