web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Find Root Caller Form

Viral Suthar Profile Picture Viral Suthar 279

Recently I faced the situation where I want the root caller form name from the ladder of forms opened one after one, from each other. And for that I didn’t find any solution on internet so mind clicked and made one solution for that. Hope it’s useful...

We have FORM-A and FORM-B, FORM-A is root form means FORM-B is opened from FORM-A, and FORM-B opened FORM-B again and again…

In above scenario, if we need the root caller name then we have to implement the below logic…

1)      You have to make one parm method in the FORM-B for caller form like below…

IdentifierName parmCallerName(IdentifierName  _callerName = callerName)
{
   // please declare ‘callerName’ variable in the class declaration of type ‘Identifier Name’ other wise it give error here..
    callerName = _callerName;
    return callerName;
}

 2)      Now add below logic into the init method of FORM-B

if (element.args().caller() && element.args().caller().name() == formStr(A))
{
        this.parmCallerName(element.args().caller().name());
 }
 else if(element.args().caller() && element.args().caller().name() == formStr(B))
 {
        formRunCaller = element.args().caller();
        this.parmCallerName(formRunCaller.parmCallerName());
 }

So now every time you use that parm method of FORM-B in this scenario, you can get the root caller form name..

Enjoy...

This was originally posted here.

Comments

*This post is locked for comments