How is it possible that when creating a SuiteScript 2.0 Client Script that the 1.0 API is getting loaded?
When creating new customizations since 2.0's release I have been making every effort to use 2.0 but this is my first client side script.
With the conflict of the two API versions being loaded at the same time the 2.0 call's won't work. Is anyone else experiencing this?
For example the following load call of a task works in the Chrome browser console on a task form where I have deployed a 2.0 Client Side script
require(['N/record'], function(record){var rec = record.load({id:someid,type:'TASK'}) But the creation of a Task fails and seems related to the presence of the 1.0 APIrequire(['N/record','N/currentRecord','N/runtime'], function(record,currentRecord,runtime){try{ var dt = new Date(); dt.setDate(dt.getDate() + 90);var taskRec = record.create({ type:'TASK',isDynamic:true }); taskRec.setValue({fieldId:'customform',value:87}); taskRec.setValue({fieldId:'owner',value:runtime.getCurrentUser().id}); taskRec.setValue({fieldId:'assigned',value:runtime.getCurrentUser().id}); taskRec.setValue({fieldId:'company',value:currentRecord.get().getValue({fieldId:'company'})}); // Get the last order date taskRec.setValue({fieldId:'duedate',value:dt}); taskRec.setValue({fieldId:'startdate',value:dt}); taskRec.setValue({fieldId:'status',value:'NOTSTART'}); taskRec.setValue({fieldId:'priority',value:'MEDIUM'}); taskRec.setValue({fieldId:'custevent_mtg_type',value:3}); taskRec.setValue({fieldId:'custevent_mtg_follow_up_type',value:'2'}); taskRec.setValue({fieldId:'title',value:'Customer Follow Up'}); var taskID = taskRec.save({ enableSourcing: false, ignoreMandatoryFields: true }); console.log(taskID);}catch(ex){console.log(ex.toString());}})