diff --git a/ext/afform/core/ang/af/afForm.component.js b/ext/afform/core/ang/af/afForm.component.js index 888953f49988..972e78b9b2d1 100644 --- a/ext/afform/core/ang/af/afForm.component.js +++ b/ext/afform/core/ang/af/afForm.component.js @@ -8,6 +8,7 @@ var schema = {}, data = {}, status, + args, ctrl = this; this.$onInit = function() { @@ -36,8 +37,8 @@ return $scope.$parent.meta; }; this.loadData = function() { - var toLoad = 0, - args = $scope.$parent.routeParams || {}; + var toLoad = 0; + args = _.assign({}, $scope.$parent.routeParams || {}, $scope.$parent.options || {}); _.each(schema, function(entity, entityName) { if (args[entityName] || entity.autofill) { toLoad++; @@ -88,7 +89,7 @@ crmApi4('Afform', 'submit', { name: ctrl.getFormMeta().name, - args: $scope.$parent.routeParams || {}, + args: args, values: data} ).then(function(response) { if (ctrl.fileUploader.getNotUploadedItems().length) {