Addd users ti Multiple accounts in CSM portal page

Ramesh Venugopa
Tera Contributor

Need to add the account name in sys_user Table to reflect in CSM Page.

 

Existing one have show one account.

4 REPLIES 4

GlideFather
Tera Patron

Hi @Ramesh Venugopa 

 

on the sys_user table, just add a column "Class" and change it from User to Contact and it shall be done automatically (perhaps you need to do the same for Company > Class change to Account):

 

 

KamilT_0-1752920027771.png

 

 

KamilT_1-1752920084501.png

 

Let me know if it worked and then you can eventually support me as well as the whole Community by accepting this as solution.

 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Ramesh Venugopa
Tera Contributor

Thanks for support. can you suggest in Script level.

For a script, you need to define what users to become contacts and company to accounts - set the right conditions.

 

This is just a draft:

var userGR = new GlideRecord('sys_user');
userGR.addQuery('class', '!=', 'contact'); // Set your conditions here - WHAT USERS?
userGR.query();

while (userGR.next()) {
    userGR.class = 'contact';
    userGR.update();
}

 

r companyGR = new GlideRecord('core_company');
companyGR.addQuery('class', '!=', 'account'); // Conditions what COMPANIES?
companyGR.query();

while (companyGR.next()) {
    companyGR.class = 'account';
    companyGR.update();
}

 

Use this as a fix script (it has a rollback record) and out of business hours as it can have some access implications, do not execute this when people might be logged in working.

 

Also, test and validate in non-PROD environment first, set the condition to one specific user and a group, to see how it works.

 

If updating too many records, use the setLimit(); eg. setLimit(250); and execute it more times.

 

 

If you want to do it scriptless, use the Update job:

KamilT_1-1753182723655.png

 

 

KamilT_0-1753182668950.png

 

and same for Company > apply conditions > Class = Account.

 

Schedule it and it is also with rollback option. 

 

Please mark as solution if it resolved your struggles 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


@Ramesh Venugopa ☝️

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */