+ Start a Discussion
GennadiyGennadiy 
Hi All.

Could you please help us to find a solution for our issue?

We need to set a custom URL for our SF Community (not a Force.com site). To do that we performed the following steps:
- registered a custom domain (www.mycompany.com) using the GoDaddy service and added a necessary CNAME there to point this URL to our SF community.
- added a domain for this URL in Salesforce.
- created a Custom URL in Salesforce to point this domain to the community.

Now, if we enter a custom URL in a browser (www.mycompany.com), then it correctly redirects us to the Salesforce community. And it's exactly what we want, except one thing: in address bar of a browser we still see old URL: XXX.force.com.

So, Is it possible to configure this custom URL so that we could see "www.mycompany.com" in an address bar? What should we pay attention for to implement this behavior?

Thank you. Gennadiy.

p.s. One of our assumptions is that we should do something more with CA-certificate and SSL-certificate. If anyone knows more whether they affect on the described problem or not, please push us in a right direction.
Best Answer chosen by Gennadiy
GennadiyGennadiy
We've found a solution for this. Our initial assumption was right: we need to do more actions to generate and sign a SSL-certificate, otherwise all requests via HTTPS-connection are redirected correctly to your SF community, but then a custom URL is replaced by XXX.force.com in a browser's address bar.

Here is the list of full actions that are required:
1) Add the custom URL to Salesforce - it has been done previously
2) Generate a Certificate Signing Request from Salesforce
3) Create a CNAME (Alias) record in your domain name registrar - it has been done previously
4) Generate an SSL certificate in your domain name registrar
5) Upload the SSL certificate to Salesforce

I would also give a link to this source, which gives more information about these steps:
http://thinkaholics.com/salesforce/how-to-add-a-custom-url-to-salesforce-communities/

Hope this information will help others.
phil.vaseyphil.vasey 

Hi

 

I'm new to this so please forgive my ignorance.

 

I'm getting the exception when:

 

  1. insert an Opportunity
  2. insert a ContentVersion
  3. post the new ContentVersion to the Opportunity's chatter feed
  4. delete the Opportunity

Does anybody know why, and if so, how to overcome the exception?

 

I am using API version 26.0

 

Thanking you in advance

 

 

private static void TestOpportunityDeletion()

{
  // create an opportunity
  Opportunity opp = new Opportunity() ;
  opp.Name = 'Test Name' ;
  opp.StageName = 'Test Stage Name' ;
  opp.CloseDate = Date.Today() ;
  insert opp ;

  // attach a document to its chatter feed
  ContentVersion doc = new ContentVersion() ;
  doc.Title = 'Test Version' ;
  doc.PathOnClient = 'test version.docx' ;
  doc.VersionData = Blob.ValueOf( 'test content' ) ;
  doc.Origin = 'H' ;
  insert doc ;

  FeedItem post = new FeedItem() ;
  post.Type = 'ContentPost' ;

  post.ParentID = opp.Id ;
  post.RelatedRecordID = doc.id ;
  insert post ;

 

  // delete the opportunity
  delete opp ;
}

Best Answer chosen by Admin (Salesforce Developers) 
Jia HuJia Hu
Before ' delete opp ;' add
delete post;

Then your code will work.
Christina(Carrier)DouglasChristina(Carrier)Douglas 
Users are experiencing their Apex Class batch jobs being only processed at 15 minute intervals; it's being put on hold in the Apex Flex Queue and it doesn't matter what time they submit the jobs to run. The timing of the queueing / holding & processing of the Apex job is consistently running the jobs at the 15 minute increments on the hour; Example, 1:00PM, 1:15PM, 1:30PM, 1:45PM, and it repeats on the next hour for any jobs submitted and in the Apex Flex Queue. Any help here would be appreciated as I am not a developer but support keeps directing me to post the question here for developers to assist me. Thank you in advance! 
Best Answer chosen by Christina(Carrier)Douglas
AnudeepAnudeep (Salesforce Developers) 
Hi Christina, 

Per the documentation
 
SELECT Id, CreatedDate FROM AsyncApexJob WHERE JobType='ApexToken' AND Status = 'Queued'


If the above query returns any records then please log a ticket with Salesforce Support. If the above query doesn't return any results, you can follow the steps listed in the document to abort the old jobs

Support will be able to clear stuck apex tokens

Let me know if this helps, if it does, I appreciate it if you mark this answer as best so that others facing the same issue will find this information useful. Thank you
 
Glyn Thomas 2Glyn Thomas 2 
Hi,

Does anyone know if there is a way to pull article views for knowledge base out from the data loader. I'm working on extracting data from salesforce using data factory in azure so we can do MI reporting on it. It looks like this is an installed module in salesforce however and there seems to be an object within it called article views, but I'm unsure as to how I can see that via the data loader, or how I would pull that out of salesforce using the data factory.

Kind Regards

Glyn
Best Answer chosen by Glyn Thomas 2
AnudeepAnudeep (Salesforce Developers) 
Hi Glyn, 

