Does anyone know how to access the message area on...
# suitescript
d
Does anyone know how to access the message area on a support ticket by script?
When I do the following:
Copy code
var support_case = record.load({type: 'supportcase', id: currentRecord.get().id});
support_case.getSublists();
I get the following lists:
Copy code
0: "messages"
1: "activities"
2: "mediaitem"
3: "usernotes"
4: "tasks"
5: "events"
6: "calls"
7: "solutions"
8: "transactions"
9: "escalatehist"
10: "escalateto"
11: "systemnotes"
12: "activeworkflows"
13: "workflowhistory"
14: "recmachcustrecord_mro_cm_caseitem_case"
b
you are probably better off doing a search
sublists that aren't editable tend not to be data on the record
d
yeah I found that out after digging google
now I am trying to figure out how to get the messages ID back into the search
as I need to dig down into its attachments
b
i would recommend a message search
d
Copy code
var message_search = search.create({
		    type: "supportcase",
        filters: [
          ['internalid', search.Operator.ANYOF, inbound_case.id],
          'AND',
          ['messages.isincoming', <http://search.Operator.IS|search.Operator.IS>, 'T']
        ],
		   columns: [
		     search.createColumn({name: "message.id", join: 'messages'}),
         search.createColumn({name: "subject", join: 'messages'}),
		   ]
		  });
b
where the case join's internal id matches your case
d
Not sure how to do this correctly 😞
b
make the search first in the ui
d
problem is even a basic setup search for cases is giving no results
facepalm
b
same recommendation: use a message search
if that fails, you can always do the long way of searching for the message internal ids and then loading each one
d
nvm I figured it out