Prevent existing Account record to be picked as Parent record
The requirement is to prevent the constrcution of circular relation ship between an account making the same record its parent account.
Follow the steps below to implement this requirement:
1. Add the following code to the Account Pick Applet to populate a profile attribute with the rowid corresponding to the current account record in the active busobject.
function WebApplet_Load ()
var id = “”;
var bo = TheApplication().ActiveBusObject();
if (bo.Name() == “Account”)
var bc = bo.GetBusComp(“Account”);
id = bc.GetFieldValue(“Id”);
2. Set the search specification of the pick applet to the following to exclude the current account record from any queries executed in the pick applet:
[Id] <> GetProfileAttr(“AccountPickAppletId”)