• Lex08
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
We want to have 2 separate communities which are able to send messages to each other in a 1-on-1 conversation.

Community A users will be able to initialise a conversation and respond to threads they have opened.
Community B users will be able to send messages in threads which have been opened with that user.

For example:
Community A user opens a conversation with Community B user

Community B user responds.

Community A user responds again.

Can you please let me know what would be required for this project?
My most major concern is Community B users should not be able to see other users in Community A or B. They should only be able to see the name of the Community A user that opened a thread with them.

I have been researching for threads in google regarding this but  I have not found any threads regarding the same.
  • March 23, 2020
  • Like
  • 0
I am having trouble displaying images using Content Document Link in my aura component.
I had used these links for reference:
https://www.mhamzas.com/blog/2020/01/09/use-salesforce-files-image-file-on-lwc-aura-or-vf-page-as-tag/
https://developer.salesforce.com/blogs/engineering/2014/04/building-content-rich-visualforce-pages-with-salesforce-crm-content.html


 
<aura:attribute name="Art" type="Article__c[]"/> 
<aura:iteration items="{!v.Art}" var="val">
 <li class="slds-size--3-of-3 slds-small-size_4-of-12 slds-show--inline-block"> <lightning:card variant="narrow" class="slds-m-around--small slds-card_boundary detailStyle bg-image">
 <ui:outputRichText class="pname" value="{!val.Name}" />
 <lightning:button class="slds-button slds-button_base mg-bt " aura:id="view1" variant="brand" name="{!val}" label="View" onclick="{!c.handleClick}" />
<br/>
 </lightning:card>
 </li>
 </aura:iteration>


I had used this SOQL :
select id, ContentDocumentId, LinkedEntityId from ContentDocumentLink where LinkedEntityId = ''
 select id, ContentDocumentId from ContentVersion where ContentDocumentId = ''

 
  • March 04, 2020
  • Like
  • 0
I am trying to call the flow through an apex class I created to attach the files to the Account object using Conga Template. This is the apex class I had created for the same.
@RemoteAction
public class FileAttachment{

    @InvocableMethod
    public static void file(List<Id> presId) {
        
        Set<Id> presc = new Set<Id>();
        presc.addAll(presId);
        
        sendReq(presc);
        
    }
    
    @future(callout=true)
    public static void sendReq(Set<Id> medId) {
        
        HealthCloudGA__EhrMedicationPrescription__c m = [SELECT Id,HealthCloudGA__Prescriber__c,HealthCloudGA__Account__c 
                                                         FROM HealthCloudGA__EhrMedicationPrescription__c
                                                         WHERE Id IN :medId];  
        
        Account a = [SELECT Id,FirstName,LastName FROM Account WHERE Id = :m.HealthCloudGA__Account__c];
        
        String sessId = UserInfo.getSessionId();
        String servUrl = Url.getSalesforceBaseUrl().toExternalForm()+'/services/Soap/u/29.0/'+UserInfo.getOrganizationId();
        
        String url2 = 'https://www.appextremes.com/apps/conga/pm.aspx'+
            '?sessionId='+sessId+
            '&serverUrl='+EncodingUtil.urlEncode(servUrl, 'UTF-8')+
            '&id='+m.Id+
            '&TemplateId=a2n0i0000000U09AAE'+
            '&QueryId=[Account]a2f0i00000003cN%3Fpv0%3D'+m.HealthCloudGA__Account__c+','+
            '[Dosage]a2f0i00000003by%3Fpv0%3D'+m.Id+','+
            '[DoctorLicense]a2f0i00000003cX%3Fpv0%3D'+m.HealthCloudGA__Prescriber__c+
            '&SC0=1'+
            '&SC1=SalesforceFile'+
            '&DS7=1'+
            //'&OFN=Prescription+'+a.LastName+'+'+
            '&AttachmentParentId='+m.HealthCloudGA__Account__c+
            '&DefaultPDF=1&APIMode=1';
        
        
        System.debug(url2);
        
        Http http = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url2);
        req.setMethod('GET');
        req.setTimeout(60000);
        
