<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script Error - Spawn and Add Task in Fusion Manage Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-manage-forum/script-error-spawn-and-add-task/m-p/10371935#M1053</link>
    <description>&lt;P&gt;I guess the error is thrown by this line:&lt;/P&gt;
&lt;P&gt;spawnedTask.ASSIGNED_USERS = spawnedTask.APPROVAL_ROLE.USERS_ASSIGNED_TO_ROLE;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do the definitions of fields ASSIGNED_USERS and USERS_ASSIGNED_TO_ROLE match? I assume that both are users picklists, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have to loop the list and add given entries:&lt;/P&gt;
&lt;P&gt;if(spawnedTask.APPROVAL_ROLE !== null) {&lt;/P&gt;
&lt;P&gt;for(var i = 0; i &amp;lt;&amp;nbsp;spawnedTask.APPROVAL_ROLE.USERS_ASSIGNED_TO_ROLE.length; i++)&amp;nbsp;spawnedTask.ASSIGNED_USERS.add(spawnedTask.APPROVAL_ROLE.USERS_ASSIGNED_TO_ROLE[i]);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additional remark:&amp;nbsp;You do not need to pass 'item' to your library script function as the function has access to this global element anyway&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jun 2021 05:10:59 GMT</pubDate>
    <dc:creator>sven.dickmans</dc:creator>
    <dc:date>2021-06-08T05:10:59Z</dc:date>
    <item>
      <title>Script Error - Spawn and Add Task</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/script-error-spawn-and-add-task/m-p/10371819#M1052</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to deploy working code from my SB to prod and am getting the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;com.dms.model.exceptions.InvalidFieldValueException: Can only convert MultiselectWrappers and NativeArrays to Multiselect fields&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've verified that everything matches up between the 2 tenants, so I'm struggling to figure out why it works on one side and not the other. The action script is straightforward:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pxedust_0-1623118050620.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/927614i71BD1D8D0ACAD824/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pxedust_0-1623118050620.png" alt="pxedust_0-1623118050620.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and the library script relatively so:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pxedust_1-1623118234367.png" style="width: 511px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/927615iB151379DEFAFB1F1/image-dimensions/511x395?v=v2" width="511" height="395" role="button" title="pxedust_1-1623118234367.png" alt="pxedust_1-1623118234367.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found and fixed a few blunders (including forgetting to update the DMSIDs to the production records), but they've not done the trick. I assume it's tied to getting the assigned users to populate, which match between the 2 tenants. I have another array issue on another project (trying to spawn a clone, but one issue at a time), so the error is doubly frustrating. Any idea what I'm overlooking?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 03:45:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/script-error-spawn-and-add-task/m-p/10371819#M1052</guid>
      <dc:creator>pxedust</dc:creator>
      <dc:date>2021-06-08T03:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script Error - Spawn and Add Task</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/script-error-spawn-and-add-task/m-p/10371935#M1053</link>
      <description>&lt;P&gt;I guess the error is thrown by this line:&lt;/P&gt;
&lt;P&gt;spawnedTask.ASSIGNED_USERS = spawnedTask.APPROVAL_ROLE.USERS_ASSIGNED_TO_ROLE;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do the definitions of fields ASSIGNED_USERS and USERS_ASSIGNED_TO_ROLE match? I assume that both are users picklists, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have to loop the list and add given entries:&lt;/P&gt;
&lt;P&gt;if(spawnedTask.APPROVAL_ROLE !== null) {&lt;/P&gt;
&lt;P&gt;for(var i = 0; i &amp;lt;&amp;nbsp;spawnedTask.APPROVAL_ROLE.USERS_ASSIGNED_TO_ROLE.length; i++)&amp;nbsp;spawnedTask.ASSIGNED_USERS.add(spawnedTask.APPROVAL_ROLE.USERS_ASSIGNED_TO_ROLE[i]);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additional remark:&amp;nbsp;You do not need to pass 'item' to your library script function as the function has access to this global element anyway&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 05:10:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/script-error-spawn-and-add-task/m-p/10371935#M1053</guid>
      <dc:creator>sven.dickmans</dc:creator>
      <dc:date>2021-06-08T05:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script Error - Spawn and Add Task</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/script-error-spawn-and-add-task/m-p/10372130#M1054</link>
      <description>&lt;P&gt;Further to Sven's comment... also check that the picklists have the same setting for multi- or single-select (check the radio buttons on the field definition).&lt;/P&gt;&lt;P&gt;I think that error comes from confusing between an array (picklist multi select) and a non-array value (picklist single select).&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 06:54:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/script-error-spawn-and-add-task/m-p/10372130#M1054</guid>
      <dc:creator>philipfrench</dc:creator>
      <dc:date>2021-06-08T06:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script Error - Spawn and Add Task</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/script-error-spawn-and-add-task/m-p/10373617#M1055</link>
      <description>&lt;P&gt;Thank you!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I went through everything (ha!) at least twice again last night, and found I'd missed this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pxedust_0-1623169756292.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/927878iDF9226E96C94B978/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pxedust_0-1623169756292.png" alt="pxedust_0-1623169756292.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There's already a field with and ID of ASSIGNED_CHANGE_ROLES, so I opted to recreate the mismatch in production. Success and some very, very dorky chair dancing resulted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Re: the passed item, I'd noticed that in the documentation but until I had everything moved over I wasn't inclined to mess with script that (in the sandbox anyway!) was working until I'd verified that the move worked. I appreciate the confirmation!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Huge thanks to both you and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7180507"&gt;@philipfrench&lt;/a&gt;.&amp;nbsp;I'm starting to get into our scripts and doing development on other projects in earnest, the assistance is invaluable!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 16:37:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/script-error-spawn-and-add-task/m-p/10373617#M1055</guid>
      <dc:creator>pxedust</dc:creator>
      <dc:date>2021-06-08T16:37:21Z</dc:date>
    </item>
  </channel>
</rss>

