43

Turns out it's very easy: PermissionSetAssignment psa = new PermissionSetAssignment (PermissionSetId = myPermissionSetId, AssigneeId = myAssigneeId); insert psa;


35

I was able to get the values using Describe methods, as discussed in this post: how to get a picklist all values in apex controller From this, I was able to figure out the list, which I will paste here if anyone else is interested. application/html application/java-archive application/javascript application/msword application/octet-stream application/...


20

This is because for your Article Type object the Topics are disabled .Please follow below screeshots to enable it. Step 1 Step 2 Click on Enable Topics and you should be good .I reproduced your issue in my instance and this seemed to work fine once I enabled Topics for knowledge article type .


8

Please note that SObject and Object are very different types. And adding [] at the end of your type definition makes it a List, again a huge difference. The text of your post indicates you meant Object, so I will answer as if that's the case. Regardless, the key here is that if you have a few different types you want to guarantee all implement a specific ...


7

You can expose the image through a site. You only need to change the instance url by the site home page. Also, you need to establish the article as public. Site Profile Changes: Set field where image is placed as visible. Set Read permission to object where image is placed. Go to "Category Group Visibility Settings" section and set visibility to "All ...


7

Click on Setup | Customize | Knowledge | Settings | Check "Allow users to add external multimedia content to HTML in the standard editor" to 'True' - you can then use the WYSIWYG editor on Rich Text fields to "Embed Media" into a Knowledge Article. This allows pasting the iframe code from YouTube, Vimeo, Dailymotion and a number of other video sites.


7

From Articles The article record is the parent container of all versions of an article, whatever the publishing status (draft, published, archived) and the language. While KnowledgeArticle and KnowledgeArticleVersion represent any article in the Knowledge Base, __ka and __kav are the concrete representation of respectively KnowledgeArticle (“__ka” suffix) ...


7

If you want to take the API Name of a field and get its label, use the getLabel method on DescribeFieldResult. SObjectField field = Frequently_Asked_Question__kav.ArticleType; DescribeFieldResult describe = field.getDescribe(); system.debug(describe.getLabel()); // e.g. 'Article Type' If you want to take the API Name of an SObject and get its label, use ...


7

Here's a simple drag-drop example written in pure Visualforce: <apex:page controller="DragDrop"> <script> var dragStartId; function cancel(event) { event.preventDefault(); } function dragstart(event) { dragStartId = event.target.dataset.rowid; } function drop(event) { reorderitems(dragStartId, event....


6

You might be able to use the OAuth accessToken in a cookie with the HTTP GET request to servlet/rtaImage depending on the scope you requested when getting it. I believe you will need to use the full or web scopes to then make web requests or use frontdoor.jsp. See: Scope Parameter Values Use OAuth 2.0 Tokens to login to Salesforce.com The cookie will ...


6

I know this is an old question, but I ran into the same problem today, and solved it like this: Select Id, ArticleNumber, Title from ArticleType__kav where Id not in (Select ParentId from ArticleType__DataCategorySelection) and PublishStatus = 'Online' You should replace ArticleType__kav and ArticleType__DataCategorySelection based on the name of your ...


6

First to start with: The only benefit of Solution over Knowledge Base is: Solution is free!! Now how knowledge beat solution big time or can say why salesforce is making more money by introducing this: Unlike Solutions, using the knowledge base requires Knowledge feature licenses, which come at an additional cost. Unlike Solutions, Knowledge comes with ...


6

Just as @Eric commented out: You need to place searched object id into Test.setFixedSearchResults So in your case: Id [] fixedSearchResults= new Id[1]; fixedSearchResults[0] = objKav.Id; Test.setFixedSearchResults(fixedSearchResults); After that you can SOSL objKav. Reference: SOSL Test Docs


5

You are navigating to wrong side: Go to Customize -> Knowledge -> Article Types | Click on Article Type Name You should be on a screen like this: In field section you can create new Fields.


5

You might be getting this error based on DataCategoryName, not DataCategoryGroupName. Double-check that Latin America is a valid category for the category group you selected based on results[0].


5

Its basically the issue with the scheduled job names. When Scheduled Job2 is running and trying to scheduled next set of Scheduled job its finding that a job named Scheduled Job0 is already running or scheduled. So you should develope a logic to name your scheduled jobs to be unique. You can use the current timestamp in your scheduled job name like this: ...


