This topic contains 0 replies, has 0 voices, and was last updated by darrenhillconsulting 7 years, 8 months ago.

  • Author
    Posts
  • #1035

    darrenhillconsulting

    Just checking, but I believe I found a SS2.0 bug …

    Code:
    var resourceAllocation = record.create({type: record.Type.RESOURCE_ALLOCATION, isDynamic: true, defaultValues: {project: 3029}});
    resourceAllocation.setValue({fieldId: ‘allocationresource’, value: 3771});
    resourceAllocation.setValue({fieldId: ‘allocationamount’, value: 120});

    log.debug(‘resourceAllocation’, resourceAllocation);

    resourceAllocation.save();
    So the ‘log’ says

    Code:
    {“type”:”resourceallocation”,”isDynamic”:true,”fie lds”:{“allocationunit”:”H”,”wfinstances”:””,”_mont h_dow”:”2″,”_year_mode”:”DOM”,”_year_dowim_month”: “3”,”_month_dom”:”20″,”_frequency”:”NONE”,”project “:”3029″,”_eml_nkey_”:”87214150″,”_week_period”:”1 “,”_year_dow”:”2″,”type”:”RSRCALLOCATION”,”startda te”:”20-Mar-2017″,”allocationamount”:”120.0″,”frequency”:”NONE “,”nsapiCT”:”1490053741069″,”_month_dom_period”:”1 “,”requestedby”:”3768″,”sys_id”:”-67718000924709110″,”allocationresource”:”3771″,”pe rcentoftime”:””,”_month_dowim”:”3″,”_day_period”:” 1″,”row2spacer”:” “,”_year_month”:”3″,”templatestored”:”F”,”ser iesstartdate”:”20-Mar-2017″,”_month_dowim_period”:”1″,”entryformquerystr ing”:”project=3029″,”_month_mode”:”DOM”,”noenddate “:”T”,”_week_dow_3″:”F”,”row1spacer”:” “,”_week_dow_4″:”F”,”_week_dow_5″:”F”,”enddat e”:”20-Mar-2017″,”_week_dow_6″:”F”,”_year_dowim”:”3″,”customf orm”:”-830″,”_week_dow_1″:”F”,”_week_dow_2″:”T”,”_day_mod e”:”EVERY”,”_week_dow_7″:”F”,”_year_dom”:”20″,”all ocationtype”:”1″},”sublists”:{“usernotes”:{“curren tline”:{“author”:”3768″,”direction”:””,”id”:””,”no te”:””,”notedate”:”20-Mar-2017″,”notetype”:””,”sys_id”:”-67718000925130110″,”sys_parentid”:”-67718000924709110″,”time”:”7:49 pm”,”title”:””,”#”:”1″}},”mediaitem”:{“currentline “:{“content”:””,”description”:””,”filesize”:””,”fi letype”:””,”folder”:””,”internalid”:””,”lastmodifi eddate”:””,”mediaitem”:”-1″,”name”:””,”sys_id”:”-67718000924731110″,”sys_parentid”:”-67718000924709110″,”#”:”1″}}}}
    The error says

    Code:
    {“type”:”error.SuiteScriptError”,”name”:”MISSING_R EQUIRED_FIELD_1″,”message”:”Missing required field: allocationamount”,”stack”:[“anonymous(N/recordService)”,”(/SuiteScripts/DH_NEW/DH_EnhanceProject_RS.js:24)”],”cause”:{“type”:”internal error”,”code”:”MISSING_REQUIRED_FIELD_1″,”details” :”Missing required field: allocationamount”,”userEvent”:null,”stackTrace”:[“anonymous(N/recordService)”,”(/SuiteScripts/DH_NEW/DH_EnhanceProject_RS.js:24)”],”notifyOff”:false},”id”:””,”notifyOff”:false}
    *Sigh* As you can see ‘allocationamount’ is indeed set.
    This is a cached copy. Click here to see the original post.

You must be logged in to reply to this topic.