web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Assign values to tile via code.

GirishS Profile Picture GirishS 27,825 Moderator

In this blog I will explain about assigning the aggregate values to tiles via code. If you want to show a count, we can go for tiles. But in some cases, we want to show aggregate values in tiles. We can go for KPI. In most of the scenario we want to update the value of the tiles based on the parameters specified.  So instead of KPI we can achieve that with tiles itself.

  1. Create a new tile from the project – Set the menu item name property – Set the type to count.
  2. Now you create a new tile button on the form where you want to display the tiles. – Map the created tiles from step 1. Set the text property to some meaningful value which will be displayed in the front end.
  3. Now expand the tiles button >> methods >> Override getData method. Method will look like below. Just use the strTitleData method to set the values to tiles. You can simply add select statement based on the parameter values to get the aggregate values.

             

public TileButtonControlData getData()
{
   TileButtonControlData ret;
            
   ret = super();
   ret.strTileData(any2Str(10.20));
                       
   return ret;
}

         4. Now build the project and run the form. You will be able to see the values in the tiles.

         5.But one issue will be there. Upon changing of the parameters tile values will get updated after manually clicking refresh button on the form. To overcome this issue, we need to manually call the refresh task              method. Like below. Calling this task method will depends on your scenario.

            

#Task
element.task(#taskRefresh);

Thanks,

Comments

*This post is locked for comments