Jump to content

Recommended Posts

Hi all, I know this has been asked before but I cant find a good answer for it. I want to change the client ID, this would be only for new clients and they would have no services added. 

 

Can anyone help? WHMCS support told me to ask you guys 🙂 

Share this post


Link to post
Share on other sites
1 hour ago, BackupAddict said:

I want to change the client ID, this would be only for new clients and they would have no services added. 

you want to increase the id to a much higher figure, e.g 1000 etc?

though I don't think clients ever see their ID...

Share this post


Link to post
Share on other sites
1 hour ago, BackupAddict said:

Hi all, I know this has been asked before but I cant find a good answer for it. I want to change the client ID, this would be only for new clients and they would have no services added. 

 

Can anyone help? WHMCS support told me to ask you guys 🙂 

This is very likely the auto increment field that comes from the database. I did not tested this but if you change it on the database, WHMCS will automatically use the next number. If you set the auto increment ID to 1000, the next one will be 1001, 1002...

If you want to change it only for a specific client, I don't think its possible.

As @brian! said I don't think this is visible on the customer side but even if its, no harm done as its not sensitive data in any way. I find ID's on the URL's both for products and customers useful as it allows you to quickly navigate to a specific ID or identify them.

Share this post


Link to post
Share on other sites

Thanks you guys for getting back. In my case it's a little more compilated. I'm bring in clients from a different system and about non of them are in order, it's not the end of the world if I cant do it but I want to add a client and then just go in and change the id and then add a new one and change that and keep going. 

 

Do you guys see a problem with any of that IF I don't add and services/domains ect to the account.  

Share this post


Link to post
Share on other sites

Are you wanting to change the ID to match with the old system's ID ? If so, why?   

Without services, invoices, etc the only places I could think of right off that the ID would matter would be the contacts, users, email, and log history tables.   You would have to change it in the database directly.   With that said, I would advise against unless there is a real good reason to do so beyond cosmetics. 

Share this post


Link to post
Share on other sites

Hi Steven99, I have a mod that looks at the client ID and adds that to SQL server for a different system, they really have to match what's in SQL now for that customer. 

Share this post


Link to post
Share on other sites

Hi Kian, that might work for new clients, but not the ones I have now. Or at least the whole mod would have to be rewritten.  Not something I want to do for sure. 

Share this post


Link to post
Share on other sites

I understand what you are trying to achieve and you probably are like me a number freak. It does bother me for example when I closed fraud accounts that now I have a useless ID I wil never use again. But this is not only true for WHMCS. For example, lets say a bug tracker like Mantis, also creates a unique ID per each bug, even if they are on different projects. Since one bug is just one more record in a table and the ID is created by the database system not the software.

The thing is that most developers use this setting (auto increment) because it creates a unique ID on the database automatically and you need this for data consistency as everything can and will change (like username, or name), in the end the number that never changes (and should) it what identifies a unique item. And while you might use this customer identification purposes or product (I do) you need to stop worrying about the number and consider like a trow away setting. Don't completely rely on them and instead try to query the number for each customer in case it has changed (from other systems...)

If you really need to match this to the old system, the only solution I can give you is to create dummy accounts in between the users that don't match an ID. Then if you someday register an account manually use one of those positions that hold temp data. Or the other solution is not to use the ID's from WHMCS and like someone else suggested create your own custom field, you can then have a hook that calls this automatically on each new customer registered but now you are replicating what WHMCS does and you need to babysit a parallel number systems that does the same.

It all depends on how many customers you have. The logic thing I would do in your case, is just to import the customers in order and then change the ID on my other system to match this. You need to think which one is the most important one and the master. If your new ID's will be assigned from now on forward's by WHMCS (like registering new customers) then the logic here tells you that it's your other system that should take the ID from WHMCS and not the other way around.

It would be easier just to change the ID's in the other system and then start with the new numbering system on WHMCS. This is the cheap easy way instead of creating a hook or a new number format. It all of course depends on how many customers you have, but if you need to start hacking around WHMCS then why not just create a script that does the same in the other system? Just create a script or some other task that gets the new ID for each old customers in WHMCS and then updates it automatically in your other platform/software.

It's a one time job, and once finished just start using the new ID's created by WHMCS.

Do not change or try to tamper with the ID's in WHMCS because they are used in several queries and tables to get data, you will end up with many troubles and your installation will always have troubles afterwards. The unique ID is the primary key in the database and as such has to match with other tables for data consistency.

Share this post


Link to post
Share on other sites

I can care less if they are in order, it's the reference to the mod that connects to my SQL database that drives other software is why I want them to match. 

Share this post


Link to post
Share on other sites

Looks like I can make this work, if I go to Properties of the tblclients database and turn up Auto Inc. Value to where the next customer number is I can skip ones, the key is to go in order, if you skip any and need to go back you cant easily 

Share this post


Link to post
Share on other sites
18 hours ago, BackupAddict said:

Looks like I can make this work, if I go to Properties of the tblclients database and turn up Auto Inc. Value to where the next customer number is I can skip ones, the key is to go in order, if you skip any and need to go back you cant easily 

Yes that would work also work.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated