add/delete option for new office locations

Hi there. 

I'm creating a mobile app that so far tracks your current location and tells you the nearest office locations to you from the database.


What I need to do now which I'm struggling with is add an option INSIDE the app which lets you add new office locations and delete existing office locations? 

How would I do this? Any advice appreciated

You have the Location Plugin on the forge (https://www.outsystems.com/forge/component/1395/location-plugin/) It was developed by OutSystems, so it does have the OutSystems' seal of approval and it is supported by OutSystems as well. 

I'm not a 100% sure if it already has out of the box logic to retrieve the nearest location, but it shouldn't be too hard to develop that logic if need be.

You can also use the coordinates of the places and use simple trigonometry 

Tiago Mota wrote:

You have the Location Plugin on the forge (https://www.outsystems.com/forge/component/1395/location-plugin/) It was developed by OutSystems, so it does have the OutSystems' seal of approval and it is supported by OutSystems as well. 

I'm not a 100% sure if it already has out of the box logic to retrieve the nearest location, but it shouldn't be too hard to develop that logic if need be.

You can also use the coordinates of the places and use simple trigonometry 

That's not what I asked sorry if i wasn't clear, I asked this: What I need to do now which I'm struggling with is add an option INSIDE the app which lets you add new office locations and delete existing office locations? 


Hi Shaan,

Correct me if i'm understanding the issue wrong, you want to know like what approach needs to be followed to implement the add/delete action for locations.

For this, you can use Roles and assign them to specific users and then they will only have access to add/delete the location.

Regards,

LK

Lakshmi Kumar Yadav wrote:

Hi Shaan,

Correct me if i'm understanding the issue wrong, you want to know like what approach needs to be followed to implement the add/delete action for locations.

For this, you can use Roles and assign them to specific users and then they will only have access to add/delete the location.

Regards,

LK

Hi Lakshmi thank you for the reply

In reference to this line:

 "then they will only have access to add/delete the location."

Do you mean that they will be able to add/delete a location INSIDE the mobile application after they've logged in?????

If the answer is yes to that question then can you please give me a step by step guide on how to do this I would really appreciate this. Thanks

Shaan Rashid wrote:

Lakshmi Kumar Yadav wrote:

Hi Shaan,

Correct me if i'm understanding the issue wrong, you want to know like what approach needs to be followed to implement the add/delete action for locations.

For this, you can use Roles and assign them to specific users and then they will only have access to add/delete the location.

Regards,

LK

Hi Lakshmi thank you for the reply

In reference to this line:

 "then they will only have access to add/delete the location."

Do you mean that they will be able to add/delete a location INSIDE the mobile application after they've logged in?????

If the answer is yes to that question then can you please give me a step by step guide on how to do this I would really appreciate this. Thanks

"then they will only have access to add/delete the location." means those users will see the "add/delete" action and rest of the users which do not have role will not have rights to perform "add/delete" action.


Thanks,

LK


Lakshmi Kumar Yadav wrote:

Shaan Rashid wrote:

Lakshmi Kumar Yadav wrote:

Hi Shaan,

Correct me if i'm understanding the issue wrong, you want to know like what approach needs to be followed to implement the add/delete action for locations.

For this, you can use Roles and assign them to specific users and then they will only have access to add/delete the location.

Regards,

LK

Hi Lakshmi thank you for the reply

In reference to this line:

 "then they will only have access to add/delete the location."

Do you mean that they will be able to add/delete a location INSIDE the mobile application after they've logged in?????

If the answer is yes to that question then can you please give me a step by step guide on how to do this I would really appreciate this. Thanks

"then they will only have access to add/delete the location." means those users will see the "add/delete" action and rest of the users which do not have role will not have rights to perform "add/delete" action.


Thanks,

LK


How do I do this? Can you please give me a step by step guide on how to do this I would really appreciate this. Thanks


Hi Shaan,

To create a custom Role, do the following:

  1. Go to the Logic tab.
  2. Right-click the Roles folder and select the Add Role option.
  3. Set the Name of your Role and the remaining information.

More details on roles can be found on below link:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Secure_the_Application/User_Roles/Create_and_Use_Roles

Now when the user logins to the application, check the role of that user and hold it in a client variable.

Note : You need to create a server action to check role and use it in login flow to assign to client variable.

Now set the visible property of link/button to the client variable.

Now,

1. Type the following URL in your web browser: "https://<SERVERNAME>/Users" where <SERVERNAME> is the host  name of the server you're working on. The login page should be displayed.

2. Fill in the credentials and press the 'Login' button.

3. Search/Create a new user.

4. Under the Roles heading, type the role name that you have created and click add.

You are done, Roles has been assigned to user.

Login to the application to test.

Hope this helps you !!


Regards,

Lakshmi Kumar Yadav

Thank you Lakshmi.

One question I have about this part below.

Where do I create the client variable and where do I create the server action?


Kind Regards

More details on roles can be found on below link:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Secure_the_Application/User_Roles/Create_and_Use_Roles

Now when the user logins to the application, check the role of that user and hold it in a client variable.

Note : You need to create a server action to check role and use it in login flow to assign to client variable.

Now set the visible property of link/button to the client variable.


Hi shaan,

Client variables will be created under data tab under "Client Variables" folder.

And Server action will be under Logic tab in "Server Action" folder.

Use the server action in the login flow and use the output of this action to set the value of client variable.


Regards,

LK

Thank you Lakshmi.

The photo of the link part how did you get there?

Kind Regards

Also this what I have so far when I go to user part. There is locked symbol?