Heads-up, when using SuiteScript 2.1 the record.tr...
# suitescript
c
Heads-up, when using SuiteScript 2.1 the record.transform for Opportunity to Estimate is currently broken and is returning a JSON type error. There is a defect, 669537, its a U4 so its going to be some time until its fixed! If anyone wants to vote for it and increase its priority then the following Debugger code in 2.1 demonstrates it; it works in 2.0: require([‘N/search’,‘N/record’], function(search,record) { function runSearchAndFetchResult() { var parid = 1; var estimate = record.transform({ fromType: ‘opportunity’, fromId: 7901010 , toType: ‘estimate’, isDynamic: true }); var b = 1; } runSearchAndFetchResult(); });
netsuite 1
Just a further heads up I discovered today that the same is true with a Record.Create on Opportunity with the isDefault set to true.
j
I just tested, I am not getting any error.
c
Strange in 2.1 debugger?
j
in browser console …. maybe that doesn’t use 2.1 tho
I’ll do another test for you, one second
I can do a transform in a SS 2.1 suitelet.
c
Interesting as NS has logged as a defect, this is on the opportunity record specifically to a quote/estimate
j
yes
Copy code
var sm_id = 460498;
var qt = record.transform({
			fromType: record.Type.OPPORTUNITY,
			fromId: sm_id,
			toType: record.Type.ESTIMATE,
			isDynamic: true
		});
try it with a different Opp?
c
Done that and so did NS hence they logged as defect as they could reproduce it. Even switched off all scripts and workflows.
j
how weird
c
Works fine in SS2.0, just SS2.1
j
what is the actual JSON error you get?
c
TypeError: TypeError: r is not a function [at runSearchAndFetchResult (<eval>724), at <eval>179, at Object.<anonymous> (<eval>11)]
j
what kind of script is this?
sorry I just want to replicate in my account so I can support your defect!
c
Just dropped into the debugger, I spotted it whilst writing a user event. Removed all the code until I had just this in the Debugger
Also happens with record.create as well
Only on the opportunity with no scripts or workflows active. That has been todays find, works fine in SS2.0 as soon as change to SS2.1 get that error.
Remove isDynamic in SS2.1 and works
j
if you try to create or transform via UI instead, any errors?
c
Nope all good in the UI
j
any scripts/wfs on Estimate that might be the issue?
c
No disabled them all on both Opp and Estimate
j
dang
sorry don’t think I can help, you’ve done all the sensible testing
c
Cheers
j
tell them your manager called and said they are angry that you are losing business
NS only cares if it’s costing your company money
c
I am the manager and been there and done that. U4 as lots of workarounds is the best I can get
j
👍
hey man the best I usually get for my stuff is U6 or
iT's STandArD bEHavIOuR