JS not invoking

  • 1
  • Question
  • Updated 1 month ago
  • Answered
Not sure why this js isn't working on the page - it's v2.  Any ideas?

<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" showheader="false" uniqueId="sk-3UPQ-1885" theme="Clever">
<models>
<model id="Account" limit="200" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account" orderby="Createddate desc" async="false">
<fields>
<field id="Name"/>
<field id="Branding__c"/>
<field id="Client_Source__c"/>
<field id="Industry"/>
<field id="Monthly_Total__c"/>
<field id="Contact__c"/>
<field id="Contact__r.Name"/>
<field id="Accountant__c"/>
<field id="Id"/>
</fields>
<conditions>
<condition type="fieldvalue" value="true" enclosevalueinquotes="false" field="Active__c"/>
</conditions>
<actions/>
</model>
<model id="AuditDetail" limit="1" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account" orderby="Createddate desc">
<fields>
<field id="Name"/>
<field id="Primary_Email__c"/>
<field id="crms14__Registration_Number__c"/>
<field id="DD_Code__c"/>
<field id="VAT_Number__c"/>
<field id="Id"/>
</fields>
<conditions>
<condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Id" clientorserver="server" state="filterableoff" inactive="true" name="AccountId"/>
<condition type="fieldvalue" value="true" enclosevalueinquotes="false" field="Active__c"/>
</conditions>
<actions/>
</model>
</models>
<components>
<skuid__masthead uniqueid="sk-3VF5-6918">
<divisions>
<division type="logo" uniqueId="sk-3VFh-7517">
<components>
<skuid__image source="url" height="custom" heightCustom="100%" uniqueId="sk-3VFh-7553" uniqueid="sk-3VFh-7740" datasource="salesforce" model="Account" url="https://app.cleveraccounts.com/assets/licence/clever/logo/logo-light-150.png">;
<interactions/>
<styles>
<spacing/>
</styles>
</skuid__image>
</components>
</division>
<division type="navigation" uniqueId="sk-3VGV-14100">
<components>
<skuid__navigation uniqueId="sk-3VGV-14136" uniqueid="sk-3VGV-14651" type="horizontal" overflowToMenu="false" alternateFormat="collapse">
<itemGroups>
<itemGroup>
<items>
<item label="Client Tickets" uniqueid="sk-3VGV-14099" icon="sk-webicon-font-awesome:envelope-o">
<actions>
<action type="redirect" window="self"/>
</actions>
</item>
<item label="Accounts" uniqueid="sk-3VGW-15099" icon="sk-webicon-font-awesome:lemon-o">
<actions>
<action type="redirect" window="self"/>
</actions>
</item>
<item label="VAT" uniqueid="sk-3VGW-15880" icon="sk-webicon-font-awesome:battery-empty">
<actions>
<action type="redirect" window="self"/>
</actions>
</item>
<item label="Onboarding" uniqueid="sk-3VGW-16877" icon="sk-webicon-font-awesome:hourglass-o">
<actions>
<action type="redirect" window="self"/>
</actions>
</item>
</items>
</itemGroup>
</itemGroups>
<renderConditions logictype="and"/>
<styles>
<spacing/>
</styles>
</skuid__navigation>
</components>
</division>
</divisions>
<renderConditions logictype="and"/>
</skuid__masthead>
<skuid__grid uniqueid="sk-3USz-3804" flexDirection="row" justifyContent="flex-start" alignItems="flex-start" columnGutter="0" rowGutter="0">
<divisions>
<division minWidth="28%" ratio="1" uniqueId="sk-3USz-3990" alignSelf="auto">
<components>
<skuid__wrapper uniqueid="sk-3VNV-32936" heightStrategy="fixed" height="custom" heightCustom="100vh">
<components>
<skuid__list model="Account" uniqueid="sk-3VVI-49627" pageSize="Infinity">
<columns>
<column uniqueId="sk-3VVl-51992" uniqueid="sk-3VVl-52297">
<items>

