Question

Unable to Implement Auto-Increment Numbering

Good day,



I'm trying to implement a Auto-increment numbering system for a column called "UsrClaimReqNum" inside a custom section.



I followed the instructions posted on this link - https://academy.creatio.com/documents/technic-sdk/7-13/how-add-auto-numbering-edit-page-field but I'm unable to get it to work.



I've set up two system settings "Claim Request Last Number" and Claim Code Mask" (Please find the pictures attached for both) and I've also added the following code on the edit page

 

    methods: {

            // Overriding Terrasoft.BasePageV2.onEntityInitialized base method, that 

            // is triggered when the initialization of the edit page object schema is finished.

            onEntityInitialized: function() {

                // onEntityInitialized method parent realization is called.

                this.callParent(arguments);

                // The code is generated only in case we create a new element or a copy of the existing element.

                if (this.isAddMode() || this.isCopyMode()) {

                    //  Call of the Terrasoft.BasePageV2.getIncrementCode base method, that generates the number 

                    // according to the previously set mask. 

                    this.getIncrementCode(function(response) {

                        

                    //    window.alert(response);

                        // The generated number is stored in [Code] column.

                        this.set("UsrClaimReqNum", response);

                    });

                }

            }

Is there something I'm doing incorrectly or should I be adding anything else?



Thank you in advance for your response & time.

File attachments
Like 0

Like

3 comments

Have you set up the 2 System values you will find in the folder "Records auto numbering" (YourCustomSectionCodeMask and YourCustomSectionLastNumber) some exemple.

 

UsrClaimRequestCodeMask 

 

UsrClaimRequestLastNumber

 

Please make sure that system settings are named by the template {SectionName}CodeMask and {SectionName}LastNumber. Also the "UsrClaimReqNum" field should have string type according to your template. 

Don't forget to clear the browser cache and update the application page. If it doesn't help, please check errors in the browser console.

Alina Kazmirchuk,

Thanks Alina, it was the {sectionname} that was incorrect, works just fine now, thank you.

Show all comments