• Sagar Maurya
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 5
    Replies
While using the 'Parameterized Search' on Contact, I am getting unexpected result. I am using below json to search records on contact based on 'Name' filter:
{
"q":"CAPITAL CROSS",
"fields" : ["Id","FirstName","LastName","Account.Name"],
"sobjects":[{"name": "Contact", "where":"RecordType.Name='Internal'"}],
"in":"NAME"
}

Note - There is only one contact with name as 'CAPITAL CROSS'. And this contact is associated with account named as 'Capital'.

Expected -
When I run the above json as System Admin profile, I get only one contact named as 'CAPITAL CROSS'

Unexpected-
When I run the above json from custom profile having Salesforce Platform user license, I get 'CAPITAL CROSS' contact and all the other contacts which are associated with the same account named 'Capital' in response. This should not happen as I am getting all the contacts which are not matching my search criteria.

Can anyone help me in understanding that what could be reason for this behaviour?
does schedule job runs exactly at given time that we have mentioned?
I have a apex class through which I am making callout and calling this class using a Flow. In response I am getting a URL which I need to open in new window using flow. Is it possible to open the returned URL in response using flow?
By any chance can we call @future annotated method from visual flow?
User-added image
We have developed a Custom VF Chart as shown above. Now our requirement is to beautify the chart(bars and texts) and its legends by applying the css on it. Can we apply css on the chart tag and legends? Is there any way to do so because css was not applicable on it? Please let me know if anyone has come across similar kind of requirement.
I have a requirement to implement line chart with bar chart in report. Currently I am using X-axis to display amount A1 and Y-axis to show Start Date. Now do display amount A2, I am using Combination Chart and checking Plot additional values and selecting amount A2. A1 and A2 amount data are being displayed correctly on the chart but I want to include line chart as well to this chart for a percentage field P1. Does anyone has implemented this type of functionality in salesforce please let me know.
I have a requirement to get Big Object storage limit using webservice API call that tells end user the API usage. For example, if Big Object storage increases more than 95%, then automatic mail should be send. As per the link - https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_limits.htm , I can not find big object storage in response body. Just wanted to check is this the limitation or is there any other way to get big object storage.

