Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
c953b91e
Commit
c953b91e
authored
4 years ago
by
S.Listl
Browse files
Options
Downloads
Patches
Plain Diff
Conditional workflow form fields fix
parent
5a10fbd1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/WorkflowTask_entity/WorkflowTask_entity.aod
+1
-0
1 addition, 0 deletions
entity/WorkflowTask_entity/WorkflowTask_entity.aod
entity/WorkflowTask_entity/entityfields/formresult/onValueChange.js
+25
-0
25 additions, 0 deletions
...kflowTask_entity/entityfields/formresult/onValueChange.js
with
26 additions
and
0 deletions
entity/WorkflowTask_entity/WorkflowTask_entity.aod
+
1
−
0
View file @
c953b91e
...
...
@@ -31,6 +31,7 @@
</entityField>
<entityField>
<name>
FORMRESULT
</name>
<onValueChange>
%aditoprj%/entity/WorkflowTask_entity/entityfields/formresult/onValueChange.js
</onValueChange>
</entityField>
<entityField>
<name>
NAME
</name>
...
...
This diff is collapsed.
Click to expand it.
entity/WorkflowTask_entity/entityfields/formresult/onValueChange.js
0 → 100644
+
25
−
0
View file @
c953b91e
import
(
"
system.result
"
);
import
(
"
system.vars
"
);
import
(
"
system.workflow
"
);
import
(
"
system.neon
"
);
var
taskId
=
vars
.
get
(
"
$field.UID
"
);
var
newResult
=
vars
.
get
(
"
$local.value
"
);
var
oldResult
=
vars
.
get
(
"
$field.FORMRESULT
"
);
if
(
newResult
&&
newResult
!==
oldResult
)
{
/*
* fieldListeners = all fields that are used inside a visibility expression
* -> if one of these fields is changed, set the new FORMDEFINITION
*/
var
fieldListeners
=
JSON
.
parse
(
workflow
.
getFormFieldListeners
(
taskId
));
newResult
=
newResult
?
JSON
.
parse
(
newResult
)
:
{};
oldResult
=
oldResult
?
JSON
.
parse
(
oldResult
)
:
{};
var
isRefreshRequired
=
fieldListeners
.
some
(
function
(
fieldId
)
{
return
newResult
[
fieldId
]
!==
oldResult
[
fieldId
];
});
if
(
isRefreshRequired
)
neon
.
setFieldValue
(
"
$field.FORMDEFINITION
"
,
workflow
.
getFormProperties
(
taskId
,
newResult
));
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment