Anyone know how to get the Job ID from the Job rec...
# suitescript
c
Anyone know how to get the Job ID from the Job record? When a job has a client assigned the “entityid” is always prefixed with the client data. For example, this search will return “”3M : AB&I Holdings : Lobby Remodel Test ID”. I could split the string of course, but just curious if I can retrieve just the Job Id without the extra client data prepended.
Copy code
var jobFilter = [
                        s.createFilter({
                            name: "internalid",
                            operator: <http://s.Operator.IS|s.Operator.IS>,
                            values: 1514
                        })

                    ];

                    var jobSearch = s.create({
                        type: s.Type.JOB,
                        columns:[
                            {name: "entityid"},
                            {name: "customer"},
                            {name: "internalid"}
                            ],
                        filters: jobFilter
                    });

                    jobSearch.run().each(function(result){

                        jobRecord.entityid = result.getValue({name: 'entityid'})
                        
                    });
c
Enable Show Internal IDs in your personal settings, click on the name "JOB ID" in the UI & it'll tell you the field name that you need to add to your search. Alternatively, install the NetSuite Field Explorer chrome plugin. Or, look at the records browser in the documentation
c
Yea, I have all that thanks. I am just surprised by the way the entityid is being retrieved, in a hierarchy like that.