component.set('v.AssetsType'AssetsList', {'TypeLabel': 'Asset Type', 'TypeValue': '','TypeId': 'AssetType1',
'AmountLabel': 'Asset Amount', 'AmountValue': '', 'AmountId': 'AssetAmount1'});
var AssetList =AssetList= cmp.get('v.AssetsType'AssetsList');
var FactfindId = cmp.get('v.ffRecord.Id');
var inputAssetListinputAssetListAction = cmp.get("c.inputAssetList");
inputAssetListinputAssetListAction.setParams({
"AssetList": AssetList,
"FactfindId": FactfindId
});
inputAssetListinputAssetListAction.setCallback(this, function (response) {
//store state of response
var state = response.getState();
if (state === "SUCCESS") {
console.log(state);
if (response.getReturnValue() != null) {
// if getting any error while update the records , then display a alert msg/
alert('The following error has occurred. while updating record-->' + response.getReturnValue());
} else {
console.log('check it--> update successful');
}
}
});
$A.enqueueAction(inputAssetListinputAssetListAction);
public static void inputAssetList(list<String> AssestListAssetList, string FactfindId) {
FactfindMultiples__c[] Assets = new List<FactfindMultiples__c>();
for(Integer i=1;i<AssestListi=1;i<AssetList.size();i++)
{
FactfindMultiples__c Asset = new FactfindMultiples__c(Name='Asset' + i,
AssetType__c= AssestList[i]AssetList[i].TypeValue);
Assets.add(Asset);
}
}
I've tried syntax like AssestList[i]AssetList[i].TypeValue but this returns errors.