Sorry, I don't understand. By definition the records you will process in your trigger will be only the ones inserted, updated or deleted in the context of the user's current session.
nope,
SFDC will not lock a record from being updated. Could you explain what
you're trying to track?
If you trying to stop a record from being processed by recursive triggers you
can look into using a class with static collections to track what IDs
have been processed previously, each static member will be there for the life
of the thread running the triggers.
Actually Salesforce does lock records from simultaneous updates. Also, if you're writing Apex you can do a SELECT FOR UPDATE, which will lock those records for the duration of the Apex method or trigger.
- User A Opens record for viewing - User B Opens record for viewing - User A Changes field X and saves - User B Changes field Y and saves
Changes on X will be lost.
I guess you could write a nice VF page that displays the order items for the users that could help you control a soft lock type fucntion but i havent really thought about this to much as i havent had anyone ask for it yet :)
Ah, i just re-read the whole post again, is the process that looks at the order lines a person, APEX thread or external application? I have a couple of ideas of how you could control access to line items but they all depend on whats looking at it.
Got ya, so you need a really transparent way of marking
which line items are currently being worked upon.
I can think of options but it’s pretty difficult without
knowing your business processes and how the user will interact with the system.
You could have a VF page that has buttons along the side of
all items that haven’t been picked yet and are not currently being picked.
Once the user pushes the button it soft locks the record and
any other user that loads the page after this action will not be able to select
the item for picking.
If a user has already had the page loaded and tries to
select an item for picking that has been selected by another user since the
page loaded, you can raise a visual warning and reload the page which will give
the user all of the current items that need picking.
Yeah i think there are a few options for you, a number prefixed by the User ID so you can quickly find out who is picking the item. Maybe, using a pool counter and a tracking object which would allow you to do analytics on how many lines are being picked per person etc etc.
nope, SFDC will not lock a record from being updated. Could you explain what you're trying to track?
If you trying to stop a record from being processed by recursive triggers you can look into using a class with static collections to track what IDs have been processed previously, each static member will be there for the life of the thread running the triggers.
Ah, i was thinking more along the lines of:
- User A Opens record for viewing
- User B Opens record for viewing
- User A Changes field X and saves
- User B Changes field Y and saves
Changes on X will be lost.
I guess you could write a nice VF page that displays the order items for the users that could help you control a soft lock type fucntion but i havent really thought about this to much as i havent had anyone ask for it yet :)
Ah, i just re-read the whole post again, is the process that looks at the order lines a person, APEX thread or external application? I have a couple of ideas of how you could control access to line items but they all depend on whats looking at it.
Got ya, so you need a really transparent way of marking which line items are currently being worked upon.
I can think of options but it’s pretty difficult without knowing your business processes and how the user will interact with the system.
You could have a VF page that has buttons along the side of all items that haven’t been picked yet and are not currently being picked.
Once the user pushes the button it soft locks the record and any other user that loads the page after this action will not be able to select the item for picking.
If a user has already had the page loaded and tries to select an item for picking that has been selected by another user since the page loaded, you can raise a visual warning and reload the page which will give the user all of the current items that need picking.
Thanks for the idea. Instead of session id - a random number will also work.
I guess there are ways to achieve it....
Good luck with it!