• Kristian Hede
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
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
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
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
Hi,

I have a requirement wherein i have  flag__c<text field> in Opportunity Object. I need to populate into this field values based on the custom setting<have created a hierachiracl custom setting> and retreive it.
Can some one help me as to how to go about on this??
Thanks
sathish