What control to use to give option for approve or reject

I am trying to give option to an approver the option to either approve or reject a request. If the approver approve the request then it should change the status of the activity from New activity to approve or reject status. I have uploaded the screen shot and the .oml of my app

The screen shot of the screen

Hello Badar.

Your database is still very raw and hard to read.


Basically you need to create an action on the screen that receives as parameter the ActivityCreationId and if it is approved or rejected. When the button in a row is clicked, it calls the action and changes information into the database. Your database is not ready for status yet.


Here.

I changed your Status entity to be Static so you can assign it. That forced me to delete some unnecessary screens/actions.

Key changes:

On ActivityCreationDetail action SaveDetail I set ActivityStatusId to new when it is a Create. Leave it as is when is an Update.

On the screen you wanted to be changed, you can see the button to Approve/Reject that is replaced by the text after the decision is saved.


Hi Nuno,

After downloading the .oml I try to publish one click but received the following error

Upgrade Error
Could not create foreign key constraint. This may have happened because there are 'ActivityStatus' values of entity 'ActivityCreation' with no corresponding value in entity 'ActivityStatus', or attribute 'ActivityStatus' of entity 'ActivityCreation' is creating a circular dependency between entities. Check the Error Log for more information.

Secondly I could not get why do I have to change the activity status to a static entity as I have used the entity identifier number in the other options So I would not change its status.

The error is because I change the Entity.


What you asked for was a simple way to Approve/Reject. The way I read your project, you want to save status in ActivityCreation.ActivityStatus. But if Activity Status is a text, you can't do it with a single click. You need to open some text input and save it.

You can read my logic and see if something applies to your idea. Or explain what you expect to save in Status table.

Nuno Reis wrote:

The error is because I change the Entity.


What you asked for was a simple way to Approve/Reject. The way I read your project, you want to save status in ActivityCreation.ActivityStatus. But if Activity Status is a text, you can't do it with a single click. You need to open some text input and save it.

You can read my logic and see if something applies to your idea. Or explain what you expect to save in Status table.

Hi Nuno,

So the activity creation screen is used by the technicians and approver. 

Technicians part: Technicians can access the activity creation screen and do the following

1: When the technician logs in then based on Technicians ID he only sees activities that he has created (I have achieved it by the help of filter). (My uploaded .olm can do this)

2: Technician can amend his activity as long as it is in "New" state. (My uploaded .olm can do this)

3: Technicians can also create new activity using the button add activity creation. (My uploaded .olm can do this)

4: The technicians should not be able to see Approve or reject column. (I still need to achieve this)

Approver part:

1: Approver can log in to activity creation screen and aee the activity of all of the Technicians that belong to the store for which approver is responsible. Using a filter I have achieved it. (My uploaded .olm can do this)

2: Approver should be able to see the approve or reject column and could approve and reject the activity that the Technicians working for his store has created. (I am stuck on this part)

3: Once the approver approves or rejects the activity then it should reflect in the activity creation records. This depends on point 2 and I have no idea how to implement it.

I hope from above you can see what I am trying to achieve, thanks.




Hi Badar.

I looked again to your project. You have different columns to Approve/Reject and Status so it is not the same.

But you don't have any attribute to save the Approve/Reject so I created State.

I placed a WebBlock with the buttons on-screen and the DB logic to change state is there. You may want to add logic to save TF and such.

About the permissions, my suggestion is that you do another screen where you filter by TF and there you use the buttons.


Nuno Reis wrote:

Hi Badar.

I looked again to your project. You have different columns to Approve/Reject and Status so it is not the same.

But you don't have any attribute to save the Approve/Reject so I created State.

I placed a WebBlock with the buttons on-screen and the DB logic to change state is there. You may want to add logic to save TF and such.

About the permissions, my suggestion is that you do another screen where you filter by TF and there you use the buttons.


Hi Nuno,


I have created a new attribute in the original Activity creation named approve or reject. Then on the screen I have added check box control. Now when I click on the check box to approve the activity then it puts the check mark on all of the rows. How can I stop this happening. I am uploading my .oml with this post.


Hello.

First, you are using the same variable for all. 

You should be using 

GetActivityCreationsByTFTechnicianRACIF.List.Current.ActivityCreation.ApproveOrReject

And please make that attribute a boolean.


Second, you should be giving options to Approve or Reject. With a checkbox you can only approve or not approve. It is completely different.

That's why I created a static with 3 options: Approve. Reject, Neither. And with two buttons I can say Approve, or Reject orv wait.


After that, don't forget to create an Action to Save.