Nicolas,

I end up implementing something very similar.  What I end up doing was
create the lock when the record was modified (using the WRITE method on
the form datasource - purchLine).  When the user left the record (using
the LEAVE method on the form datasource - purchTable) the lock was
removed.

Each time a user tries to modify the purchase order, it checks if a lock
is in place.  To handle unknown situations better, I recheck that the
user with the lock is still logged on.

The requirement I was given was to allow only one person to modify, but
other need to be able to view at the same time.  This was done by
modifying the ACTIVE method on the form datasource - purchTable.  The
code I used for this is:

    if (PurchTable::isLocked(PurchTable.PurchId)) {
        LockActive          = true;
    } else {
        LockActive          = false;
    }
    purchLine_ds.allowEdit(! LockActive);
    purchTable_ds.allowEdit(! LockActive);


Hopefully this gives you a starting point.


Barry.



-----Original Message-----
From: development-axapta@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of
nicolas_dumont_toulouse
Sent: Tuesday, 28 February 2006 9:22 PM
To: development-axapta@yahoogroups.com
Subject: [development-axapta] Lock a purchase order for another buyer

Hi everybody,
I have to modify the purchaseTable form to automatically lock it for
others users the purchase order that is currently viewed by the user.

So I have looked at the others forms which have this system of
locking such like the inventJournalTable form which has the
sessionid, sessionlogintime, sessionid fields about the user who have
blocked the record.

But I still can't figure out how I can program this kind of locking
mechanism. The purchaseOrder have to be locked  when the user select
it in the gridview or by using the prev/next arrows.

My company don't want that 2 buyers can modify the same purchase
order in the same time without be warned.

Have you any clues?

Thanks by advance.

Nicolas Dumont










Yahoo! Groups Links











SPONSORED LINKS
Computer part Programming languages Microsoft axapta
Support exchange


YAHOO! GROUPS LINKS




Reply via email to