I have an editable grid where user can add new records. UI is build on New Record Syncs.
When i click "Add something" link, getting below error.
this issue is happening when the grid/whole interface is empty.
For example, if i have records in another sections, then it is working fine.
Everytime we click on add, i am saving specific data to columns. Could not figure it out what this error is saying.
Attached code of that UI, any help appreciated.
a!localVariables( local!refTickerData: rule!SRT_QRY_tickerReferenceRecordType(pagingInfo: a!pagingInfo(1, 5000)), local!labels: { "Equity", "Fixed-Income", "Other", "Review Required" }, local!filterSelected: if( ri!filterSelected = "1 ADJUSTED", 12, ri!filterSelected = "2 ADJUSTED", 13, ri!filterSelected = "3 ADJUSTED", 14, {} ), local!data: ri!portfolioData, local!adjustmentOne: if( local!filterSelected = 12, if( a!isNullOrEmpty( index( local!data, wherecontains( 12, local!data['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'] ) ) ), index( local!data, wherecontains( 10, local!data['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'] ) ), index( local!data, wherecontains( 12, local!data['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'] ) ) ), {} ), local!adjustmentTwo: if( local!filterSelected = 13, if( a!isNullOrEmpty( index( local!data, wherecontains( 13, local!data['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'] ) ) ), index( local!data, wherecontains( 11, local!data['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'] ) ), index( local!data, wherecontains( 13, local!data['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'] ) ) ), {} ), local!adjustmentThree: if( local!filterSelected = 14, index( local!data, wherecontains( 14, local!data['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'] ) ), {} ), local!equityData: if( local!filterSelected = 12, if( a!isNullOrEmpty(local!adjustmentOne), {}, index( local!adjustmentOne, wherecontains( "Equity", local!adjustmentOne['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ), {} ) ), local!filterSelected = 13, if( a!isNullOrEmpty(local!adjustmentTwo), {}, index( local!adjustmentTwo, wherecontains( "Equity", local!adjustmentTwo['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ), {} ) ), local!filterSelected = 14, if( a!isNullOrEmpty(local!adjustmentThree), {}, index( local!adjustmentThree, wherecontains( "Equity", ( local!adjustmentThree['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ) ), {} ) ), null() ), local!fixedIncomeData: if( local!filterSelected = 12, if( a!isNullOrEmpty(local!adjustmentOne), {}, index( local!adjustmentOne, wherecontains( "Fixed-Income", local!adjustmentOne['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ), {} ) ), local!filterSelected = 13, if( a!isNullOrEmpty(local!adjustmentTwo), {}, index( local!adjustmentTwo, wherecontains( "Fixed-Income", local!adjustmentTwo['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ), {} ) ), local!filterSelected = 14, if( a!isNullOrEmpty(local!adjustmentThree), {}, index( local!adjustmentThree, wherecontains( "Fixed-Income", local!adjustmentThree['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ), {} ) ), null() ), local!otherData: if( local!filterSelected = 12, if( a!isNullOrEmpty(local!adjustmentOne), {}, index( local!adjustmentOne, wherecontains( "Other", ( local!adjustmentOne['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ) ), {} ) ), local!filterSelected = 13, if( a!isNullOrEmpty(local!adjustmentTwo), {}, index( local!adjustmentTwo, wherecontains( "Other", ( local!adjustmentTwo['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ) ), {} ) ), local!filterSelected = 14, if( a!isNullOrEmpty(local!adjustmentThree), {}, index( local!adjustmentThree, wherecontains( "Other", ( local!adjustmentThree['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ) ), {} ) ), null() ), local!reviewRequiredData: if( local!filterSelected = 12, if( a!isNullOrEmpty(local!adjustmentOne), {}, index( local!adjustmentOne, wherecontains( "Review Required", ( local!adjustmentOne['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ) ), {} ) ), local!filterSelected = 13, if( a!isNullOrEmpty(local!adjustmentTwo), {}, index( local!adjustmentTwo, wherecontains( "Review Required", ( local!adjustmentTwo['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ) ), {} ) ), local!filterSelected = 14, if( a!isNullOrEmpty(local!adjustmentThree), {}, index( local!adjustmentThree, wherecontains( "Review Required", ( local!adjustmentThree['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'] ) ), {} ) ), null() ), local!saveSuccessful, local!deleteStatus, local!excludeRows, local!error, local!dataToSave, { /*a!textField(readOnly: true, value: local!deleteStatus),*/ a!forEach( local!labels, { a!localVariables( local!labelValue: fv!item, a!boxLayout( label: fv!item, labelSize: "MEDIUM_PLUS", style: "ACCENT", marginBelow: "LESS", contents: { a!gridLayout( labelPosition: "ABOVE", headerCells: { a!gridLayoutHeaderCell(label: "Ticker or CUSIP"), a!gridLayoutHeaderCell(label: "Product Name"), a!gridLayoutHeaderCell(label: "Allocations %"), a!gridLayoutHeaderCell(label: ""), a!gridLayoutHeaderCell(label: "") }, columnConfigs: { a!gridLayoutColumnConfig(width: "NARROW"), a!gridLayoutColumnConfig(width: "NARROW", ), a!gridLayoutColumnConfig(width: "NARROW"), a!gridLayoutColumnConfig(width: "ICON"), a!gridLayoutColumnConfig(width: "ICON") }, rows: a!forEach( items: if( fv!item = "Equity", local!equityData, fv!item = "Fixed-Income", local!fixedIncomeData, fv!item = "Other", local!otherData, local!reviewRequiredData ), expression: a!gridRowLayout( id: fv!index, contents: { a!pickerFieldCustom( placeholder: "Type a Ticker", maxSelections: 1, suggestFunction: rule!SRT_ucArrayPickerFilterForTickerCode(searchString: _), selectedLabels: if( isnull( fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip'] ), {}, fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip'] ), value: fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip'], saveInto: { fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip'], a!save( fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{42f5fce0-6c85-488c-a1e6-ce2d5d14db86}productName'], union( rule!SRT_ucArrayPickerFilterForProductName( searchString: fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip'] ).data, rule!SRT_ucArrayPickerFilterForProductName( searchString: fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip'] ).data ) ), a!save( fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f5934bc1-37af-43b3-b91b-839a4554895c}tickerId'], index( rule!SRT_ucArrayPickerFilterForTickerId( searchString: fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip'] ), "identifiers", {} ) ) } ), a!pickerFieldCustom( placeholder: "Type a Product Name", maxSelections: 1, suggestFunction: rule!SRT_ucArrayPickerFilterForProductName(searchString: _), selectedLabels: if( isnull( fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip'] ), {}, if( isnull( fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{42f5fce0-6c85-488c-a1e6-ce2d5d14db86}productName'] ), {}, fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{42f5fce0-6c85-488c-a1e6-ce2d5d14db86}productName'] ) ), value: if( isnull( fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip'] ), {}, fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{42f5fce0-6c85-488c-a1e6-ce2d5d14db86}productName'] ), saveInto: { fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{42f5fce0-6c85-488c-a1e6-ce2d5d14db86}productName'] } ), a!floatingPointField( value: fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{ba3822fd-438e-403b-9971-4f74392b4223}overall'], saveInto: fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{ba3822fd-438e-403b-9971-4f74392b4223}overall'], ), a!richTextDisplayField( value: a!richTextIcon( icon: "close", altText: "delete ", caption: "Remove ", link: a!dynamicLink( value: fv!index, saveInto: { a!match( default: null, value: local!labelValue, equals: "Equity", then: { a!writeRecords( records: { 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio'( 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e86cbf27-b76b-4f1c-a07f-efa80f27d44b}id': fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e86cbf27-b76b-4f1c-a07f-efa80f27d44b}id'], 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{df7e6b6d-508d-4a78-8d12-41372a07944f}isActive': 0 ) }, onSuccess: a!save(local!deleteStatus, fv!recordsUpdated), onError: a!save(local!deleteStatus, fv!error) ), a!save( local!equityData, remove(local!equityData, save!value) ) }, equals: "Fixed-Income", then: { a!writeRecords( records: { 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio'( 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e86cbf27-b76b-4f1c-a07f-efa80f27d44b}id': fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e86cbf27-b76b-4f1c-a07f-efa80f27d44b}id'], 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{df7e6b6d-508d-4a78-8d12-41372a07944f}isActive': 0 ) }, onSuccess: a!save(local!deleteStatus, fv!recordsUpdated), onError: a!save(local!deleteStatus, fv!error) ), a!save( local!fixedIncomeData, remove(local!fixedIncomeData, save!value) ) }, equals: "Other", then: { a!writeRecords( records: { 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio'( 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e86cbf27-b76b-4f1c-a07f-efa80f27d44b}id': fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e86cbf27-b76b-4f1c-a07f-efa80f27d44b}id'], 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{df7e6b6d-508d-4a78-8d12-41372a07944f}isActive': 0 ) }, onSuccess: a!save(local!deleteStatus, fv!recordsUpdated), onError: a!save(local!deleteStatus, fv!error) ), a!save( local!otherData, remove(local!otherData, save!value) ) }, equals: "Review Required", then: { a!writeRecords( records: { 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio'( 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e86cbf27-b76b-4f1c-a07f-efa80f27d44b}id': fv!item['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e86cbf27-b76b-4f1c-a07f-efa80f27d44b}id'], 'recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{df7e6b6d-508d-4a78-8d12-41372a07944f}isActive': 0 ) }, onSuccess: a!save(local!deleteStatus, fv!recordsUpdated), onError: a!save(local!deleteStatus, fv!error) ), a!save( local!reviewRequiredData, remove(local!reviewRequiredData, save!value) ), } ) } ), linkStyle: "STANDALONE", color: "NEGATIVE", ), preventWrapping: true() ), a!checkboxField( choiceLabels: { "Exclude" }, choiceValues: { true }, value: local!excludeRows, saveInto: local!excludeRows ) } ) ), addRowLink: a!dynamicLink( label: "Add Ticker or Product", value: { startDate: today() + 1 }, saveInto: { if( local!labelValue = "Equity", { a!save( local!equityData, append(local!equityData, save!value) ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{0aac564b-6cdc-416f-89f6-fd3dbd0d3fd4}requestId'], ri!requestId ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'], "Equity" ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'], local!filterSelected ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cf6d7b24-d83e-4422-a20e-2263c1a1462a}category'], 12.01 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f446558e-d938-44c2-aac0-cdfdb8bde16d}inceptionDate'], today() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{5a666dd2-689b-4420-8e27-6f33c1ee2578}expenseRatio'], 33.21 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{4f839fce-ee98-4f27-9dca-3754cac5ef86}totalEquity'], 9.87 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{736da71f-52c8-4b28-887e-1ed07a28b6d6}usEquity'], 21.12 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{39523435-ba78-40b2-a53e-5fe1962b1b4f}nonUsEquity'], 21.22 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{90849098-7517-488e-895e-70d81c767b6c}totalFixedIncome'], 33.01 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f1918c73-a08c-436e-bbcc-0f9dec3f6d65}usFixedIncome'], 55.43 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{87c5ce58-ff4e-4663-88c8-dddb51331a28}nonUsFixedIncome'], 21.12 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e8b37625-87b2-4874-9f57-fe695b024324}cash'], 12.22 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{1f968045-570a-4da6-9dd9-50a53758533c}convertible'], 12.32 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{3745460e-d7d7-4887-ae9b-5b9e98c22b99}preferred'], 2.11 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cde9e90d-9bcf-4691-9f72-006ebbb22054}other'], 3.21 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e21983ca-2dd1-448e-939c-e9a2d263a2e6}createdBy'], loggedInUser() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{97948387-0845-4121-9920-b56b8f2feec9}createdOn'], now() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{19563729-8369-4d8d-b07f-4d03b2f16ecd}modifiedBy'], loggedInUser() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{c7288553-56af-4827-a22a-9f1ba46cd075}modifiedOn'], now() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{df7e6b6d-508d-4a78-8d12-41372a07944f}isActive'], true() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f5934bc1-37af-43b3-b91b-839a4554895c}tickerId'], rule!SRT_ucArrayPickerFilterForTickerCode(searchString: local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip']).identifiers[2] ) }, local!labelValue = "Fixed-Income", { a!save( local!fixedIncomeData, append(local!fixedIncomeData, save!value) ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{0aac564b-6cdc-416f-89f6-fd3dbd0d3fd4}requestId'], ri!requestId ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'], "Fixed-Income" ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'], local!filterSelected ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cf6d7b24-d83e-4422-a20e-2263c1a1462a}category'], 12.01 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f446558e-d938-44c2-aac0-cdfdb8bde16d}inceptionDate'], today() ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{5a666dd2-689b-4420-8e27-6f33c1ee2578}expenseRatio'], 33.21 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{4f839fce-ee98-4f27-9dca-3754cac5ef86}totalEquity'], 9.87 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{736da71f-52c8-4b28-887e-1ed07a28b6d6}usEquity'], 21.12 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{39523435-ba78-40b2-a53e-5fe1962b1b4f}nonUsEquity'], 21.22 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{90849098-7517-488e-895e-70d81c767b6c}totalFixedIncome'], 33.01 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f1918c73-a08c-436e-bbcc-0f9dec3f6d65}usFixedIncome'], 55.43 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{87c5ce58-ff4e-4663-88c8-dddb51331a28}nonUsFixedIncome'], 21.12 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e8b37625-87b2-4874-9f57-fe695b024324}cash'], 12.22 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{1f968045-570a-4da6-9dd9-50a53758533c}convertible'], 12.32 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{3745460e-d7d7-4887-ae9b-5b9e98c22b99}preferred'], 2.11 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cde9e90d-9bcf-4691-9f72-006ebbb22054}other'], 3.21 ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e21983ca-2dd1-448e-939c-e9a2d263a2e6}createdBy'], loggedInUser() ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{97948387-0845-4121-9920-b56b8f2feec9}createdOn'], now() ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{19563729-8369-4d8d-b07f-4d03b2f16ecd}modifiedBy'], loggedInUser() ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{c7288553-56af-4827-a22a-9f1ba46cd075}modifiedOn'], now() ), a!save( local!fixedIncomeData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{df7e6b6d-508d-4a78-8d12-41372a07944f}isActive'], true() ) }, local!labelValue = "Other", { a!save( local!otherData, append(local!otherData, save!value) ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{0aac564b-6cdc-416f-89f6-fd3dbd0d3fd4}requestId'], ri!requestId ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'], "Other" ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'], local!filterSelected ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cf6d7b24-d83e-4422-a20e-2263c1a1462a}category'], 12.01 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f446558e-d938-44c2-aac0-cdfdb8bde16d}inceptionDate'], today() ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{5a666dd2-689b-4420-8e27-6f33c1ee2578}expenseRatio'], 33.21 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{4f839fce-ee98-4f27-9dca-3754cac5ef86}totalEquity'], 9.87 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{736da71f-52c8-4b28-887e-1ed07a28b6d6}usEquity'], 21.12 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{39523435-ba78-40b2-a53e-5fe1962b1b4f}nonUsEquity'], 21.22 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{90849098-7517-488e-895e-70d81c767b6c}totalFixedIncome'], 33.01 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f1918c73-a08c-436e-bbcc-0f9dec3f6d65}usFixedIncome'], 55.43 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{87c5ce58-ff4e-4663-88c8-dddb51331a28}nonUsFixedIncome'], 21.12 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e8b37625-87b2-4874-9f57-fe695b024324}cash'], 12.22 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{1f968045-570a-4da6-9dd9-50a53758533c}convertible'], 12.32 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{3745460e-d7d7-4887-ae9b-5b9e98c22b99}preferred'], 2.11 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cde9e90d-9bcf-4691-9f72-006ebbb22054}other'], 3.21 ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e21983ca-2dd1-448e-939c-e9a2d263a2e6}createdBy'], loggedInUser() ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{97948387-0845-4121-9920-b56b8f2feec9}createdOn'], now() ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{19563729-8369-4d8d-b07f-4d03b2f16ecd}modifiedBy'], loggedInUser() ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{c7288553-56af-4827-a22a-9f1ba46cd075}modifiedOn'], now() ), a!save( local!otherData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{df7e6b6d-508d-4a78-8d12-41372a07944f}isActive'], true() ) }, local!labelValue = "Review Required", { a!save( local!reviewRequiredData, append(local!reviewRequiredData, save!value) ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{0aac564b-6cdc-416f-89f6-fd3dbd0d3fd4}requestId'], ri!requestId ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'], "Review Required" ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'], local!filterSelected ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cf6d7b24-d83e-4422-a20e-2263c1a1462a}category'], 12.01 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f446558e-d938-44c2-aac0-cdfdb8bde16d}inceptionDate'], today() ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{5a666dd2-689b-4420-8e27-6f33c1ee2578}expenseRatio'], 33.21 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{4f839fce-ee98-4f27-9dca-3754cac5ef86}totalEquity'], 9.87 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{736da71f-52c8-4b28-887e-1ed07a28b6d6}usEquity'], 21.12 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{39523435-ba78-40b2-a53e-5fe1962b1b4f}nonUsEquity'], 21.22 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{90849098-7517-488e-895e-70d81c767b6c}totalFixedIncome'], 33.01 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f1918c73-a08c-436e-bbcc-0f9dec3f6d65}usFixedIncome'], 55.43 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{87c5ce58-ff4e-4663-88c8-dddb51331a28}nonUsFixedIncome'], 21.12 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e8b37625-87b2-4874-9f57-fe695b024324}cash'], 12.22 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{1f968045-570a-4da6-9dd9-50a53758533c}convertible'], 12.32 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{3745460e-d7d7-4887-ae9b-5b9e98c22b99}preferred'], 2.11 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cde9e90d-9bcf-4691-9f72-006ebbb22054}other'], 3.21 ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e21983ca-2dd1-448e-939c-e9a2d263a2e6}createdBy'], loggedInUser() ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{97948387-0845-4121-9920-b56b8f2feec9}createdOn'], now() ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{19563729-8369-4d8d-b07f-4d03b2f16ecd}modifiedBy'], loggedInUser() ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{c7288553-56af-4827-a22a-9f1ba46cd075}modifiedOn'], now() ), a!save( local!reviewRequiredData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{df7e6b6d-508d-4a78-8d12-41372a07944f}isActive'], true() ) }, {} ) } ), rowHeader: 1 ) } ) ) } ), a!buttonLayout( primaryButtons: { a!buttonWidget( label: "CANCEL", value: "Cancel", saveInto: { ri!buttonAction }, submit: true(), style: "SECONDARY", validate: false() ), a!buttonWidget( label: "SAVE", value: "Save", saveInto: { ri!buttonAction, a!save( local!dataToSave, append( { local!equityData, local!fixedIncomeData, local!otherData, local!reviewRequiredData } ) ), if( isnull(ri!dataToSave), {}, { a!writeRecords( records: { /*local!equityData,*/ /*local!fixedIncomeData,*/ /*local!otherData,*/ /*local!reviewRequiredData*/ local!dataToSave }, onSuccess: a!save(local!saveSuccessful, true), onError: a!save(local!error, fv!error) ) } ) }, submit: true(), style: "PRIMARY" ) } ) } )
Discussion posts and replies are publicly visible
It is a bit of a challenge to read 100 lines of code. I suggest to reduce this to a minimal version which still shows this behaviour.
But, while looking at this code, I see that you have some weird syntax in e.g. line 587. You cannot nest if() statements like this.
Thank you for your response Stefan, I agree with 587. But i am sure the way if() written is not causing the issue.
To give details, i have code snippet below, under saveinto -- along with append i have additional saves. They are certainly throwing error.
I do not understand why this is breaking only when whole data is null as i mentioned in my post.
Let me know if you need more details.
a!dynamicLink( label: "Add Ticker or Product", value: { startDate: today() + 1 }, saveInto: { if( local!labelValue = "Equity", { a!save( local!equityData, append(local!equityData, save!value) ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{0aac564b-6cdc-416f-89f6-fd3dbd0d3fd4}requestId'], ri!requestId ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{277086ff-1613-4c0b-84e9-9932ba4f19bc}investmentType'], "Equity" ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{154478bd-35f2-4ef1-b0f2-81449e3fb855}portfolioVersionRefId'], local!filterSelected ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cf6d7b24-d83e-4422-a20e-2263c1a1462a}category'], 12.01 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f446558e-d938-44c2-aac0-cdfdb8bde16d}inceptionDate'], today() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{5a666dd2-689b-4420-8e27-6f33c1ee2578}expenseRatio'], 33.21 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{4f839fce-ee98-4f27-9dca-3754cac5ef86}totalEquity'], 9.87 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{736da71f-52c8-4b28-887e-1ed07a28b6d6}usEquity'], 21.12 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{39523435-ba78-40b2-a53e-5fe1962b1b4f}nonUsEquity'], 21.22 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{90849098-7517-488e-895e-70d81c767b6c}totalFixedIncome'], 33.01 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f1918c73-a08c-436e-bbcc-0f9dec3f6d65}usFixedIncome'], 55.43 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{87c5ce58-ff4e-4663-88c8-dddb51331a28}nonUsFixedIncome'], 21.12 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e8b37625-87b2-4874-9f57-fe695b024324}cash'], 12.22 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{1f968045-570a-4da6-9dd9-50a53758533c}convertible'], 12.32 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{3745460e-d7d7-4887-ae9b-5b9e98c22b99}preferred'], 2.11 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cde9e90d-9bcf-4691-9f72-006ebbb22054}other'], 3.21 ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{e21983ca-2dd1-448e-939c-e9a2d263a2e6}createdBy'], loggedInUser() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{97948387-0845-4121-9920-b56b8f2feec9}createdOn'], now() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{19563729-8369-4d8d-b07f-4d03b2f16ecd}modifiedBy'], loggedInUser() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{c7288553-56af-4827-a22a-9f1ba46cd075}modifiedOn'], now() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{df7e6b6d-508d-4a78-8d12-41372a07944f}isActive'], true() ), a!save( local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{f5934bc1-37af-43b3-b91b-839a4554895c}tickerId'], rule!SRT_ucArrayPickerFilterForTickerCode(searchString: local!equityData['recordType!{5bf7f7cb-2b7c-430f-93b1-102a13b4f3af}SRT Portfolio.fields.{cb090f37-4d4b-43f3-9393-8ceb1cba74a5}tickerOrCusip']).identifiers[2] ) }, {} )
I agree to the if statements not being the issue here.
What I see, is that you first add a new item, but then try to write to that new item I assume. Is there a reason you do not assemble the item first and then add it to the list? I mean you can just do something like this:
append( local!equityData, recordType!something( field1: "value", field2: "value )