adoptRows() provides a temp Id? Or no?

Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
edited May 8, 2020 in Questions
Are we sure this:

If an incoming row does not contain an Id, then Skuid will generate a unique Id for the row.
is still true for adoptRows? Have been working through everyone's solutions (thanks btw ;) ). But adopting exact fieldNames etc... the api doesn't seem to be generating Id's.

Thanks,
AP

Comments

  • Mark DeSimoneMark DeSimone 🛠️ 
    edited May 5, 2020
    Hi Arne-Per,

    Do you happen to have a page or snippet that demonstrates this? How are you setting the incoming row up so it doesn't have an id?
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 5, 2020
    Hi Mark! I will put one together as the current one is using  custom objects. In v1 it was creating an id in __Skuid and also in v2 (Symbol) Id but not one that provided the same recognition for the table as .createRow().  I will have something up in the next day. Thanks for the reply!

  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 6, 2020
    Hi Mark,    Below is an sample page with basic snippet and a shot of it executed.    It adds Symbol (Record ), Symbol: (Id) but Id is in form of sk-3hgk-1468 not the same as sk-temp-record-id-3hiJ-1532 nor in the Row Id    Side question: What is the new "Symbol" notation?    Thanks for any insight.    Cheers,  AP  

  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 6, 2020
    <skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">  <models>  <model id="Accounts" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account">   <fields>    <field id="Id"/>    <field id="Name"/>    <field id="Description"/>    <field id="AccountNumber"/>   </fields>   <conditions/>   <actions/>  </model>  </models>  <components>  <skuid__buttonSet model="Accounts" uniqueid="sk-3he2-5475">   <groups>    <skuid__buttonGroup>     <buttons>      <skuid__button label="Test Adopt" uniqueId="sk-3he2-5474">       <actions>        <action type="custom" snippet="testAdoptSnip"/>       </actions>      </skuid__button>     </buttons>    </skuid__buttonGroup>   </groups>  </skuid__buttonSet>  <skuid__table allowColumnFreezing="dragDrop" model="Accounts" uniqueid="sk-3hdz-4478" mode="read">   <fields>    <field id="Id" uniqueid="fi-3heA-6329"/>    <field id="Description" uniqueid="fi-3heA-6330"/>    <field id="Name" uniqueid="fi-3heA-6331"/>    <field id="AccountNumber" uniqueid="fi-3heA-6332"/>   </fields>   <filtering enableSearch="false"/>   <rowActions/>   <massActions/>   <actions>    <action type="multi" label="Add Row">     <actions>      <action type="createRow" model="Accounts" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context"/>     </actions>    </action>   </actions>  </skuid__table>  </components>  <resources>   <labels/>   <javascript>  <jsitem location="inlinesnippet" name="testAdoptSnip" cachelocation="false">//test adopt rows  //  var params= arguments[0],      $ = skuid.$,      targetModel = skuid.$M('Accounts'), addedRow,      temp=[];          temp.push({AccountNumber: 'L15657', Description: 'This is a test'});  temp.push({AccountNumber: 'M9999',  Description: 'Still another test'});        // console.log(temp);    addedRow = targetModel.adoptRows(temp);  console.log('this is adopted row', addedRow);  //note adds Symbol (Record ), Symbol: (Id)   //but Id is in form of sk-3hgk-1468  //not the same as sk-temp-record-id-3hiJ-1532 nor in row Id field  </jsitem>  </javascript>   <css/>   <actionsequences/>  </resources>  <styles>   <styleitem type="background" bgtype="none"/>  </styles>  </skuid__page> 
  • Arne-Per HeurbergArne-Per Heurberg ✭✭✭✭
    edited May 6, 2020
    Forgot to mention v2 12.4.5
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!