Add a coloured Tick/Cross or Icon when field is Approved/Retjected

I have a button for the user to approved a document. Once the button is selected it populates three fields: Status, Approved By, Date.

I have been asked if when the Status field is populated as Approved or Rejected that it also displayes a coloured eg. Tick, Cross, Coloured Dot? on the form. Also would like it to be displayed in a view/column.

Approval Button:

tmpYesNo := @Prompt([YesNo]; “Approve Adjustment”; “Do you want to approve this adjustment?”);

@If( tmpYesNo = 1 ; @Success ;

     @Return( @Prompt([Ok]; "@Return" ;"This adjustment has not been approved.") ) );

FIELD L1Status := “Approved”;

FIELD L1ApprovalDate := @Today ;

FIELD L1ApprovedBy := @Name([CN] ; @UserName) ;

Is this possible??

Subject: Possible and easy

For the view, create a column, set it as 'display values as icon’Give it a formula like ;

tick:=82;

cross:=81;

@if( ;tick ;cross)

If you need more icons, search the help for ‘column icons’

In the form, create a multi cell table

In each cell put the immge you want

Use ‘hide when’ formulas to show the right image

If you want the images to match the column icons, they can be found in …\Data\domino\icons

Import the ones you want as image resources

Subject: Not having much luck

Thank you both for you reponses, I’m having trouble with these.

Icon in View/Column.

I have been trying different combinations but just can’t get it right.

tick:=82;

cross:=81;

Approved:= tick;

Rejected:= cross;

@If (L1Status =“Approved” : “Rejected” ; tick ; cross)

The icon column displays a ‘Tick’ for both Approved and Rejected and a ‘Cross’ for the documents that should be blank??

Display icon on form.

I have copied two icons into resources/images

icon_tick.gif

icon_cross.gif

If the field ‘L1Status’ equals

Approved then tick should display

Rejected then cross should display

Field has no value then both icons should not be displayed.

Do you hide the icons by using a formula in the Picture Properies?? and how.

Subject: Your code is doing what it is told.

Icon in View/Column.>I have been trying different combinations but

just can’t get it right.

tick:=82;

cross:=81;

Approved:= tick;

Rejected:= cross;

@If (L1Status =“Approved” : “Rejected” ; tick ; cross)

The icon column displays a ‘Tick’ for both

Approved and Rejected and a ‘Cross’ for the

documents that should be blank??

Yes, because that is what your formula tell it to do. The @If statement you wrote says that if L1Status has a value that is in the list of values that you specify (which are “Approved”:“Rejected”), it should display the number specified in the variable ‘tick’, otherwise the value in ‘cross’.

The 3rd and 4th line of code is not even used.

I would write it like this:

@If(

L1Status=“Approved”; 82;

L1Status=“Rejected”; 81;

“” )

Or if you want to display the image resources instead:

@If(

L1Status=“Approved”; “icon_tick.gif”;

L1Status=“Rejected”; “icon_cross.gif”;

“” )

Display icon on form.

I have copied two icons into resources/images

icon_tick.gif

icon_cross.gif

If the field ‘L1Status’ equals

Approved then tick should display

Rejected then cross should display

Field has no value then both icons should not

be displayed.

Do you hide the icons by using a formula in

the Picture Properies?? and how.

You can do this two different ways.

The easiest might be to insert both images (in separate paragraphs), then use hide-when to hide/display them. You just select the paragraph and set the formula.

The other way is to create an image resource (you can insert any of the images). Then go to the picture properties and set teh source using a formula, just like the one above.

Subject: Thanks again for all your help.

Subject: Or use image resources…

You can also use GIF files imported as image resources for column icons:

tick:=“icon_tick.gif”;

cross:=“icon_cross.gif”;

@if( ;tick ;cross)

I use the FamFamFam Silk icons for many of my icons, they have some bullets/small icons that work well in columns, or you can shrink/edit some of the larger icons to 16x16 pixel and use them that way.

I blogged about those icons here just a few days ago: http://planetlotus.org/a68628