Netsuite - Unable to get sublist line count
I'm using a scheduled script to get the line count of a sublist on a customer record so I can loop through the list. The list items are a custom record type (SOW_rec) and are children of the customer. I am able to load the record but lineCount only returns a -1 no matter which sublist ID I try. How do I find the sublist ID where the sublist is in a parent-child relationship? I have tried looking in &XML=T but there is no sublist data in there.
var companyRecord = record.load({
type: record.Type.CUSTOMER,
id: company,
isDynamic: true,
});
log.debug({
title: 'companyrecord',
details: companyRecord
});
var lineCount = companyRecord.getLineCount('SOW_Rec');
log.debug({
title: 'linecount',
details: lineCount
});
netsuite suitescript suitescript2.0
add a comment |
I'm using a scheduled script to get the line count of a sublist on a customer record so I can loop through the list. The list items are a custom record type (SOW_rec) and are children of the customer. I am able to load the record but lineCount only returns a -1 no matter which sublist ID I try. How do I find the sublist ID where the sublist is in a parent-child relationship? I have tried looking in &XML=T but there is no sublist data in there.
var companyRecord = record.load({
type: record.Type.CUSTOMER,
id: company,
isDynamic: true,
});
log.debug({
title: 'companyrecord',
details: companyRecord
});
var lineCount = companyRecord.getLineCount('SOW_Rec');
log.debug({
title: 'linecount',
details: lineCount
});
netsuite suitescript suitescript2.0
add a comment |
I'm using a scheduled script to get the line count of a sublist on a customer record so I can loop through the list. The list items are a custom record type (SOW_rec) and are children of the customer. I am able to load the record but lineCount only returns a -1 no matter which sublist ID I try. How do I find the sublist ID where the sublist is in a parent-child relationship? I have tried looking in &XML=T but there is no sublist data in there.
var companyRecord = record.load({
type: record.Type.CUSTOMER,
id: company,
isDynamic: true,
});
log.debug({
title: 'companyrecord',
details: companyRecord
});
var lineCount = companyRecord.getLineCount('SOW_Rec');
log.debug({
title: 'linecount',
details: lineCount
});
netsuite suitescript suitescript2.0
I'm using a scheduled script to get the line count of a sublist on a customer record so I can loop through the list. The list items are a custom record type (SOW_rec) and are children of the customer. I am able to load the record but lineCount only returns a -1 no matter which sublist ID I try. How do I find the sublist ID where the sublist is in a parent-child relationship? I have tried looking in &XML=T but there is no sublist data in there.
var companyRecord = record.load({
type: record.Type.CUSTOMER,
id: company,
isDynamic: true,
});
log.debug({
title: 'companyrecord',
details: companyRecord
});
var lineCount = companyRecord.getLineCount('SOW_Rec');
log.debug({
title: 'linecount',
details: lineCount
});
netsuite suitescript suitescript2.0
netsuite suitescript suitescript2.0
edited Sep 4 '18 at 19:16
EJLaylan
asked Sep 4 '18 at 18:44
EJLaylanEJLaylan
636
636
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
Check the "Allow Child Record Editing" checkbox on the child record that you are trying to access with the .getLineCount
command.
Also, as dcrs mentioned, the linecount command should be var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
add a comment |
Your code for line count is incorrect. You're missing the parameter needed for the sublist. If this is a child record it will be linked by the field listed with the "record is parent" checked.
var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
After getting on with netsuite support we figured out you need the "Allow Child Record Editing" setting to be checked on the custom record type.
– EJLaylan
Sep 5 '18 at 17:57
add a comment |
When I look at the XML structure of a Customer record (using &xml=T appended to the URL), I can see the sublist data there. However, in a thoroughly effective effort to confuse, NetSuite has called the relevant XML element <machine>
rather than <sublist>
or something you might naturally think of. So try searching for "machine" on the customer record after loading it with &xml=T - you should see several references to it (open and close tags for each sublist) each with <line>
sub-elements.
Once you've located the <machine>
elements, you will see each has a name
attribute which is the sublist ID you're looking for.
I finally found the sublist ID in the customer record customize form XML structure. For some reason the sublist ID <machine> element was not in the regular customer record XML. I think that may be because the sublist is populated by child records. However the sublist ID still won't work, I get 0 for the line count when there are 6. Before I got -1 so a little better I guess.
– EJLaylan
Sep 4 '18 at 22:14
add a comment |
NetSuite Help Article 65795 details the naming convention for Custom Child Record Sublist IDs
The internal ID for a custom child record sublist is recmach + > field_id_for_the_parent_field (for example: recmachcustrecord111).
NetSuite expects all lower case for the Id.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52172297%2fnetsuite-unable-to-get-sublist-line-count%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Check the "Allow Child Record Editing" checkbox on the child record that you are trying to access with the .getLineCount
command.
Also, as dcrs mentioned, the linecount command should be var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
add a comment |
Check the "Allow Child Record Editing" checkbox on the child record that you are trying to access with the .getLineCount
command.
Also, as dcrs mentioned, the linecount command should be var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
add a comment |
Check the "Allow Child Record Editing" checkbox on the child record that you are trying to access with the .getLineCount
command.
Also, as dcrs mentioned, the linecount command should be var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
Check the "Allow Child Record Editing" checkbox on the child record that you are trying to access with the .getLineCount
command.
Also, as dcrs mentioned, the linecount command should be var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
answered Sep 5 '18 at 20:59
The WindhoverThe Windhover
1659
1659
add a comment |
add a comment |
Your code for line count is incorrect. You're missing the parameter needed for the sublist. If this is a child record it will be linked by the field listed with the "record is parent" checked.
var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
After getting on with netsuite support we figured out you need the "Allow Child Record Editing" setting to be checked on the custom record type.
– EJLaylan
Sep 5 '18 at 17:57
add a comment |
Your code for line count is incorrect. You're missing the parameter needed for the sublist. If this is a child record it will be linked by the field listed with the "record is parent" checked.
var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
After getting on with netsuite support we figured out you need the "Allow Child Record Editing" setting to be checked on the custom record type.
– EJLaylan
Sep 5 '18 at 17:57
add a comment |
Your code for line count is incorrect. You're missing the parameter needed for the sublist. If this is a child record it will be linked by the field listed with the "record is parent" checked.
var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
Your code for line count is incorrect. You're missing the parameter needed for the sublist. If this is a child record it will be linked by the field listed with the "record is parent" checked.
var lineCount = companyRecord.getLineCount({sublistId:"RECMACHCUSTRECORD...."});
answered Sep 5 '18 at 3:17
dcrsdcrs
22414
22414
After getting on with netsuite support we figured out you need the "Allow Child Record Editing" setting to be checked on the custom record type.
– EJLaylan
Sep 5 '18 at 17:57
add a comment |
After getting on with netsuite support we figured out you need the "Allow Child Record Editing" setting to be checked on the custom record type.
– EJLaylan
Sep 5 '18 at 17:57
After getting on with netsuite support we figured out you need the "Allow Child Record Editing" setting to be checked on the custom record type.
– EJLaylan
Sep 5 '18 at 17:57
After getting on with netsuite support we figured out you need the "Allow Child Record Editing" setting to be checked on the custom record type.
– EJLaylan
Sep 5 '18 at 17:57
add a comment |
When I look at the XML structure of a Customer record (using &xml=T appended to the URL), I can see the sublist data there. However, in a thoroughly effective effort to confuse, NetSuite has called the relevant XML element <machine>
rather than <sublist>
or something you might naturally think of. So try searching for "machine" on the customer record after loading it with &xml=T - you should see several references to it (open and close tags for each sublist) each with <line>
sub-elements.
Once you've located the <machine>
elements, you will see each has a name
attribute which is the sublist ID you're looking for.
I finally found the sublist ID in the customer record customize form XML structure. For some reason the sublist ID <machine> element was not in the regular customer record XML. I think that may be because the sublist is populated by child records. However the sublist ID still won't work, I get 0 for the line count when there are 6. Before I got -1 so a little better I guess.
– EJLaylan
Sep 4 '18 at 22:14
add a comment |
When I look at the XML structure of a Customer record (using &xml=T appended to the URL), I can see the sublist data there. However, in a thoroughly effective effort to confuse, NetSuite has called the relevant XML element <machine>
rather than <sublist>
or something you might naturally think of. So try searching for "machine" on the customer record after loading it with &xml=T - you should see several references to it (open and close tags for each sublist) each with <line>
sub-elements.
Once you've located the <machine>
elements, you will see each has a name
attribute which is the sublist ID you're looking for.
I finally found the sublist ID in the customer record customize form XML structure. For some reason the sublist ID <machine> element was not in the regular customer record XML. I think that may be because the sublist is populated by child records. However the sublist ID still won't work, I get 0 for the line count when there are 6. Before I got -1 so a little better I guess.
– EJLaylan
Sep 4 '18 at 22:14
add a comment |
When I look at the XML structure of a Customer record (using &xml=T appended to the URL), I can see the sublist data there. However, in a thoroughly effective effort to confuse, NetSuite has called the relevant XML element <machine>
rather than <sublist>
or something you might naturally think of. So try searching for "machine" on the customer record after loading it with &xml=T - you should see several references to it (open and close tags for each sublist) each with <line>
sub-elements.
Once you've located the <machine>
elements, you will see each has a name
attribute which is the sublist ID you're looking for.
When I look at the XML structure of a Customer record (using &xml=T appended to the URL), I can see the sublist data there. However, in a thoroughly effective effort to confuse, NetSuite has called the relevant XML element <machine>
rather than <sublist>
or something you might naturally think of. So try searching for "machine" on the customer record after loading it with &xml=T - you should see several references to it (open and close tags for each sublist) each with <line>
sub-elements.
Once you've located the <machine>
elements, you will see each has a name
attribute which is the sublist ID you're looking for.
answered Sep 4 '18 at 21:31
KryptonKrypton
2,0052311
2,0052311
I finally found the sublist ID in the customer record customize form XML structure. For some reason the sublist ID <machine> element was not in the regular customer record XML. I think that may be because the sublist is populated by child records. However the sublist ID still won't work, I get 0 for the line count when there are 6. Before I got -1 so a little better I guess.
– EJLaylan
Sep 4 '18 at 22:14
add a comment |
I finally found the sublist ID in the customer record customize form XML structure. For some reason the sublist ID <machine> element was not in the regular customer record XML. I think that may be because the sublist is populated by child records. However the sublist ID still won't work, I get 0 for the line count when there are 6. Before I got -1 so a little better I guess.
– EJLaylan
Sep 4 '18 at 22:14
I finally found the sublist ID in the customer record customize form XML structure. For some reason the sublist ID <machine> element was not in the regular customer record XML. I think that may be because the sublist is populated by child records. However the sublist ID still won't work, I get 0 for the line count when there are 6. Before I got -1 so a little better I guess.
– EJLaylan
Sep 4 '18 at 22:14
I finally found the sublist ID in the customer record customize form XML structure. For some reason the sublist ID <machine> element was not in the regular customer record XML. I think that may be because the sublist is populated by child records. However the sublist ID still won't work, I get 0 for the line count when there are 6. Before I got -1 so a little better I guess.
– EJLaylan
Sep 4 '18 at 22:14
add a comment |
NetSuite Help Article 65795 details the naming convention for Custom Child Record Sublist IDs
The internal ID for a custom child record sublist is recmach + > field_id_for_the_parent_field (for example: recmachcustrecord111).
NetSuite expects all lower case for the Id.
add a comment |
NetSuite Help Article 65795 details the naming convention for Custom Child Record Sublist IDs
The internal ID for a custom child record sublist is recmach + > field_id_for_the_parent_field (for example: recmachcustrecord111).
NetSuite expects all lower case for the Id.
add a comment |
NetSuite Help Article 65795 details the naming convention for Custom Child Record Sublist IDs
The internal ID for a custom child record sublist is recmach + > field_id_for_the_parent_field (for example: recmachcustrecord111).
NetSuite expects all lower case for the Id.
NetSuite Help Article 65795 details the naming convention for Custom Child Record Sublist IDs
The internal ID for a custom child record sublist is recmach + > field_id_for_the_parent_field (for example: recmachcustrecord111).
NetSuite expects all lower case for the Id.
edited Nov 19 '18 at 22:59
answered Nov 19 '18 at 22:51
Grant LingardGrant Lingard
112
112
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52172297%2fnetsuite-unable-to-get-sublist-line-count%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown