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

  • SEARCH
  • Home
  • 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 6763593
In Process

The Archive Base Latest Questions

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

Please help. I have a querysave event in form. the below is the code

  • 0

Please help. I have a querysave event in form. the below is the code snippet. It is for calculating a ref number(settlement number) whose format is “ST115-00001”
Sub Querysave(Source As Notesuidocument, Continue As Variant)

Dim w As New notesuiworkspace
Dim uidoc As notesuidocument
Dim SESS    As New NotesSession
Dim RefView As NotesView
Dim DB As NotesDatabase
Dim RefDoc  As NotesDocument
Set DB   =  SESS.CurrentDatabase

Set RefView = DB.GetView("System\AutoNo")
Set uidoc=w.CurrentDocument

Dim approvedcnt As Integer
approvedcnt = Cint(source.fieldgettext("appcnt"))

If uidoc.EditMode = True Then

    Financial_Year =  Clng(Right$(Cstr(Year(Now)),3)) + 104
    If Month(Now) >= 4 Then Financial_Year = Financial_Year + 1
    DocKey     =  Cstr(Financial_Year)& "-"
    New_No      =  0
    Set RefDoc  =  RefView.GetDocumentByKey(DocKey , True)
    If Not(RefDoc Is Nothing) Then New_No = Clng(Right$(RefDoc,5))
    New_No      =  New_No + 1
    autono      =  DocKey & "-" & Right$("00000" & Cstr(New_No) ,5)
    Application ="ST"
    Latest_No = Application + autono
    Call uidoc.FieldSetText("SETTLEMENT_NO",Latest_No)
    Call uidoc.Refresh
    Else
    Exit Sub
End If

get_ex_rate
get_cv_local


Call uidoc.FieldSetText("Flag1", "A")

If approvedcnt = 12 And uidoc.FieldGetText("STATUS") = "APPROVE" Then
    Call uidoc.fieldsettext("Flag2", "B")
End If

Dim answer2 As Integer

answer2% = Msgbox("Do you want to save this document?", 1, "Save")
If answer2 = 1 Then 
    Print "Saving"
End If  
If answer2 = 2 Then
    continue=False
    Exit Sub
End If

uidoc.Refresh
uidoc.close

End Sub

I need the value of DocKey and New_No to be populated to a view. what formula should i use and is my logic correct. please help.

Regards,
Priya.

  • 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-26T14:29:42+00:00Added an answer on May 26, 2026 at 2:29 pm

    Your code doesn’t need to get the view, or do anything to populate it. Views populate themselves, by means of a selection formula that determines which documents are displayed, and column formulas that determine what values are displayed for each document. These formulas are edited by opening the specific view in Domino Designer.

    If you already have a view that selects the right documents, and that view already has a column for Settlement_No, then you should already be seeing the values like “ST115-00001” in the view. If you have the view already but it is not showing the Settlement_No data, and if that’s the format you want to see the data in the view, then all you need to do is add a column to the view, select “Field”, and select “Settlement_No”.

    If what you’re really asking is how to see DocKey and New_No in the view without them being combined, so instead of seeing “ST115-00001” you see “ST115” and “00001”, then you have two choices.

    1. Modify your code to also save DockKey and New_No in the document, and then add two new columns to the view. If you don’t want to add new visible fields to your form, you will want to use the NotesDocument class and ReplaceItemValue in order to save the DocKey and New_No.

    2. Simply to add two view columns, and use @Left(Settlement_No;”-“) in the first column formula and @Right(Settlement_No;”-“) in the second column formula.

    Obviously method 2 is simpler, but method 1 has the advantage that you won’t ever have to change it, even if someday you decide to change the formatting of the Settlement_No field so that it looks like this “ST115:00001/more stuff here”.

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

Sidebar

Related Questions

Please help! I have some form elements in a div on a page: <div
Please help me to rectify my code. Here I have described the code what
Please help me to figure out what is wrong with this code: I have
I have a form. The form fields are validated in the querysave event. The
Possible Duplicate: E-mail validation in php? please help I have Ajax sign up form.
Please help, if you have a bunch of code somewhere, a method or something,
please help i have the following php code for my login session but i
may be too simple groovy question but....please help i have a list like this:
Please help! Background info I have a WPF application which accesses a SQL Server
Please help! I have been grappling with this error for days and I cannot

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.