• Ron Van Aken 3
  • NEWBIE
  • 25 Points
  • Member since 2020

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 7
    Replies
Hi,

so i just added a new custom field in contacts called "Status" as a picklist with the values "Active" and "Inactive".
I set the default value to "Acitve", so when a new contact is created, the Status will be "Active" by default.
But the problem is have is with all my existing contacts, for the currents contacts, the default value is not set. 
Is there a way set to the value to "Active" for all current contacts aswell?
Querying (SOQL) CaseFeed returns incomplete information for some types (for example TrackedChange and EmailMessageEvent).

Both of these searches return zero relevant results here:
  • casefeed soql EmailMessageEvent
  • casefeed soql TrackedChange
Most if the information on this topic (casefeed soql) seems dated and/or does not work. Other information is pointless like using a Feeds sub-query in a Case query. It returns the same results as a CaseFeed query.

I've seen examples of sub-queries using FeedTrackedChange, but they fail. The API Describe for FeedTrackedChange says it's not queryable.

The Chatter/Connect API is completely useless for a system app because of its licensing model.

Has anyone made progress getting the details/content associated with TrackedChange and EmailMessageEvent?

Best regards,
Ron
I'm creating a LWC custom Notes control because the stock control has zero configuration.

All rich text in Salesforce appears to be stored in Base64 (for example: ContentVersion.VersionData).  The lightning-formatted-rich-text LWC does not know how to deal with Base64, or it's just not documented.  It displays BLOB(n bytes).  I'm rendering a list, so it's not as easy as converting the field in Apex with ToString().

Because Salesforce uses Base64 for rich text there should be a built-solution, but I'm finding no information in the developer documentation.  Also the description of supported binding is so limited.  For instance binding to a function with a parameter would allow me to use a JavaScript Base64 decoder.

Am I missing something straightforward?  Or do I need to invent a wheel?
Hi Everyone,
Please help me in writing test class for below code

Thanks in advance!
Apex Code example:

public class Example{
public class myMethod{

//code block

}

public Example getAbc{
return abc;
}

 public pagereference save() {

//code block

}
}
public void resetPagination(String country,String state, String fieldAPIName, Boolean uniqueMap, Boolean removeDiacritics ){
            queryData(country,state,fieldAPIName,uniqueMap,removeDiacritics);
            size = PAGINATION_SIZE;
            con.setPageSize(PAGINATION_SIZE);
            noOfRecords = con.getResultSize();
            if(noOfRecords >= PAGINATION_SIZE) {
                showPagination = true;
            }
            else{
                showPagination = false;
            }
        }
        
        public void resetPaginationForAccount(String query, Integer size) {
            List<SObject> dataList = Database.query(query);
            con = new ApexPages.StandardSetController(dataList);
            this.size = size;
            con.setPageSize(this.size);
            noOfRecords = con.getResultSize();
            showPagination = noOfRecords >= this.size;
        }
        public void next(){
            con.next();
        }
        
        public void previous(){
            con.previous();        
        }

        public void first(){
            con.first();
        }
        
        public void last(){
            con.last();        
        }
    }
 
