0

I found this code, which worked well IN SHAREABLE EDIT:

// Attribute DXL for locked objects
if (isLockedByUser(obj))
{
obj.attrDXLName = "LOCKED"
}

and added:

else
{
obj.attrDXLName = "unlocked"
}

but the else condition doesn't work (the if part functions the same). What am I missing? First time coding in DXL, but I have C experience. EDIT: I figured out the else condition probably can't be updated in an unlocked item, so it will never appear.

The remaining question is, Why doesn't it work for Exclusive Edit? Should I check the module for isLockedByUser, instead, because it's locked at that level?

// Attribute DXL for locked objects
if (isLockedByUser(obj) or isLockedByUser(current))
{
obj.attrDXLName = "LOCKED"
}

... which doesn't work, either. Again, it works for Shareable Edit, but not for Exclusive Edit.

Suggestions on how to get this field to work for Exclusive Edit?

1 Answer 1

0

In the DXL Reference Manual (Chapter 36: General Functions > Locking) for isLockedByUser, here's how it is described:

bool isLockedByUser(Object o)

Returns true if the specified object is locked by the current user when in edit shareable mode. Otherwise, returns false.

This function is not equivalent to checking whether the current user can modify the given object.

My guess (I haven't dealt with locking via DXL myself) is that isLockedByUser only has meaning when the module is in shared edit mode, so you might have to find another way to do what you're trying to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.