<item displayType="template" uniqueId="sk-3VeN-65747" uniqueid="sk-3VeN-65846" template="{{Name}}" displayStyle="secondary"/>
</items>
</column>
</columns>
<rowActions>
<action type="multi" label="Start" uniqueId="sk-3VfC-72600" uniqueid="sk-3VfC-72699">
<actions>
<action type="custom" action-sequence-id="a337348a-2467-4829-9d1b-bb05e1062102" snippet="client"/>
</actions>
</action>
</rowActions>
<massActions/>
<filtering enableSearch="false" instantSearch="false"/>
<interactions>
<interaction type="tap">
<action type="action-sequence" snippet="client" action-sequence-id="a337348a-2467-4829-9d1b-bb05e1062102"/>
</interaction>
</interactions>
</skuid__list>
</components>
<background type="color" color="#eef9ff"/>
<interactions/>
<renderConditions logictype="and"/>
</skuid__wrapper>
</components>
</division>
<division alignSelf="auto" minWidth="70%" ratio="1" uniqueId="sk-3VJi-15535">
<components>
<skuid__wrapper uniqueid="sk-3VbK-15088" heightStrategy="fixed" height="custom" heightCustom="100vh">
<components>
<skuid__wrapper uniqueid="sk-3Ve4-64035">
<components>
<skuid__buttonSet uniqueid="sk-3Ve9-64840">
<groups>
<skuid__buttonGroup uniqueId="sk-3Ve9-65024">
<buttons>
<skuid__button label="Button" uniqueId="sk-3Ve9-65074" uniqueid="sk-3Ve9-65173"/>
</buttons>
</skuid__buttonGroup>
</groups>
</skuid__buttonSet>
</components>
<background/>
<styles>
<spacing top="3" bottom="3" left="3" right="3"/>
</styles>
</skuid__wrapper>
<skuid__wrapper uniqueid="sk-3VUP-48097">
<components>
<skuid__text contents="About the Contact" uniqueid="sk-3VUW-48463" styleSettingsVariant="medium">
<styles>
<spacing top="2" left="2" bottom="2"/>
</styles>
</skuid__text>
</components>
<background type="color" color="#c6d9f0"/>
<styles>
<spacing top="3" left="3" right="3"/>
</styles>
</skuid__wrapper>
<skuid__form showErrorsInline="true" model="AuditDetail" uniqueid="sk-3VPp-18911" mode="readonly" showSaveCancel="false">
<sections>
<section title="New Section" uniqueId="sk-3VPp-19095" showHeading="false">
<rows>
<row uniqueid="sk-3VPy-21201">
<fields>
<skuid__field id="Name" uniqueId="sk-3VPy-21236" uniqueid="sk-3VPy-21335" showHelp="true"/>
</fields>
</row>
<row uniqueid="sk-3VQ1-22119">
<fields>
<skuid__field id="Primary_Email__c" uniqueId="sk-3VQ1-22154" uniqueid="sk-3VQ1-22253"/>
</fields>
</row>
<row uniqueid="sk-3VQ4-22561">
<fields>
<skuid__field id="crms14__Registration_Number__c" uniqueId="sk-3VQ4-22596" uniqueid="sk-3VQ4-22695"/>
</fields>
</row>
<row uniqueid="sk-3VQ8-22997">
<fields>
<skuid__field id="DD_Code__c" uniqueId="sk-3VQ8-23032" uniqueid="sk-3VQ8-23131"/>
</fields>
</row>
<row uniqueid="sk-3VQD-23406">
<fields>
<skuid__field id="VAT_Number__c" uniqueId="sk-3VQD-23441" uniqueid="sk-3VQD-23540"/>
</fields>
</row>
</rows>
<renderConditions logictype="and"/>
</section>
</sections>
<renderConditions logictype="and"/>
<styles>
<spacing bottom="3" top="3" left="3" right="3"/>
</styles>
</skuid__form>
<skuid__wrapper uniqueid="sk-3VRI-28795">
<components>
<skuid__grid uniqueid="sk-3VRN-29312" flexDirection="row" justifyContent="flex-start" alignItems="flex-start" columnGutter="0" rowGutter="0">
<divisions>
<division minWidth="100px" ratio="1" uniqueId="sk-3VRN-29498">
<components/>
</division>
<division alignSelf="auto" minWidth="100px" ratio="1" uniqueId="sk-3VRO-30684">
<components/>
</division>
</divisions>
</skuid__grid>
</components>
<background color="#ffffff" type="color" datasource="salesforce" source="staticresource" size="auto"/>
<interactions/>
<styles>
<spacing left="3" bottom="3" right="3"/>
</styles>
</skuid__wrapper>
</components>
<background type="color" color="#fbfbfc"/>
<styles>
<spacing/>
</styles>
</skuid__wrapper>
</components>
</division>
</divisions>
<interactions/>
<styles>
<spacing/>
</styles>
<renderConditions logictype="and"/>
</skuid__grid>
</components>
<resources>
<labels/>
<javascript>
<jsitem location="inlinesnippet" name="client" cachelocation="false">var params = arguments[0];
var $ = skuid.$;

function strict() {
"use strict";
var detailModel = skuid.model.getModel('AuditDetail');
var detailCondition = detailModel.getConditionByName('AccountId');
detailModel.setCondition(detailCondition,args.item.row.Id,true);
skuid.model.updateData([detailModel]);

}</jsitem>
</javascript>
<css/>
<actionsequences>
<actionsequence id="a337348a-2467-4829-9d1b-bb05e1062102" label="Client" type="reusable">
<description/>
<actions>
<action type="custom" snippet="client"/>
</actions>
<inputs/>
</actionsequence>
</actionsequences>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
<background type="color" color="transparent"/>
<interactions/>
</skuid__page>
Photo of Chris Mollan

Chris Mollan

  • 610 Points 500 badge 2x thumb

Posted 1 month ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 53,814 Points 50k badge 2x thumb
This line won't work in V2, one key API change in V2 is that there is no more concept of "Items":

detailModel.setCondition(detailCondition,args.item.row.Id,true);

Switching to just args.row.Id should work though:

detailModel.setCondition(detailCondition,args.row.Id,true);