You can use the following SOQL to extract the article views
 
SELECT id, ViewCount from KnowledgeArticleViewStat where Channel = 'AllChannels'

I recommend doing a CSV export through workbench before attempting this through data loader

Reference: https://help.salesforce.com/articleView?id=000318928&type=1&mode=1

Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Carlos E. M. MagaldiCarlos E. M. Magaldi 
How I can to see sended emails by Salesforce Marketing Cloud API?

We have a system that make send emails by a API of our Salesfoece Marketing Cloud.

How can do to see the sends email make by this system through this API?
 
Best Answer chosen by Carlos E. M. Magaldi
VinayVinay (Salesforce Developers) 
You can reach out to Success - Salesforce Marketing Cloud page on https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000001pQ5CAI for inputs on your ask.

Thanks,
Roman RauerRoman Rauer 
Hi there :)

i'm currently working on an native Android app for my company and ran into some problems with Salesforce lately.

I hope i can find some help here.

What i want to achieve:
The company has a lot of Accounts in Salesforce with 3 important fields for the app: Name, Business (Workshop or Parts Dealer) and location(latitude, longitude)
I would like to show those Accounts(Workshops/Parts Dealers) as markers on a google map in my Android app based on a radius around the user's current location. So it would be more than sufficient to get the data as JSON or XML(i read about sObjects, which would be nice too)

The app will be freely available on Google Play Store and every user should be able to see all the Workshops/Parts dealers around the world.

The problem i'm facing is that i can't find a way to fetch the data inside my app without authenticating every user with a Salesforce-Login. 
Which API is the best to use in this case?

It would be so awsome if anybody could help me with this problem.

What i tried so far: 
- SalesforceMobileSDK: If i extend SalesForceApplication i always end up with the Salesforce-Login Screen.
It seems that every client has to be authenticated for API-calls to work. I tried using the method "peekUnauthenticatedRestClient", but this method only works on full path URL's(e.g. "https://api.spotify.com/v1/search?q=James%20Brown&type=artist"), which isn't really practically for my Use-case.

- I feel like i read nearly all docs about salesforce api, but can't quite get my head around how to solve this problem, although it seems like to be a pretty common use-case.  

- would a salesforce-apex method which would select all records inside a set radius around the user's location be accessable without authentication?

Thanks for your help in advance!

Roman
Best Answer chosen by Roman Rauer
Santosh Bompally 8Santosh Bompally 8
Follow this -> 
1) Write a Restservice to expose your data. 
@RestResource(urlMapping='/Account')
global with sharing class MyRestResource {

 
    @HttpGet
    global static List<Account> doGet() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
       List< Account>  result = [SELECT Id, Name, Business,Location FROM Account ];
        return result;
    }
  
}

2)  Create a Community and provide access to apex class and account object to the Guest user profile. 
    Samplecommunity url -> https://somedomain.cs16.force.com/communityname

3) Go to workbench and test your API using rest explorer 
    relative url ->  /services/apexrest/Account
4) Your public url will now be   https://somedomain.cs16.force.com/communityname/services/apexrest/Account 

Mark as Best Answer if it helps. 

Thanks, 
Santosh 

 
Ramcharan Naidu PalleRamcharan Naidu Palle 
Hi Team,


While working on the "Trailhead data Manager" and refreshing the data it is throwing this error.

"An error occurred in your last data refresh.

Delete failed. First exception on row 0 with id 0015g0000063XmuAAE; first error: DELETE_FAILED, Your attempt to delete Sample Account for Entitlements could not be completed because it is associated with the following entitlements.: Sample Entitlement ...   "


Can anyone help me with this?..

 
Best Answer chosen by Ramcharan Naidu Palle
AbhishekAbhishek (Salesforce Developers) 
Hi,

For all the Trailhead issues or Guidance please report it here,

https://trailhead.salesforce.com/en/help?support=home

https://trailhead.salesforce.com/help

So that our trailhead support engineers will look into it and get back to you.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Regards,
Salesforce Support.
 
Georg WilleGeorg Wille 
Please someone look into thes urgently - without solution to this issue I cannot deploy the package to production.

I am developing an unlocked package. When executing the command: 
force:package:version:create -p Package -d force-app -k key -w 10 -v DevHub
I get a great many errors thrown at me: some 320 errors listed for a total of 450 lines as counted by the execution of the unit test classes.
Note that:
  • All parts of the code have been tested on my developer org, I can deploy all components from my VS Code project with no problem at all.
  • All of the errors fall into one of a few categories
ComponentName: Variable does not exist: qli
ComponentName: Invalid type: QuoteLineItem
ComponentName: Method does not exist or incorrect signature: void getEntityAlias(QuoteLineItem) from the type ComponentName
ComponentName: DML requires SObject or SObject list type: List<QuoteLineItem>
  • when I add the --skipvalidation flag to the command the package builds with no errors. I can the install it on my scratch org and - according to the unit test execution - works as expected.

 