        // Send the request, and return a response
        HttpResponse res = http.send(req);
        System.debug(res);
        
        
        //return res.getStatus() + ' => ' + res.getBody();
        
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'wade08@gmail.com'};

        semail.setToAddresses(toAddresses); 
        semail.setSubject('Single Email message Example'); 
        semail.setPlainTextBody('Hello!!!!!!!!!!This is a test email to test single email message program '+url2); 
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail}); 
    }
}



And I executed this in the anonymous window:
System.debug(''+FileAttachment.sendReq('a0z0i000000630vAAA'));




I am getting this error:
Line: 1, Column: 32
Method does not exist or incorrect signature: void sendReq(String) from the type FileAttachment
 
  • December 02, 2019
  • Like
  • 0
I am new to salesforce and I am trying to display articles week wise using CMS workspaces.  So, Is it possible to add a custom field in CMS Workspaces?
  • December 02, 2019
  • Like
  • 0
I am trying to call the flow through an apex class I created to attach the files to the Account object using Conga Template. This is the apex class I had created for the same.
@RemoteAction
public class FileAttachment{

    @InvocableMethod
    public static void file(List<Id> presId) {
        
        Set<Id> presc = new Set<Id>();
        presc.addAll(presId);
        
        sendReq(presc);
        
    }
    
    @future(callout=true)
    public static void sendReq(Set<Id> medId) {
        
        HealthCloudGA__EhrMedicationPrescription__c m = [SELECT Id,HealthCloudGA__Prescriber__c,HealthCloudGA__Account__c 
                                                         FROM HealthCloudGA__EhrMedicationPrescription__c
                                                         WHERE Id IN :medId];  
        
        Account a = [SELECT Id,FirstName,LastName FROM Account WHERE Id = :m.HealthCloudGA__Account__c];
        
        String sessId = UserInfo.getSessionId();
        String servUrl = Url.getSalesforceBaseUrl().toExternalForm()+'/services/Soap/u/29.0/'+UserInfo.getOrganizationId();
        
        String url2 = 'https://www.appextremes.com/apps/conga/pm.aspx'+
            '?sessionId='+sessId+
            '&serverUrl='+EncodingUtil.urlEncode(servUrl, 'UTF-8')+
            '&id='+m.Id+
            '&TemplateId=a2n0i0000000U09AAE'+
            '&QueryId=[Account]a2f0i00000003cN%3Fpv0%3D'+m.HealthCloudGA__Account__c+','+
            '[Dosage]a2f0i00000003by%3Fpv0%3D'+m.Id+','+
            '[DoctorLicense]a2f0i00000003cX%3Fpv0%3D'+m.HealthCloudGA__Prescriber__c+
            '&SC0=1'+
            '&SC1=SalesforceFile'+
            '&DS7=1'+
            //'&OFN=Prescription+'+a.LastName+'+'+
            '&AttachmentParentId='+m.HealthCloudGA__Account__c+
            '&DefaultPDF=1&APIMode=1';
        
        
        System.debug(url2);
        
        Http http = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url2);
        req.setMethod('GET');
        req.setTimeout(60000);
        
        // Send the request, and return a response
        HttpResponse res = http.send(req);
        System.debug(res);
        
        
        //return res.getStatus() + ' => ' + res.getBody();
        
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'wade08@gmail.com'};

        semail.setToAddresses(toAddresses); 
        semail.setSubject('Single Email message Example'); 
        semail.setPlainTextBody('Hello!!!!!!!!!!This is a test email to test single email message program '+url2); 
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail}); 
    }
}



And I executed this in the anonymous window:
System.debug(''+FileAttachment.sendReq('a0z0i000000630vAAA'));




I am getting this error:
Line: 1, Column: 32
Method does not exist or incorrect signature: void sendReq(String) from the type FileAttachment
 
  • December 02, 2019
  • Like
  • 0