Skip to main content


Customer Service forum

How to make Reason for Rejection dialog appear in custom Knowledge base form?

Posted on by 112

I duplicated the default Form for KB articles to customize layout a bit and fields. However, the Reason for rejection slide out dialog is not triggered when changing the Review status to Rejected. It works in the Default form.

I've looked at events and triggers etc but cannot find where this functionality is to be able to replicate it. We also have 2 approval steps, so would like that to work there as well.


  • JustRhonda Profile Picture
    JustRhonda 49 on at
    How to make Reason for Rejection dialog appear in custom Knowledge base form?
    I'm glad someone had the same question I did. I don't like the answer (not low-code) but at least I know it isn't a simple solution. I can't even find the library when I search the Default Solution Web Resources. 
  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to make Reason for Rejection dialog appear in custom Knowledge base form?

    Hi HangryMapache,

    I created a custom form as you did and it also not works for me.  Then I find the code in the library(msdyncrm_/KnowledgeManagement/KnowledgeArticle/KnowledgeArticleMainSystemLibrary.js) which is used to open this dialog. So I created an onchange event on Review field and hide the Review field on the form. And it could work for me now.

    Form Setting:


    Onchange code:

    function onchange(eventContext) {
    var formContext = KnowledgeManagement.KnowledgeArticleUtility.getFormContext(eventContext),
    reviewState =,reviewOptionSetPreviousSelection=null;
    if (reviewState.getValue() == KnowledgeManagement.KnowledgeArticleReviewState.Rejected) {
    var primaryAuthorLookupAttribute = formContext.getAttribute(KnowledgeManagement.PrimaryAuthorId),
    guidForPrimaryAuthorId = "";
    if (primaryAuthorLookupAttribute) {
    var primaryAuthorLookupAttributeValue = primaryAuthorLookupAttribute.getValue();
    if (primaryAuthorLookupAttributeValue && primaryAuthorLookupAttributeValue.length > 0) guidForPrimaryAuthorId = primaryAuthorLookupAttributeValue[0].id
    var options = {
    height: 500,
    width: 400,
    position: 2
    dialogParams = {};
    dialogParams[KnowledgeManagement.ParamEntityId] =;
    dialogParams[KnowledgeManagement.ParamLastButtonClicked] = KnowledgeManagement.DialogOkId;
    dialogParams[KnowledgeManagement.ParamPrimaryAuthorId] = guidForPrimaryAuthorId;
    dialogParams[KnowledgeManagement.ParamReview] = reviewState.getValue();
    Xrm.Navigation.openDialog(KnowledgeManagement.RejectKnowledgeArticleDialog, options, dialogParams).then(function(successParameter) {
    var reviewState = formContext.getAttribute(KnowledgeManagement.Review);
    if (reviewState)
    if (successParameter.parameters[KnowledgeManagement.ParamLastButtonClicked] == KnowledgeManagement.DialogOkId) reviewOptionSetPreviousSelection = reviewState.getValue();
    else reviewState.setValue(reviewOptionSetPreviousSelection)
    }, null)
    } else if (reviewState.getValue() == KnowledgeManagement.KnowledgeArticleReviewState.Approved) {
    var onApproveDialogCancelCallback = function() {
    var reviewOptionSet = reviewState;
    onApproveDialogOkCallback = function(response) {
    var reviewOptionSet = reviewState;
    reviewOptionSetPreviousSelection = reviewOptionSet.getValue()
    KnowledgeManagement.KnowledgeArticle.CommandActions.approveArticle(formContext, onApproveDialogOkCallback, onApproveDialogCancelCallback)
    } else reviewOptionSetPreviousSelection = reviewState.getValue()



Helpful resources

Quick Links

Upcoming TechTalk: Copilot Capabilities…

Review the Copilot features that are currently available in Dynamics 365 Finance…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…


Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,414 Super User

Martin Dráb Profile Picture

Martin Dráb 223,394 Super User

nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans