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
6d47c660
Commit
6d47c660
authored
5 years ago
by
Johannes Hörmann
Browse files
Options
Downloads
Patches
Plain Diff
fix person firstname / lastname changes
parent
59c32485
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/Person_entity/recordcontainers/db/onDBInsert.js
+1
-1
1 addition, 1 deletion
entity/Person_entity/recordcontainers/db/onDBInsert.js
entity/Person_entity/recordcontainers/db/onDBUpdate.js
+14
-8
14 additions, 8 deletions
entity/Person_entity/recordcontainers/db/onDBUpdate.js
with
15 additions
and
9 deletions
entity/Person_entity/recordcontainers/db/onDBInsert.js
+
1
−
1
View file @
6d47c660
import
(
"
system.vars
"
);
import
(
"
DataPrivacy_lib
"
);
DataPrivacyUtils
.
notifyNeedDataPrivacyUpdate
(
vars
.
get
(
"
$field.CONTACTID
"
));
\ No newline at end of file
DataPrivacyUtils
.
notifyNeedDataPrivacyUpdate
(
vars
.
get
(
"
$local.uid
"
));
\ No newline at end of file
This diff is collapsed.
Click to expand it.
entity/Person_entity/recordcontainers/db/onDBUpdate.js
+
14
−
8
View file @
6d47c660
import
(
"
system.logging
"
);
import
(
"
DataPrivacy_lib
"
);
import
(
"
system.tools
"
);
import
(
"
system.vars
"
);
...
...
@@ -6,8 +7,10 @@ import("Communication_lib");
import
(
"
Entity_lib
"
);
import
(
"
StandardObject_lib
"
);
var
rowdata
=
vars
.
get
(
"
$local.rowdata
"
);
logging
.
log
(
JSON
.
stringify
(
rowdata
,
null
,
"
\t
"
))
// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer #1030023
var
uid
=
vars
.
get
(
"
$sys.uid
"
)
;
var
uid
=
rowdata
[
"
CONTACT.CONTACTID
"
]
;
FieldChanges
.
assimilateChangeAndDispose
(
"
$field.STANDARD_EMAIL_COMMUNICATION
"
,
function
(
state
,
value
){
CommUtil
.
setStandardMail
(
uid
,
value
);
});
...
...
@@ -16,8 +19,8 @@ FieldChanges.assimilateChangeAndDispose("$field.STANDARD_PHONE_COMMUNICATION", f
CommUtil
.
setStandardPhone
(
uid
,
value
);
});
new
StandardObject
(
"
Address
"
,
vars
.
get
(
"
$field
.ADDRESS_ID
"
)
,
"
Person
"
,
vars
.
get
(
"
$field.CONTACTID
"
)
)
.
onPersonUpdate
(
vars
.
get
(
"
$field
.ORGANISATION_ID
"
)
);
new
StandardObject
(
"
Address
"
,
rowdata
[
"
CONTACT
.ADDRESS_ID
"
]
,
"
Person
"
,
uid
)
.
onPersonUpdate
(
rowdata
[
"
CONTACT
.ORGANISATION_ID
"
]
);
var
updates
=
[];
...
...
@@ -26,12 +29,15 @@ vars.get("$local.changed").forEach(function(fieldName) {
switch
(
fieldName
)
{
case
"
PERSON.FIRSTNAME
"
:
case
"
PERSON.LASTNAME
"
:
var
user
=
tools
.
getUserByAttribute
(
tools
.
CONTACTID
,
[
vars
.
get
(
"
$field.CONTACTID
"
)],
tools
.
PROFILE_FULL
);
user
[
tools
.
PARAMS
][
tools
.
FIRSTNAME
]
=
vars
.
get
(
"
$field.FIRSTNAME
"
);
user
[
tools
.
PARAMS
][
tools
.
LASTNAME
]
=
vars
.
get
(
"
$field.LASTNAME
"
);
tools
.
updateUser
(
user
);
var
user
=
tools
.
getUserByAttribute
(
tools
.
CONTACTID
,
[
uid
],
tools
.
PROFILE_FULL
);
if
(
user
)
{
user
[
tools
.
PARAMS
][
tools
.
FIRSTNAME
]
=
rowdata
[
fieldName
];
user
[
tools
.
PARAMS
][
tools
.
LASTNAME
]
=
rowdata
[
fieldName
];
tools
.
updateUser
(
user
);
}
break
;
}
})
DataPrivacyUtils
.
notifyNeedDataPrivacyUpdate
(
vars
.
get
(
"
$field.CONTACTID
"
));
\ No newline at end of file
DataPrivacyUtils
.
notifyNeedDataPrivacyUpdate
(
uid
);
\ No newline at end of file
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