var rec = record.load({ type: record.Type.SALESORD...
# ask-stanley-ai
s
var rec = record.load({ type: record.Type.SALESORDER, id: context.newRecord.id, isDynamic: true }); when I try to execute this command below error encountered Yogi{"type":"error.SuiteScriptError","name":"SSS_MISSING_REQD_ARGUMENT","message":"load: Missing a required argument: type","id":null,"stack":["createError(N/error)","beforeLoad(/SuiteScripts/UE_Custom_Sales_Order_Print.js:43)","createError(N/error)"],"cause":{"name":"SSS_MISSING_REQD_ARGUMENT","message":"load: Missing a required argument: type"},"notifyOff":false,"userFacing":true}
c
AI generated answer (using internal Slack threads):
The error
SSS_MISSING_REQD_ARGUMENT
is thrown when a required argument is missing in a function call. In your case, the error message indicates that the
type
argument is missing in the
record.load
function call. However, from the code snippet you provided, it seems like you are passing the
type
argument correctly. The
type
argument should be a string representing the record type, and you are passing
record.Type.SALESORDER
, which should be correct. One possible issue could be that
record.Type.SALESORDER
is not correctly resolving to the string representing the sales order record type. You could try replacing
record.Type.SALESORDER
with the string
"salesorder"
directly to see if that resolves the issue. Here is how you can modify your code:
Copy code
javascript
var rec = record.load({ 
    type: "salesorder", 
    id: context.newRecord.id, 
    isDynamic: true 
});
If this doesn't resolve your issue, then there might be a problem elsewhere in your code. The error stack trace indicates that the error is thrown in
UE_Custom_Sales_Order_Print.js
at line 43. You might want to check that part of your code to see if there's anything wrong there. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.87157023
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.866709471
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861200929
Please provide your feedback on this answer.