Start a topic
With the exception of Windchill, The PTC Community is on read-only status until April 6 in preparation for moving our community to a new platform. Learn more here
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

Handling Sql server table rows using Thingworx

KV_14501161
2-Explorer

Handling Sql server table rows using Thingworx

  1. How to display all rows in mashup. It displays only 500 rows.

Eg :- A mashup grid displays rows from SQL Server, It displays only 500 rows.

 

     2. How to work on access on buttons in mashup.

Eg :- A button should visible for only few users.

 

2 REPLIES 2

1. You set maxRows to some high value. default is 500

 
 

sql_service.png

2. You create a service like "CanUserSeeButton" and it checks if the current user has specific UserGroup he needs to have, returns true/false which you bind on button visibility. To get current user you can use snippet.

currentUser.png

To get his groups check https://community.ptc.com/t5/ThingWorx-Developers/How-to-Find-all-User-Groups-for-a-Given-User/m-p/1038382 

Or you only check for specific usernames - but a group would be easier to handle on the long run

Rocko
19-Tanzanite
(To:nmutter)

Just two comments:

1) Setting maxRows to a high value means all rows are pulled from the table, which can result in  high server load and long waiting times for the user.

If the number of rows in the table is not under your control, you probably want to implement paging. Thingworx Help Center and Support knowledgebase have information about this.

2) Making the button visible/enabled only for some users does not mean they can't call the service launched by the button. They could still launch a REST service directly. Which means you have to assign the correct privileges to that service as well.

Announcements


Top Tags