4

Here are few use cases 1)Lets say you have call center app with agents working to resolve customer problems ,there may be already documentation based on previous solved cases and that would be help to solve the problems for cases on similar lines . 2)Say that you have a sales app and your reps need to know and learn about products so these articles can be ...


4

I have a good news, Topics on Article are GA with Spring'14 release. See the "Assign Topics to Articles" section of the release notes: https://help.salesforce.com/help/pdfs/en/salesforce_spring14_release_notes.pdf


4

Are you looking for a particular keyword in your custom field ? In that case if you search for a keyword (e.g. : 'test') you could use something like : FIND {test} RETURNING Article_Type1__kav(Id WHERE PublishStatus='Online' AND Language='en_US'), Article_Type2__kav(Id WHERE PublishStatus='Online' AND Language='en_US') This search would include ...


4

This will work for you: DescribeSObjectResult objType = KnowledgeArticleVersion.getSObjectType().getDescribe(); Map<String, SObjectField> fields = objType.fields.getMap(); Set<String> fieldSet = fields.keySet(); for(String s:fieldSet) { SObjectField fieldToken = fields.get(s); DescribeFieldResult selectedField = fieldToken.getDescribe();...


4

In order to be able to create and edit a Knowledge Article the running user needs the "Knowledge User" checkbox ticked on the user record. This is a feature licence that is not controlled currently within a profile and sys admin do not get the permission by default. An explanation of the permissions required can be found at the link below. Note any user can ...


4

I will take a stab at a non technical way to think about it. Article types are used to define different kinds of articles, from a simple FAQ to a complex procedure including the fields available and layouts to use per channel the article might be viewed in. As you rightly noted you can control visibility of article types at a user profile level or via ...


4

If you have a look at the entity relationship diagram (ERD) which illustrates relationships between the Salesforce Knowledge objects, you will see that the Vote object is related with the KnowledgeArticle. So to create a rating with Apex, you will simply have to create a new record of VOTE sObject and set the parentId as the KnowledgeArticleId and the Type ...


4

This method creates draft articles from online articles, so this happens because one or more of those online article already has a draft article so you cannot create another draft article(you cannot have 2 drafts for a single article at the same time). This should work for you for(FAQ__kav k : [SELECT Id, ArticleNumber, KnowledgeArticleId ...


4

The method KbManagement.PublishingService.publishArticle(articleId, true) needs a KnowledgeArticle Id. What you are trying to do is giving the KnowledgeArticleVersion Id to the method. You can see the difference in the suffix: kav for KnowledgeArticleVersion (Video_Article__kav) ka for Knowledge Article Instead, try the following code: String articleId = ...


4

A way to fetch what other languages it has been translated to is to filter on the knowledgearticleid or Id in your soql. As per the SOAP API Developer Guide documentation on KnowledgeArticleVersion: Always filter on a single value of Language. However, in SOQL, you can filter on more than one Language if there is a filter on Id or KnowledgeArticleId. ...


4

Try to pass KnowledgeArticleId of your Article knowledge__kav. You might need to again retrieve the article record you have inserted and then Pass KnowledgeArticleId. In your case it will be : knowledge__kav obj1 = [SELECT Id,Title,KnowledgeArticleId FROM knowledge__kav WHERE id =: newArticle.Id]; KbManagement.PublishingService.publishArticle(obj1....


4

Apex doesn't really have much in the way of reflection or introspection. While we do have the Type class (which has the forName() method), you still need to know the name of the object at compile time to be able to really make use of it. forName() takes a string, and you can call newInstance() to get an instance of the type that was returned by forName(), ...


4

Knowledge Article object is very special object - you can not track changes of PublishStatus field in trigger/process builder. As workaround (not very good solution) - Remove "Publish" button from layout. Add a button using formula field. You can make this button prominent using any image. Place at very top-right in layout. This Formula field would ...


3

The column headers are case sensitive. So if your field is named Description_c, and the csv file column is named 'description_c', it won't work. Publishstatus is a field that cannot be imported. All the imported articles are set to draft by default. As far as I know, all the commas and quotes get escaped automatically if you're using MS Excel.


Only top voted, non community-wiki answers of a minimum length are eligible