• dddw gg
  • NEWBIE
  • -1 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I am looking for help to run a Join Query to find all out Accounts in our Database without Contacts AND Opportuntiy.  I can run the query indepetly, but I would like to join the queries. 

The Query I am runing to find Accounts without Contacts: Select Id, Name From Account Where Id NOT IN (SELECT AccountId FROM Contacts)
Query to find Accounts without Opportunties: Select Id, Name From Account Where Id NOT IN (SELECT AccountId FROM Opportunity)
Hi,

The main question is: How do we add custom article fields to the article detail page of the mobile version of Public Knowledge Base 3?

We are setting up a Public Knowledge Base at a client, which is the official Public Knowledge Base 3 (PKB3) from the AppExchange. We have enabled the mobile setup for PKB as well, which is working fine, except that it doesn't show custom article fields.

We have created a few Article types (FAQ, Guideline, etc.), which all have the Rich Text field called 'Cotent' (content__c). We want to display this field on the article detail page of the mobile layout, so we go to PKB 2 Settings | PKB Knowledge Article Layouts | Add Knowledge Article. We then choose one of the knowledge articles (i.e. Guideline__kav) and see the possible fields to add to the layout. All of the fields look like system information (i.e. Id, IsDeleted, CreatedById, etc.), which are pretty useless to an external customer reading the article. See screenshot below.

We looked at the code which loads the available fields which is quoted below. We have tried running the code as an administrator to rule out field level security of the article, which revealed the same fields as explained above.

A Public Knowledge Base, with a build-in mobile site which can only display system information on mobile article detail page seems a bit weird, so we are hoping we missed something, and that it is in fact possible to display custom article fields on a the mobile layout?
public static Object getKnowledgeTypesAndFields(String d){
          pkb_SecurityHandler.canAccess( new Schema.SObjectType[] {KnowledgeArticleVersion.sObjectType} );

            map<String,Object> ret = new map<String,Object>();
            String thisType = '';
            Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
            Set<String> keySet = gd.keySet();
            Schema.DescribeSObjectResult descRes;
            Map<String, Schema.SObjectField> fieldMap;
            for (String key : keySet) {
                Schema.SObjectType objectType = gd.get(key);
                if (key.endsWith('ka') || key.endsWith('kb')) {
                    descRes = objectType.getDescribe();
                    thisType = descRes.getName().replace('ka','kav');
                    fieldMap = descRes.fields.getMap();
                    ret.put(thisType,fieldMap.keySet());
                }
            }
          return ret;
    }
PKB Mobile Knowledge Articles Layouts

Thank you
Kristian