Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

RM Document Number keeps increasing after Clear() and Focus()

(0) ShareShare
ReportReport
Posted on by 18
Hi Everyone,
I am using a C#.Net Code to validate whether a Receivables Transaction Document Number exists for all Document Types and not just the entered Document Type. If I find that the Document Number is not unique, I clear the field and use Focus() method to re-display a new Document Number. But while doing so, the Document Number keeps increasing. When I checked in RM Key Master, the first displayed Document Number is orphaned which was dsplayed when tabbing into Document Number.
Example:
Open Receivables Transaction Entry
Tab into Document Number for Credit Memo; CR001 is displayed
Enter a Debit Memo number DR0056 which is not unique
Tab out, my code clears the Document Number
And the Focus() method displays CR002 now orphaning CR001.
Is there a way to force the focus() method to display CR001 after my validation.
Categories:
  • Verified answer
    Community member Profile Picture
    Community member 18 on at
    RM Document Number keeps increasing after Clear() and Focus()
    Hi David,
     
    thanks for the response. But when I clear() and RunValidate(), Message stating that "You need to enter a Document Number" is displayed.
     
    I worked around by deleting the CR001 from Keys Table, updating the Next Available Number with CR001 and then assigning the Next Available Number to Document Number.
     
    Regards,
    Pranay Pondi.
  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RM Document Number keeps increasing after Clear() and Focus()
    After Clear() are you running the script? You probably need to RunValidate() to return the unused number and release the lock in the keys table.
     
    Regards
     
    David 
  • Community member Profile Picture
    Community member 18 on at
    RM Document Number keeps increasing after Clear() and Focus()
    Hi David,
     
    I am using debit memo, yes!

    There is not a single record with that number in RM Transaction tables except RM00401 - RM Key File.

    I have found that the first number CR001 is in RM00401 – RM Key File. I forgot to mention that when CR001 is entered in the window for Credit Memo again, GP displays that the document number is being used by another user. I understood that this error is displayed because CR001 is in RM00401 because when I deleted the row of CR001 from RM00401, I was able to use the number again. 
     
    Long story short, when CR001 is displayed when I tab out of document number for Credit Memo I enter a document number, say Debit memo number which is already posted or in work, I throw a error message that this number is not unique. I then clear() it and focus() to the document number. Now the CR001 is not displayed but CR002 is displayed probably because CR001 is in RM00401 table. Is there any way I can display the first number i.e., CR001? 
     
    Thanks
  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RM Document Number keeps increasing after Clear() and Focus()
    Are you changing the Document type to Debit Memo?
     
    Why don't you look in the table to check if the number is used first?
     
    Regards
     
    David 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,575 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans