Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

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

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,928 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,928 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans