Skip to content

Commit

Permalink
Afform - allow ids to be passed directly into the directive not just …
Browse files Browse the repository at this point in the history
…through the URL

This gives Submit Forms the same feature as Search Forms, entity ids can be passed
directly into the directive as 'options', allowing ids to be passed around internally.
  • Loading branch information
colemanw committed Jun 8, 2022
1 parent a9bd8bf commit f032946
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ext/afform/core/ang/af/afForm.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
var schema = {},
data = {},
status,
args,
ctrl = this;

this.$onInit = function() {
Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f032946

Please sign in to comment.