load( local!Partial_Transfer_Asset_Information: ri!Partial_Transfer_Asset_Information, local!transferType, local!items, local!addItem:1, local!itemsToken, a!formLayout( label: "Enter Transfer Instructions for "&ri!DelFirmName&" - "&ri!TransferAssetType, firstColumnContents: { a!sectionLayout( label:"Receiving Trust Account Information", firstColumnContents: { a!textField( label: "Account Number", labelPosition:"ADJACENT", readOnly:true(), value: ri!AccountNumber, saveInto: ri!AccountNumber ), a!textField( label: "Account Name", labelPosition:"ADJACENT", readOnly:true(), value: ri!AccountName, saveInto: ri!AccountName ) } ), a!sectionLayout( label:"Delivering Firm Account Information", firstColumnContents: { a!dropdownField( label: "Delivering Firm Account Type", labelPosition: "ADJACENT", choiceLabels:ldrop(cons!DELIVERING_ACCOUNT_TYPE,1), choiceValues: ldrop(cons!DELIVERING_ACCOUNT_TYPE,1), placeholderLabel: "Select Delivering Firm Account Type...", value:ri!DelAcctType, required: true, saveInto:ri!DelAcctType ), a!textField( label: "Delivering Firm Account Number", labelPosition:"ADJACENT", value: ri!DelAcctNumber, saveInto: ri!DelAcctNumber, required:true() ), a!textField( label: "Delivering Firm Account Name", labelPosition:"ADJACENT", value: ri!DelFirmName, saveInto: ri!DelFirmName, required:true() ) } ), if(contains({"Brokerage Account - External","IRA - External", "Brokerage Account","Fund Company", "Retirement Account","Portfolio Advisor"}, ri!TransferAssetType), a!sectionLayout( label:"Transfer Instructions", firstColumnContents: { a!dropdownField( label: "Transfer Type", labelPosition: "ADJACENT", choiceLabels:{"Full In Kind","Full Liquidate","Partial"}, choiceValues:{"Full In Kind","Full Liquidate","Partial"}, value:"Full In Kind", saveInto:local!transferType ), a!paragraphField( label:"Instructions", labelposition:"ADJACENT", saveInto:ri!TransferSpecialInstructions ) } ),{}), if(local!transferType = "Partial", a!sectionLayout( label: "Asset Information (for partial transfer)", firstColumnContents: { a!gridLayout( headerCells: { a!gridLayoutHeaderCell(label: "Share/ Face"), a!gridLayoutHeaderCell(label: "Security Description", align: "RIGHT"), a!gridLayoutHeaderCell(label: "CUSIP/ Ticker", align: "RIGHT"), a!gridLayoutHeaderCell(label: "Instructions", align: "RIGHT"), a!gridLayoutHeaderCell(label: "", align: "RIGHT") }, /* Only needed when some columns need to be narrow */ columnConfigs: { a!gridLayoutColumnConfig(width: "DISTRIBUTE"), a!gridLayoutColumnConfig(width: "DISTRIBUTE"), a!gridLayoutColumnConfig(width: "DISTRIBUTE"), a!gridLayoutColumnConfig(width: "DISTRIBUTE"), a!gridLayoutColumnConfig(width: "NARROW") }, rows: a!applyComponents( function: rule!Partial_Tran_Asset_Info_ucItemRowEach( items: ri!Partial_Transfer_Asset_Information, index: _, itemsToken: local!itemsToken ), array: if(or(isnull(ri!Partial_Transfer_Asset_Information), count(ri!Partial_Transfer_Asset_Information) < 1), {}, 1+rule!enumerate(count(ri!Partial_Transfer_Asset_Information))), arrayVariable: local!itemsToken ) ), a!linkField( label: "Add Link", labelPosition: "COLLAPSED", links: a!dynamicLink( label: "+Add Item", /* * For your use case, set the value to a blank instance of your CDT using * the type constructor, e.g. type!PurchaseRequestItem(). Only specify the field * if you want to give it a default value e.g. due: today()+1. */ value: {id:local!addItem + 1}, saveInto: { a!save(ri!Partial_Transfer_Asset_Information, append(local!Partial_Transfer_Asset_Information, save!value)), /* * When modifying the size of the array used in a!applyComponents, * make the same change in the "token" array variable */ a!save(local!itemsToken, append(local!itemsToken, save!value)) } ) ) }, buttons: a!buttonLayout(primaryButtons: a!buttonWidgetSubmit( label: "Submit", saveInto:{ri!Partial_Transfer_Asset_Information, append(local!Items, save!value)} )) ),{}) }, buttons: a!buttonLayout( primaryButtons: a!buttonWidgetSubmit( label: "Next", value:"Submit", style:"PRIMARY", disabled:not(len(ri!AccountNumber)), saveInto:{ri!TransferType << append(local!transferType,_) } )/*, secondaryButtons: a!buttonWidgetSubmit( label: "Cancel", confirmMessage: "Are you sure?", value: "Cancel", saveInto: ri!button, skipValidation: true )*/ ) ))