Clearing an attribute?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Rem
Posts: 216
Joined: Wed Oct 03, 2007 8:58 am
Location: Sweden
Contact:

Clearing an attribute?

Post by Rem »

Anyone knows how to clear an attribute from it´s value?

If I set it to 0 it will be 0 and also if I set it to '' it will be 0 (zero).

But how do I get it blank, as it is before anything is written to it?

/Rem
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Rem,

If you are doing it via rule use:

SomeBO.SomeAttribute=UNDEFINED

Tom
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

oops -- I think the syntax might actually be IS UNDEFINED rather than =UNDEFINED.

Tom
Rem
Posts: 216
Joined: Wed Oct 03, 2007 8:58 am
Location: Sweden
Contact:

Post by Rem »

This doesn´t seem to work either.

It seems as UNDEFINED is used more for checking than for assigning. If I use it, it still is 0.

I also tried to assign it = another attribute wich was unassigned (blank) but it still ended up as 0.

Strange..

/Rem
christopherb
Posts: 304
Joined: Fri Jun 22, 2007 8:26 pm

Post by christopherb »

Rem,
Curious why would you wish an interger to be blank as to zero?


Chris
Rem
Posts: 216
Joined: Wed Oct 03, 2007 8:58 am
Location: Sweden
Contact:

Post by Rem »

Ahh, thougt someone might ask.

It easy, I want it blank in a printout report. If there is a lot of 0:s everywhere it´s much easier to miss out a little change. But if usually is blank a number showing up would be hard to miss.

And in this case we are talking about a basis for invoycing and we don´t won´t to miss out on that :D !

/Rem
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Rem,
There may be easier ways to do it, but a couple of things come to mind:

1- Have a report element be conditional -- if the attribute is greater than zero, show the number -- otherwise show blank

2- Have a second attribute in your BO that is for report purposes. Have a rule set the second attribute something like this:
BO.TextAttribute=AS_STRING(BO.NumberAttribute)

You may have to use a conditional rule that sets BO.TextAttribute to a blank if BO.NumberAttribute is zero.

Tom
Post Reply