Dynamic Business Object Events


Author
Message
Alex Luyando
Alex Luyando
StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)
Group: StrataFrame Users
Posts: 112, Visits: 1.2K
Hi all -



This is my first foray into Dynamic Business Object Events, so this may be a basic question...Reading the postings here and the SF Help they look very useful, so I want to understand them fully.



I created a Property Changing Event for one of my BOs (single event for all) and expected to see the FieldPropertyChanging event in my BO. Instead, I find FieldPropertyChanging only on the instance of the BO dropped onto a form. Not good, since I wanted to introduce behavior at the BO level that would be available to any form using it.



What am I missing?



TIA!

________________
_____/ Regards,
____/ al
Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Ya learn something every day. Didn't know that about events.



On the red X in BOM, you are correct about just ignoring them. There has been at least one enhancement request to somehow be able mark BO that aren't ever going to be mapped (like you will have and also base BOs). I'm hoping this request happens soon. BigGrin



As to how to update your forms that are using the "first line BO" and now need to use the "second line BO", I think the easiest would be to directly update the designer file of the forms. Do a search and replace on the "first line BO" type, replacing with the "second line BO" type. I.e. the BO will have the same name, the bindings will still be valid, event handlers will still be valid, etc. you are just changing the type of that BO. I do this frequently in just this sort of situation: were I've subclassed some control or BO and now need to use the new one.
Alex Luyando
Alex Luyando
StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)
Group: StrataFrame Users
Posts: 112, Visits: 1.2K
Greg McGuffey (05/01/2009)
There has been at least one enhancement request to somehow be able mark BO that aren't ever going to be mapped (like you will have and also base BOs). I'm hoping this request happens soon. :


Yeah, I can really see that being desirable. I am not a big fan of having to be able to distinguish "good" red Xs from "bad" red Xs. Don't want to offend anybody, but they all look alike to me! Smile I'd definitely vote YES to that request!



Greg McGuffey (05/01/2009)
As to how to update your forms that are using the "first line BO" and now need to use the "second line BO", I think the easiest would be to directly update the designer file of the forms. Do a search and replace on the "first line BO" type, replacing with the "second line BO" type. I.e. the BO will have the same name, the bindings will still be valid, event handlers will still be valid, etc. you are just changing the type of that BO. I do this frequently in just this sort of situation: were I've subclassed some control or BO and now need to use the new one.


Funny... I was thinking along the same lines. I am relatively new to .NET and have been told the designer files are off limits; you just don't touch them unless you want to trigger a plague somewhere. That said, I come from a Visual FoxPro background and it's just not uncommon to do lots of hacking "behind the scenes" to get things done quicker and more effectively.

_____________________________________________________

Appreciate the insight and suggestions, Greg!

________________
_____/ Regards,
____/ al
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Alex Luyando (05/01/2009)
[quote][b]I come from a Visual FoxPro background and it's just not uncommon to do lots of hacking "behind the scenes" to get things done quicker and more effectively.


Hi Alex,

Don't worry, just make a backup of the 3 files in case something goes wrong. I do this all the time and the Find/Replace feature in the VS IDE is much more powerful than the one in VFP IDE. I just used it to replace all references in 2 forms (parent/child) which the whole table design changed completely and I did not want to re-do all the logic in both forms, I am using a listview with several fields in both forms and at the end the form worked just fine. I suggest you do this one step at a time so you don't loose track of what is being replaced, and don't use "Replace All" Hehe

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
As an alternate to doing a copy, just make sure you've committed the form to source control before making the changes. They you just need to do a revert in case of a problem.



A really important thing to understand about designer files is that they aren't magic. They do nothing you couldn't do yourself. In fact, there's nothing you can do in VS that you can't do in Notepad. However, if you used notepad, it wouldn't be much fun (no designers, no declarative programming using property sheets, no visual form building...). Blink



Of course you can break things such that VS can't open them in a designer, but since VS often breaks things so they can't be opened in a designer, you'll likely need to start getting comfortable opening the designer files anyway!



I also second not using Replace All. Every time I've done that, I ended up breaking something, either because there was some match that wasn't appropriate or because I intended to replace all in the current file, but had entire solution selected. Ermm
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