Thanks,
Sagar
Hi,
I have a requirement to integrate salesforce with Amazon AWS S3. I have to save a text file from salesforce to Amazon AWS S3. The integration can be done using POST method of REST API. The text file saved on Amazon AWS S3 server will have data in JSON format. Now I have to query from salesforce based on the text present in JSON file. For example, if JSON is { "name":"John", "age":31, "city":"New York" }, so if I search with name "John" then all data with name John should be returned to salesforce. Is it even possible? Has anybody implemented this kind of requirement, please let me know.
I have a issue with salesforce classic console app in lightning experience. When we are trying to run salesforce console in lightning experience, the account list view page is converted to lightning experience and once we open any account record it opens in classic view. Now when we hover on the related list link on top of the detail page and try to open the record by hovering over the link it does not open in another tab. What it does is, it opens in a seperate iframe inside the parent's iframe. We want related record from hover related list link to open in a tab, instead of opening in different iframes.
Can anyone help me with this or anyone has come across this type of issue? Or is this limition of salesforce?
I have a requirement of doing a callout on case creation and based on the response(JSON) received update the case record. I need to do a callout and send case Id and case subject in the request body to external system. I am facing problem in serializing the request. Below is the code for the same. Please let me know what is wrong with this code:
Trigger-
trigger caseTrigger on Case (after insert,after update) {
    
    if(trigger.isInsert){
        for(case c : trigger.new){
           
           checkCaseClass.checkCase(c.id,c.subject);
        }
    }
}    
Helper class-
public class checkCaseClass{
@future (callout=true)
 public static void checkCase(Id CaseId, string subject){
        
        for(case c:[select id,subject,description from case where id =: caseId]){
            Http http = new Http();
            HttpRequest req = new HttpRequest();
            req.setHeader('Content-Type','application/json');
            String endpoint = 'any end point';
            req.setMethod('POST');
            req.setEndpoint(endpoint);
            req.setBody('CaseId='+EncodingUtil.urlEncode(CaseId, 'UTF-8')+'subject='+EncodingUtil.urlEncode(subject, 'UTF-8');
            String s= JSON.serialize(req);
            HTTPResponse response = http.send(req);
            system.debug('response -->'+response);
    }
}
}

When above code is executed, I get error - System.JSONException: Apex Type unsupported in JSON: System.HttpRequest.

Please let me know the possible solution for this.
User-added image
We have developed a Custom VF Chart as shown above. Now our requirement is to beautify the chart(bars and texts) and its legends by applying the css on it. Can we apply css on the chart tag and legends? Is there any way to do so because css was not applicable on it? Please let me know if anyone has come across similar kind of requirement.
I have a requirement of doing a callout on case creation and based on the response(JSON) received update the case record. I need to do a callout and send case Id and case subject in the request body to external system. I am facing problem in serializing the request. Below is the code for the same. Please let me know what is wrong with this code:
Trigger-
trigger caseTrigger on Case (after insert,after update) {
    
    if(trigger.isInsert){
        for(case c : trigger.new){
           
           checkCaseClass.checkCase(c.id,c.subject);
        }
    }
}    
Helper class-
public class checkCaseClass{
@future (callout=true)
 public static void checkCase(Id CaseId, string subject){
        
        for(case c:[select id,subject,description from case where id =: caseId]){
            Http http = new Http();
            HttpRequest req = new HttpRequest();
            req.setHeader('Content-Type','application/json');
            String endpoint = 'any end point';
            req.setMethod('POST');
            req.setEndpoint(endpoint);
            req.setBody('CaseId='+EncodingUtil.urlEncode(CaseId, 'UTF-8')+'subject='+EncodingUtil.urlEncode(subject, 'UTF-8');
            String s= JSON.serialize(req);
            HTTPResponse response = http.send(req);
            system.debug('response -->'+response);
    }
}
}

When above code is executed, I get error - System.JSONException: Apex Type unsupported in JSON: System.HttpRequest.

Please let me know the possible solution for this.
The challenge is:

You've been given a requirement to keep Contact addresses in sync with the Account they belong to. Use Process Builder to create a new process that updates all child Contact addresses when the address of the Account record is updated. This process:Can have any name.
Must be activated.
Must update Contact mailing address fields (Street, City, State, Post Code, Country) when the parent Account shipping address field values are updated.

I start with Accounts when records is created or edited.
Filter criteria where accounts shipping address (street, city, state, zip code) is changed (used "or" logic).

I am stuck on the next step "add action".  I started with action type "Update Records".
On objects, I can't seem to change Accounts to Contacts.  Why?
Hi All,

I want to display number of contacts associated with an account using triggers.

for this I had created a lookup field like noofcontacts__c in account  object. and Wrote code as

trigger numberofcontacts on contact(after insert, after update, after delete) {
    Map<Id, List<Contact>> AcctContactList = new Map<Id, List<Contact>>();
    Set<Id> AcctIds = new Set<Id>();   
    List<schema.Account> AcctList = new List<schema.Account>();
    List<schema.Contact> ConList = new List<schema.Contact>();
   
    if(trigger.isInsert || trigger.isUPdate) {
        for(Contact Con : trigger.New) {
            if(String.isNotBlank(Con.AccountId)){
                AcctIds.add(Con.AccountId); 
            }  
        } 
    }
   
    if(trigger.isDelete) {
        for(Contact Con : trigger.Old) {
            AcctIds.add(Con.AccountId);    
        } 
    }          
   
    if(AcctIds.size() > 0){
        ConList = [SELECT Id, AccountId FROM Contact WHERE AccountId IN : AcctIds];
       
        for(Contact Con : ConList) {
            if(!AcctContactList.containsKey(Con.AccountId)){
                AcctContactList.put(Con.AccountId, new List<Contact>());
            }
            AcctContactList.get(Con.AccountId).add(Con);     
        }                          
      
           
        AcctList = [SELECT noofContacts__c FROM Account WHERE Id IN : AcctIds];
        for(Account Acc : AcctList) {
            List<schema.Contact> ContList = new List<schema.Contact>();
            ContList = AcctContactList.get(Acc.Id);
            Acc.Number_of_Contacts__c = ContList.size();
        }   
       
      
        update AcctList;   
    }

}
 I am   getting an error as "Variable doesnot exist:id".

Kindly support and suggest.

Thanks