Best Answer chosen by Georg Wille
Vishwajeet kumarVishwajeet kumar
Hello,
I assuming you are aware that salesforce (https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_unlocked_pkg_code_coverage.htm) has introduced code coverage requirements and it will require 75% coverage to promote pacakges to org's other than sandboxes or scratch orgs.

It could be Test classes failing. From error's, it looks like it is falling due to not able to find "QuoteLineItem" object and some other components in package. Package is standalone bundle so it will need all componenets included which are used in code to work. .

Unit Test is working in sandbox/scratch org because of all components used in Test Classes being available in those orgs.

Thanks
Matthew HofmannMatthew Hofmann 
Hello,

I'm creating an Apex class that creates a Salesforce File record and associates it with a parent record. I'm having a problem creating the association (ContentDocumentLink) record.

Here is what I'm doing:
  • Create a ContentVersion record. This creates a ContentDocument record automatically if you leave the ContentVersion.ContentDocumentId field blank. (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdocument.htm - "To create a document, create a new version via the ContentVersion object without setting the ContentDocumentId. This automatically creates a parent document record.")
  • Insert ContentVersion record
  • DEBUG: Confirm ContentVersion.ContentDocumentId is set (Here is where the problem is because it is NULL; however if I SOQL query ContentVersion after the Apex completes, ContentVersion.ContentDocumentId is set and the corresponding ContentDocument record exists)
  • Create ContentDocumentLink record (commented out because it fails because ContentDocumentLink.ContentDocumentId is a required field)
  • Insert ContentDocumentLink record (commented out because it fails because ContentDocumentLink.ContentDocumentId is a required field)
Here is the code:
public class FileController {
    
    @AuraEnabled
    public static Id saveTheFile(Id parentId, String fileName, String base64Data, String contentType, Id contentDocumentId) { 
        base64Data = EncodingUtil.urlDecode(base64Data, 'UTF-8');
        
        ContentVersion cv = new ContentVersion();
        cv.ContentLocation = 'S';
        cv.ContentDocumentId = contentDocumentId;
        cv.VersionData = EncodingUtil.base64Decode(base64Data);
        cv.Title = fileName;
        cv.PathOnClient = filename;
        
        insert cv;
        
        //***This DEBUG statement must return an Id for the rest of the code to work***
        System.debug('contentDocumentId='+cv.ContentDocumentId);               
        
        //ContentDocumentLink cdl = new ContentDocumentLink();
        //cdl.ContentDocumentId = cv.ContentDocumentId;
        //cdl.LinkedEntityId = parentId;
        //cdl.ShareType = 'I';
        
        //insert cdl;
        
        return cv.Id;
    }

    @AuraEnabled
    public static Id saveTheFile(Id parentId, String fileName, String base64Data, String contentType) {         
        return saveTheFile(parentId, fileName, base64Data, contentType, NULL);
    }
}

Does anyone know what I'm doing wrong, not considering, etc?
Appreciate any thoughts and input!
Best Answer chosen by Matthew Hofmann
VineetKumarVineetKumar
Interesting..

Well the culprit in your code is the null value and way you are using it to assign the value to ContentDocumentLink.contentDocumentId.
You should query the content version object again to get the contentDocumentId (which is generated after the parent document is inserted by default because of you passing of null value).
Something like below :
ContentDocumentLink cdl = new ContentDocumentLink();
cdl.ContentDocumentId = [SELECT Id, ContentDocumentId FROM ContentVersion WHERE Id =: cv.Id].ContentDocumentId;
cdl.LinkedEntityId = '00590000000a6dP';
cdl.ShareType = 'V';
insert cdl;

As per the salesforce documentation lines higlighted by you, "To create a document, create a new version via the ContentVersion object without setting the ContentDocumentId. This automatically creates a parent document record." it does create the parent document record as expected, but the contentDocumentId is still null in above initialised object. Id doesn't get updated automatically to the object instance. Infact you will have to pull out the corresponding Id as done in the above snippet.

Let me know if this helps.
Ahmed MediouniAhmed Mediouni 
Hello Community,
I was working on an apex trigger for the account object and opportunity object but there are other objects left for me to create an apex trigger on them, is there any way I can make one single apex trigger that works on all objects?

thanks
Best Answer chosen by Ahmed Mediouni
SwethaSwetha (Salesforce Developers) 
HI Ahmed,
>I understand your requirement but you have to create Triggers for each Object, you cannot create just one Trigger for multiple objects. Salesforce only supports “One Trigger per Object” design pattern as a best practice(See https://www.sfdc99.com/2015/01/19/the-one-trigger-per-object-design-pattern/)
 
>Salesforce permits you to can create a Trigger Handler which each Trigger would invoke and use Dynamic Apex / SObjects to perform generic logic at run-Time.
 
Also, see https://developer.salesforce.com/forums/?id=906F0000000DBl8IAG

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you