public without sharing class DP_cls_FileAggregatorService {
    /**
     * Prepare data to Send to File Aggregator API
     * Http Callout to File Aggregator system
     *
     * @param setOfUpdatedGovReq (Set of Gov. Req.)
     */
    private static final Logger log = LoggerFactory.getLogger(LoggerFactory.LoggerType.LOGSTASH,LoggerFactory.TeamName.CP,DP_cls_CCPACaseValidation.class);
    @future(callout = true)
    public static void sendRequestToFileAggregatorFuture(Id idOfUpdatedGovReq) {
        integer responsecode = sendRequestToFileAggregator(idOfUpdatedGovReq);
    }
    public static Integer sendRequestToFileAggregator(Id idOfUpdatedGovReq) {
        Integer calloutresponse;
        //Prepare list of identified Gov. Req. to send in request
        DP_Governance_Request__c updatedGovReq = new DP_Governance_Request__c();
        if(idOfUpdatedGovReq != null) {
            updatedGovReq = DP_cls_CCPAModelClass.searchGovReq(idOfUpdatedGovReq);
        }

        //Generate access token
        DP_cls_FileAggregatorHelper tokenHelper = new DP_cls_FileAggregatorHelper();
       // GT_cls_AccessTokenROPCService tokenService = new GT_cls_AccessTokenROPCService(tokenHelper.getAdfsUrl(), tokenHelper.getResource(),
       //         tokenHelper.getClientId(), tokenHelper.getClientSecret(), tokenHelper.getUserName(), tokenHelper.getUserPassword());
          GT_cls_AccessTokenROPCService tokenService = new GT_cls_AccessTokenROPCService(tokenHelper.getAzureUrl(), tokenHelper.getContentTypeHeader(), tokenHelper.getCPPClientId(),
                tokenHelper.getCPPClientSecret(), tokenHelper.getGrantType(), tokenHelper.getScope());        

        GT_cls_Token tokenDPP = tokenService.getToken();
        String finalToken = tokenDPP.getAccessToken();
        
        //Callout to File Aggregator system with POST method
        HttpRequest req = new HttpRequest();
        req.setHeader('Content-Type', tokenHelper.getContentType());
        req.setHeader('Authorization', 'Bearer ' +finalToken);
        if(!Test.isRunningTest()){
            req.setHeader('x-api-key', tokenHelper.getApiKey());
        }
        req.setMethod(tokenHelper.getMethod());
        req.setEndpoint(tokenHelper.getEndpoint());
        req.setTimeout(60000);

        //create json
        JSONGenerator gen = JSON.createGenerator(true);
        gen.writeStartObject();
        if(updatedGovReq.Country__c == DP_cls_AppLiterals.CCPA_COUNTRY_LITERAL){
            gen.writeStringField('s3Url', tokenHelper.getURL() + String.valueOf(updatedGovReq.Id) + '/' + updatedGovReq.ECom_GLB_EUCI__c);
        }else if((updatedGovReq.Regulatory_ID__c == DP_cls_AppLiterals.GDPR_LITERAL) && (updatedGovReq.Request_Type__c == DP_cls_AppLiterals.DP_GR_REQUEST_TYPE_DATA_PORTABILITY )) {
            gen.writeStringField('s3Url', tokenHelper.getgdprUrl() + tokenHelper.getgdprPortabilityUrl() + String.valueOf(updatedGovReq.Id) + '/' + updatedGovReq.ECom_GLB_EUCI__c);
        }else if(updatedGovReq.Regulatory_ID__c == DP_cls_AppLiterals.GDPR_LITERAL){
            gen.writeStringField('s3Url', tokenHelper.getgdprUrl() + String.valueOf(updatedGovReq.Id) + '/' + updatedGovReq.ECom_GLB_EUCI__c);
        }else if(updatedGovReq.Regulatory_ID__c == DP_cls_AppLiterals.LGPD_LITERAL){
            gen.writeStringField('s3Url', tokenHelper.getlgpdUrl() + String.valueOf(updatedGovReq.Id) + '/' + updatedGovReq.ECom_GLB_EUCI__c);
        }
        gen.writeEndObject();
        String jsonString = gen.getAsString();
        req.setBody(jsonString);
        Http http = new Http();
        HttpResponse response;
        
        try{
            //Callout
            if(!Test.isRunningTest()) {
                response = http.send(req);
            }else{
                response = new HttpResponse();
                response.setStatusCode(200);
            }
            calloutresponse = response.getStatusCode() ;
            if(calloutresponse == GT_cls_CTI_AppLiterals.E_COM_STATUS_200
                    || calloutresponse == GT_cls_CTI_AppLiterals.E_COM_STATUS_201){
                //Update governance request record
                updatedGovReq.RequestSent__c = true;
                updatedGovReq.status__c = DP_cls_AppLiterals.DP_GR_STATUS_COMPLETED;
                try{
                    update updatedGovReq;
                }catch(Exception ex){
                    Ecom_cls_Utility.insertErrorLog(ex);
                }
                return calloutresponse;
            }else {
                Ecom_cls_Utility.createErrorLog(response.getStatusCode() +'_'+response.getBody());
                return null;
            }
        }catch(Exception ex){
            Ecom_cls_Utility.createErrorLog(response.getStatusCode() +'_'+response.getBody());
            return null;
        }
    }
}
Hey there, I'm currently trying to build out the following use case with two objects:
  • Object A Cars is the master, with a picklist field of Wheels. (e.g. Wheel 1, Wheel 2, Wheel 3)
  • Object B Wheels is the detail, with fields containing the wield's stats (e.g. Speed, Durability, etc.)

The flow I'd like a user to be able to go through is:
  • When user creates a new record Object A Cars, they can choose their desired Wheel from a picklist
    • This picklist should contain records of the different types of wheels in Object B Wheels
  • The user is then able to see on the Object A Cars record the durability, speed, etc of the car
How do I achieve something like this? I've tried looking at flow builder, schema builder, etc but can't find an answer for it.

 
Hi,

so i just added a new custom field in contacts called "Status" as a picklist with the values "Active" and "Inactive".
I set the default value to "Acitve", so when a new contact is created, the Status will be "Active" by default.
But the problem is have is with all my existing contacts, for the currents contacts, the default value is not set. 
Is there a way set to the value to "Active" for all current contacts aswell?
Querying (SOQL) CaseFeed returns incomplete information for some types (for example TrackedChange and EmailMessageEvent).

Both of these searches return zero relevant results here:
  • casefeed soql EmailMessageEvent
  • casefeed soql TrackedChange
Most if the information on this topic (casefeed soql) seems dated and/or does not work. Other information is pointless like using a Feeds sub-query in a Case query. It returns the same results as a CaseFeed query.

I've seen examples of sub-queries using FeedTrackedChange, but they fail. The API Describe for FeedTrackedChange says it's not queryable.

The Chatter/Connect API is completely useless for a system app because of its licensing model.

Has anyone made progress getting the details/content associated with TrackedChange and EmailMessageEvent?

Best regards,
Ron