Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6829409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:29:49+00:00 2026-05-26T22:29:49+00:00

Why do i get "Document command not available error" when i trying to execute

  • 0

Why do i get "Document command not available error" when i trying to execute an approve action for a form. Its like a flow of approval cycle. This error occurs only for the last approver. When clicked on approve by last approver this error occurs. and the document is not getting approved. And on rejecting a different error message like "Notesdocument-cannot locate field" occurs but the document is rejected on pressing Ok. Can anybody help me please.
below is the code for approve action

Sub Click(Source As Button)
    Dim w As New notesuiworkspace
    Dim uidoc As notesuidocument
    
    Set uidoc = w.currentdocument
    process = True
    approveapplication
    gprocess = False

    uidoc.Save
    uidoc.Refresh
End Sub

and for reject action:

Sub Click(Source As Button)
    Dim w As New notesuiworkspace
    Dim uidoc As notesuidocument
    
    Set uidoc = w.currentdocument
    process = False
    rejectapplication
    gprocess = False
    
    uidoc.Save
    uidoc.Refresh
End Sub

The above action is fine for previous approvers.
Please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:29:50+00:00Added an answer on May 26, 2026 at 10:29 pm

    "Document command not available" error means you’re trying to access or do something in the wrong mode. You need to check that you are in edit mode before you can call uidoc.save. Your Approve code should look like this.

    Sub Click(Source As Button)
        On Error GoTo errHandle
        Dim w As New notesuiworkspace
        Dim uidoc As notesuidocument
        Set uidoc = w.currentdocument
        If Not uidoc.EditMode Then
            uidoc.EditMode = TRUE
        End If
        process =True
        approveapplication
        gprocess = FALSE
        uidoc.Save
        
        Exit Sub
        errHandle:
        Messagebox Lsi_info(2) + ": Error " + Str(Err) + " - " + Error(Err) + ", at line " + Str(Erl)
        Exit Sub
    End Sub
    

    You shouldn’t call uidoc.refresh after calling save or the user will most likely be prompted to save the document again on document close even when there are no changes. Check the notes designer help for information about uidoc.save and uidoc.editmode. Also, note the error handling, error handling will help you pinpoint problems like this.

    The "Reject" action problem may be occur if you’re accessing a field not visible on the form. Again, add the error handling, and it will be alot easier to trouble shoot.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to mount a device and get the pid of mount command. cmd="/bin/mount /dev/sda1
I tried using "cap rollback" but I get the following error: $ cap rollback
$(document).ready(function() { $(".addtophundredwatchlist").click(function() { $.ajax({ type : "GET", url : "/watchlisttophundred/", success : function(data){
Wondering why I can't get document.getElementById("my_div").innerHTML to update the DOM when I re-assign the
I'm trying to get the code below to keep an E-mail form deactivated until
I get: "Resource id #8 Warning: mysql_fetch_array() expects parameter 1 to be resource, string
I know how to get elements with a particular attribute : $("#para [attr_all]") But
How does one get a list of running applications as shown in the "Applications"
When I print "\[\e[34m\]sometext" I get some text in blue, but can I specify
Given a string string result = "01234" I want to get the separate integers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.