I am trying to get the sublistvalue of role from t...
# suitescript
a
I am trying to get the sublistvalue of role from the project resouce as should below. Role is a multi select value where for the highlighted resource there are two roles, but when I am trying to get the value of role I am getting only 1 value in the server side script. But where as from the client side script I am getting two values. Please help me how to get the two values of the role when using the server side script. Thanks
b
netsuite probably represents it internally as 2 rows, there arent really multiselects for sublists
try logging out the entire sublist
i favor using
Copy code
require(["N/record"], function (record) {
  console.debug(record.load({ type: "job", id: "25791863" }).toJSON());
});
a
I tried logging entire sublist by using the above code and can see only one internal Id for the role. Where are when I tried in suitescript 1.0, the role is giving me two values as shown below.
My requirement is ,On Edit I am need to remove the project Coordinator value out of two values (project coordinator, project team memeber). I was able to do it using client script saveRecord function but it is taking too long time to submit the record. So I am trying to do the same logic in server side but not able to get the values @battk.
b
what code are you using
my job resource sublist looks like:
Copy code
{
  "currentline": {
    "defaultcost": "",
    "email": "",
    "jobresource": "",
    "overridencost": "",
    "role": "",
    "sys_id": "-5733931236449026",
    "sys_parentid": "5733930851550722",
    "#": "7"
  },
  "line 1": {
    "defaultcost": null,
    "email": null,
    "jobresource": "3851",
    "overridencost": null,
    "role": "2",
    "sys_id": "5733930851940039",
    "sys_parentid": "5733930851550722"
  },
  "line 2": {
    "defaultcost": null,
    "email": null,
    "jobresource": "3852",
    "overridencost": null,
    "role": "-3",
    "sys_id": "5733930851926728",
    "sys_parentid": "5733930851550722"
  },
  "line 3": {
    "defaultcost": null,
    "email": null,
    "jobresource": "3852",
    "overridencost": null,
    "role": "-2",
    "sys_id": "5733930851913496",
    "sys_parentid": "5733930851550722"
  },
  "line 4": {
    "defaultcost": null,
    "email": null,
    "jobresource": "3852",
    "overridencost": null,
    "role": "2",
    "sys_id": "5733930851900003",
    "sys_parentid": "5733930851550722"
  },
  "line 5": {
    "defaultcost": null,
    "email": null,
    "jobresource": "3852",
    "overridencost": null,
    "role": "3",
    "sys_id": "5733930851886388",
    "sys_parentid": "5733930851550722"
  },
  "line 6": {
    "defaultcost": null,
    "email": null,
    "jobresource": "3853",
    "overridencost": null,
    "role": "3",
    "sys_id": "5733930851871174",
    "sys_parentid": "5733930851550722"
  }
}
the ui representation looks like the following, you can reasonably guess the internal id of Employee 1 from the number of rows it has
a
I am using UserEvent afterSubmit function. I don't have issues with identifying the employee. But when I am trying to remove the role it is not allowing me to do. For example in the above image Employee1 has 4 roles but I only want 1 role and remove 3 roles by using script @battk
b
my comment was more along the lines that the different roles are represented by different rows in the sublist
with each combination of jobresource and role having its own row
remove the row with the combination of jobresource and role that you want to remove
a
I got it now. Thanks a lot @battk