User A starts a stepper for authoring a car and changes color from red to black. However, the user does not finish the edit. Instead it is saved until later.
Meanwhile User B opens the same record in the same stepper and changes the color from red to grey and saves the data (completes the stepper)
When User A returns, he/she can happily complete the stepper. The GD value is changed to black without any error, notice or warning that someone else has updated the information in between.
Of course we could setup some kind of workaround that copies e.g. the load id from the originating golden record and then we create a validator for this, but we would of course want to avoid adding a custom solution like this for every workflow and stepper.
(these are all basic entities)
Best Answer
S
Subham Dixit
said
over 1 year ago
There is an existing enhancement request 'Display concurrent change indicator in browsing' in which you can mention the customer that is asking for this.
The workaround you mention is a good one.
Another way to do this is to add an indicator to show that the record is currently being edited.
It will call a custom procedure like this:
/* Return a comma separated list of users that are currently editing this record */
/* PostgreSQL */
create or replace function usr_get_change_indicator(p_id numeric)
RETURNS text
LANGUAGE plpgsql
AS $function$
declare
ret text;
begin
select string_agg( b.b_loadcreator || ' (' || b.b_loadid || ')', ', ' order by b.b_loadid ) into ret
from
sa_my_entity me
inner join dl_batch b on b.b_loadid = me.b_loadid
where me.id = p_id
and b.b_status = 'RUNNING';
return ret;
end
$function$
;
/* Oracle equivalent */
select LISTAGG(D.B_LOADCREATOR || ' (' || D.B_LOADID || ')' , ', ') within group (order by D.B_LOADID)
from
SA_PRODUCT P
inner join DL_BATCH D on P.B_LOADID = D.B_LOADID
where P.ID = &p_id
and D.B_STATUS = 'RUNNING';
It displays in a collection column where the id of the record being changed is passed to the procedure, so the indicator can warn that the record is being edited by another user.
Note: displaying this in the collection is sufficient for many use cases. But you can got a step further and add a Condition on the Edit Action Configuration using a call to the same function to really prevent a second user from editing the record.
There is an existing enhancement request 'Display concurrent change indicator in browsing' in which you can mention the customer that is asking for this.
The workaround you mention is a good one.
Another way to do this is to add an indicator to show that the record is currently being edited.
It will call a custom procedure like this:
/* Return a comma separated list of users that are currently editing this record */
/* PostgreSQL */
create or replace function usr_get_change_indicator(p_id numeric)
RETURNS text
LANGUAGE plpgsql
AS $function$
declare
ret text;
begin
select string_agg( b.b_loadcreator || ' (' || b.b_loadid || ')', ', ' order by b.b_loadid ) into ret
from
sa_my_entity me
inner join dl_batch b on b.b_loadid = me.b_loadid
where me.id = p_id
and b.b_status = 'RUNNING';
return ret;
end
$function$
;
/* Oracle equivalent */
select LISTAGG(D.B_LOADCREATOR || ' (' || D.B_LOADID || ')' , ', ') within group (order by D.B_LOADID)
from
SA_PRODUCT P
inner join DL_BATCH D on P.B_LOADID = D.B_LOADID
where P.ID = &p_id
and D.B_STATUS = 'RUNNING';
It displays in a collection column where the id of the record being changed is passed to the procedure, so the indicator can warn that the record is being edited by another user.
Note: displaying this in the collection is sufficient for many use cases. But you can got a step further and add a Condition on the Edit Action Configuration using a call to the same function to really prevent a second user from editing the record.
S
Sebastian.agnvall
said
4 months ago
Hi Subham.
Is it possible to achieve the same result presented above but with the new data-driven workflows? Per my understanding workflow executions are not stored in the dl_batch and sa_ tables so I guess that the data needs top be retrieved somewhere else.
S
Subham Dixit
said
4 months ago
Hello Sebastian,
I have seen that the new gen workflow executions are stored in DL_BATCH but not in the sa_tables, so it might not possible in the new gen workflows.
Subham Dixit
Consider the follow scenario:
User A starts a stepper for authoring a car and changes color from red to black. However, the user does not finish the edit. Instead it is saved until later.
Meanwhile User B opens the same record in the same stepper and changes the color from red to grey and saves the data (completes the stepper)
When User A returns, he/she can happily complete the stepper. The GD value is changed to black without any error, notice or warning that someone else has updated the information in between.
Of course we could setup some kind of workaround that copies e.g. the load id from the originating golden record and then we create a validator for this, but we would of course want to avoid adding a custom solution like this for every workflow and stepper.
(these are all basic entities)
There is an existing enhancement request 'Display concurrent change indicator in browsing' in which you can mention the customer that is asking for this.
The workaround you mention is a good one.
Another way to do this is to add an indicator to show that the record is currently being edited.
It will call a custom procedure like this:
It displays in a collection column where the id of the record being changed is passed to the procedure, so the indicator can warn that the record is being edited by another user.
Note: displaying this in the collection is sufficient for many use cases. But you can got a step further and add a
Condition
on theEdit Action Configuration
using a call to the same function to really prevent a second user from editing the record.- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstSubham Dixit
There is an existing enhancement request 'Display concurrent change indicator in browsing' in which you can mention the customer that is asking for this.
The workaround you mention is a good one.
Another way to do this is to add an indicator to show that the record is currently being edited.
It will call a custom procedure like this:
It displays in a collection column where the id of the record being changed is passed to the procedure, so the indicator can warn that the record is being edited by another user.
Note: displaying this in the collection is sufficient for many use cases. But you can got a step further and add a
Condition
on theEdit Action Configuration
using a call to the same function to really prevent a second user from editing the record.Sebastian.agnvall
Hi Subham.
Is it possible to achieve the same result presented above but with the new data-driven workflows? Per my understanding workflow executions are not stored in the dl_batch and sa_ tables so I guess that the data needs top be retrieved somewhere else.
Subham Dixit
Hello Sebastian,
I have seen that the new gen workflow executions are stored in DL_BATCH but not in the sa_tables, so it might not possible in the new gen workflows.
Thanks
-
Extend a model with new entities or attributes
-
Data types in xDM
-
Effective date on entities
-
Search using wild cards
-
Export a model from production and import on a development environment
-
"Allow Delete" vs "Allow Removal" privileges
-
LOV label in Named Query
-
Select location on a map and save coordinates
-
Is there a way to set up a master-detail relationship on browse mode?
-
Choose Either a Stepper or A Workflow Based on The User Privileges
See all 215 topics