BusinessObjects Board

Delete an object

Now that I have done this all day :hb: , is there a way in VB SDK to delete an object within a data provider, based off of some condition, before the report refreshes :confused:

Little background, I have some objects that contains @prompts, and based off of some condition prior to me overriding those prompts using VB SDK, I might want to just delete the object that contains the @prompt. Can I do this? Or can I just disable that object before the refresh?
:crazy_face:


Barry D. Beaton :us: (BOB member since 2002-07-19)

[quote:486aa78d9d=“Barry D. Beaton”]Now that I have done this all day :hb: , is there a way in VB SDK to delete an object within a data provider, based off of some condition, before the report refreshes :confused:

Little background, I have some objects that contains @prompts, and based off of some condition prior to me overriding those prompts using VB SDK, I might want to just delete the object that contains the @prompt. Can I do this? Or can I just disable that object before the refresh?
:crazy_face:
[/quote]

You would have to loop through the result objects and/or condition objects to search for the specific class name & object name, but it’s possible to delete objects on the fly. Sounds rather brute force, but yes it’s possible.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

OK, I think I get it, but I am stuck again, :wah:

I created a simple report with two objects. I want to “loop through” and after finding the one (How?) I want to delete, delete it, then continue with the report refresh.

Can anyone push me in the right direction a little more. :?:


Barry D. Beaton :us: (BOB member since 2002-07-19)

[quote:fbcad71ec6=“Barry D. Beaton”]Can anyone push me in the right direction a little more. :?:
[/quote]

Try looking at the code in this utility. It’s a utility that copies data providers, so by definition it goes through each and every portion of a data provider. You should be able to get some pretty good ideas from it.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Thanks Dwayne, I found what I was looking for in the code you referred me to.


 For k = 1 To QueryFrom.Results.Count
      Set ResultFrom = QueryFrom.Results(k)
      Set ResultTo = QueryTo.Results.Add(ResultFrom.Class, ResultFrom.Object)
 Next k

Now I can “loop through the result objects and/or condition objects to search for the specific class name & object name”.

Thanks for the push. :wave:


Barry D. Beaton :us: (BOB member since 2002-07-19)

[quote:e53b265c9b=“Barry D. Beaton”]Now I can “loop through the result objects and/or condition objects to search for the specific class name & object name”.

Thanks for the push. :wave:
[/quote]

It was probably a bit like a scavenger hunt, but I’m glad you found what you were looking for.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

A “scavenger hunt” it was :crazy_face: but once I found it, it really helped me to better understand the result and condition objects. :rotf: Thanks


Barry D. Beaton :us: (BOB member since 2002-07-19)

[quote:6451a97986=“Barry D. Beaton”]A “scavenger hunt” it was :crazy_face: but once I found it, it really helped me to better understand the result and condition objects. :rotf: Thanks
[/quote]

Exellent … the “teach a man to fish” principle alive and well.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)