- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2018 08:01 AM
Hi all!
I need some help with creating customer accounts in my instance.
Because of the OOTB logic of the account table (customer_account) being extended of the core_company table, logic dictates that records are created on the company table after creating an account record. The issue is that I'm working in an instance that is already being used for a couple of years now. So there are already company records in the system and I don't want to create duplicates. Removing (replacing) the original core_company records is not an option either as you will also lose your references in other parts of the system (e.g. on Incidents).
What can I do to link an account record to an existing company record?
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2018 08:46 AM
Found a workaround. I created a background script to query for the right core_company records, and update the class:
//Fetch the record:
var gr = new GlideRecord('core_company');
gr.[insert query here];
//Switch the class:
if (gr.next()) {
gr.sys_class_name = "customer_account";
}
//Update the record (without triggering additional business rules (optional)):
gr.setWorkflow(false); //Optional.
gr.update();
It does what I need it to do and keeps all references intact. Yet this is but a workaround. A proper OOTB solution to this logical loophole would be welcome.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2018 08:46 AM
Found a workaround. I created a background script to query for the right core_company records, and update the class:
//Fetch the record:
var gr = new GlideRecord('core_company');
gr.[insert query here];
//Switch the class:
if (gr.next()) {
gr.sys_class_name = "customer_account";
}
//Update the record (without triggering additional business rules (optional)):
gr.setWorkflow(false); //Optional.
gr.update();
It does what I need it to do and keeps all references intact. Yet this is but a workaround. A proper OOTB solution to this logical loophole would be welcome.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2018 09:07 AM
It's not really a workaround, but is actually the proper way to do it for existing Company records with the use of the Customer Service app now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 01:23 PM
Did you find a solution to your issue? If yes, please remember to tag the correct answer (even if your own) and any that were helpful.