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
Admin message
Gitlab Maintenance 11.04.2025 | 20:00 - 23:00 MEZ
Show more breadcrumbs
xrm
basic
Commits
d153c863
Commit
d153c863
authored
5 years ago
by
Johannes Hörmann
Browse files
Options
Downloads
Patches
Plain Diff
fix data alias querry
parent
29a2debd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js
+26
-26
26 additions, 26 deletions
...finition/Data_alias/indexsearchgroups/salesorder/query.js
with
26 additions
and
26 deletions
aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js
+
26
−
26
View file @
d153c863
import
(
"
system.SQLTYPES
"
);
import
(
"
system.result
"
);
import
(
"
system.vars
"
);
import
(
"
system.calendars
"
);
import
(
"
system.db
"
);
import
(
"
Sql_lib
"
);
import
(
"
Keyword_lib
"
);
import
(
"
KeywordRegistry_basic
"
);
var
sqlQuery
,
sqlHelper
,
queryCondition
,
affectedIds
;
queryCondition
=
""
;
if
(
vars
.
exists
(
"
$local.idvalue
"
))
{
affectedIds
=
vars
.
get
(
"
$local.idvalue
"
);
queryCondition
=
"
where
OFF
ERID in ('
"
+
affectedIds
.
map
(
function
(
v
){
return
db
.
quote
(
v
);}).
join
(
"
', '
"
)
+
"
')
"
;
//TODO: refactor this for incremental indexer (injections?)
}
sqlHelper
=
new
SqlMaskingUtils
();
sqlQuery
=
"
select SALESORDERID,
"
+
sqlHelper
.
concat
([
sqlHelper
.
cast
(
"
SALESORDERCODE
"
,
SQLTYPES
.
CHAR
,
10
),
KeywordUtils
.
getResolvedTitleSqlPart
(
$KeywordRegistry
.
salesorderState
(),
"
SALESORDER.STATUS
"
)],
"
|
"
)
+
"
as TITLECOLUMN,
"
+
sqlHelper
.
concat
([
"
ORGANISATION.NAME
"
],
"
|
"
)
+
"
as DESCCOLUMN, SALESORDERCODE, ORGANISATION.NAME, CUSTOMERCODE
"
+
"
from SALESORDER
"
+
"
join CONTACT on SALESORDER.CONTACT_ID = CONTACTID
"
+
"
join ORGANISATION on ORGANISATIONID = CONTACT.ORGANISATION_ID
"
+
queryCondition
+
"
order by SALESORDERCODE
"
;
import
(
"
system.SQLTYPES
"
);
import
(
"
system.result
"
);
import
(
"
system.vars
"
);
import
(
"
system.calendars
"
);
import
(
"
system.db
"
);
import
(
"
Sql_lib
"
);
import
(
"
Keyword_lib
"
);
import
(
"
KeywordRegistry_basic
"
);
var
sqlQuery
,
sqlHelper
,
queryCondition
,
affectedIds
;
queryCondition
=
""
;
if
(
vars
.
exists
(
"
$local.idvalue
"
))
{
affectedIds
=
vars
.
get
(
"
$local.idvalue
"
);
queryCondition
=
"
where
SALESORD
ERID in ('
"
+
affectedIds
.
map
(
function
(
v
){
return
db
.
quote
(
v
);}).
join
(
"
', '
"
)
+
"
')
"
;
//TODO: refactor this for incremental indexer (injections?)
}
sqlHelper
=
new
SqlMaskingUtils
();
sqlQuery
=
"
select SALESORDERID,
"
+
sqlHelper
.
concat
([
sqlHelper
.
cast
(
"
SALESORDERCODE
"
,
SQLTYPES
.
CHAR
,
10
),
KeywordUtils
.
getResolvedTitleSqlPart
(
$KeywordRegistry
.
salesorderState
(),
"
SALESORDER.STATUS
"
)],
"
|
"
)
+
"
as TITLECOLUMN,
"
+
sqlHelper
.
concat
([
"
ORGANISATION.NAME
"
],
"
|
"
)
+
"
as DESCCOLUMN, SALESORDERCODE, ORGANISATION.NAME, CUSTOMERCODE
"
+
"
from SALESORDER
"
+
"
join CONTACT on SALESORDER.CONTACT_ID = CONTACTID
"
+
"
join ORGANISATION on ORGANISATIONID = CONTACT.ORGANISATION_ID
"
+
queryCondition
+
"
order by SALESORDERCODE
"
;
result
.
string
(
sqlQuery
);
\ 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