getting the form name that called the BO


Author
Message
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)
Group: Forum Members
Posts: 153, Visits: 462
How do I get a reference to the form or process that called the BO from inside the BO? IE... 1 BO can be called from many forms. I want to insert logic in the BO that requires knowing where the BO was called from. Also, I do not want to have to pass a parameter to the BO for this. somethong like this.bo.parent....
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Ross.

Inside the BO, you will get it using Me.ParentForm
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)
Group: Forum Members
Posts: 153, Visits: 462
I need to get the name of the  Me.ParentForm and save it to a string. How would I get this value? The is no such property as Me.ParentForm.Name
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
That is strange, Ross. I get it here just fine.

Would you mind posting a sample of your code and tell us where you are coding it?
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)
Group: Forum Members
Posts: 153, Visits: 462
tblActivityLog.ActivityLog_Source = this.ParentForm;

 

Gets "cannot implicitly convert type 'MicroFour.StrataFrame.UI.Windows.Forms.BaseForm' to 'string'

Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)StrataFrame User (197 reputation)
Group: Forum Members
Posts: 153, Visits: 462
Got it, here is what is needed:

tblActivityLog.ActivityLog_Source = this.ParentContainer.ToString();

 

 

 


Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)Strategic Support Team Member (3.6K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Glad you got it working.

But are you sure that this:

tblActivityLog.ActivityLog_Source = this.ParentForm.Name;


wouldn't get you the desired results?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search