Hey everyone, has anyone ever “renamed” their cust...
# general
r
Hey everyone, has anyone ever “renamed” their customer record and it caused issues with their scripts not finding the customer records anymore?
s
No - renaming would never cause issues like that because if you're scripting on customer, you're still using the internalid of the record. It could be a potential defect unless something else is causing it. I'm a NetSuite Solutions Architect, feel free to reach out if you need help.
c
@Shubi I don't think he means renaming an actual Customer. He means renaming the Customer record itself (to eg: Client)
s
@CD I know what he meant but renaming won't change the internal id of the record. It will always remain "customer".
r
Hey @Shubi @CD we have a script giving an error. The custom record is renamed and it’s stating this as the issue. It can’t find “newrecordname”. Is it possible “customer” was used in the script but can’t find it due to the renaming?
s
Are you able to share the script?
r
This is the error: “”type”:“internal error”,“code”“INVALID RCRD TYPE”,“details”“The record type [MEMBER] is invalid.“,”
Customer was renamed to MEMBER
s
yeah that is the problem
change MEMBER to CUSTOMER
renaming only works visually but the record type internal id will always remain Customer
r
Can’t change the customer naming back to customer. Needs to stay member
getEntityType returns the renamed customer record type/name. It is not recognized by the url.resolveRecord method, which is looking for the standard record type value.
s
lets connect.
r
I can’t change the script, just wanting to confirm this is possible to happen with renaming the records
c
Oh, are you trying to get it dynamically because of Leads/Prospects?
r
This is the script that is causing the issue:
function getEntityType(id) { 2 return search.lookupFields({ 3 type: ‘entity’, 4 id: id, 5 columns: [‘type’] 6 }).type[0].text; 7 }
“Member” isn’t found. It’s looking for customer
s
I see.. and the script is deployed on how many record types?
r
Multiple
s
not a great solution but add a custom field on these entity record types with formula {type} to get the actual entity type: • MEMBER: Customer • Employee:Employee And pass that as type
r
Ok, thank you! Just to confirm, this script is erroring because the record was renamed?
s
I still don't think so. even though customer, employee, leads, prospects are entities, it needs the actual record type id
r
So since it’s renamed to member, the record type of member isn’t found?
s
You can rename it to whatever you want but the id will always be "customer".
message has been deleted
renaming it won't affect the backend and you cannot manipulate the record browser
I can help you with the script if you want. Feel free to reach out
r
Hey @Shubi thanks for sending this over. I can’t change the scripts, only our devs can. I am trying to see if the issue is in renaming the record to member. Seems like it shouldn’t error out but still is due to the renaming. Any ideas of why?
s
Sending you a dm
b
the guess here is that something is using getEntityType as the recordtype
which is wrong, there is an actual recordtype that should be used instead