Removal of add item column after order status changes

Hi i created a copy of the order capture app, and have also enabled Completed orders in the view.

I want to remove the add item below the virtual order details column after the status is changed to complete , so that no one can manipulate completed order.

Please help me in this regard

1 Like

Here is a workaround you may want to consider based on how your app is configured.

You could create a slice on the child table that is with permissions read only. You could then create a REV_REF column in the parent table with this slice as ref table.

You will now have two list type reverse reference virtual columns in the parent table- One that is based on child table with add, update ( and may be delete permissions if your app needs it) permissions . The other list type reverse reference column will be based on the slice with only read only permissions.

You can show these two list types columns with different show if constraints, the one based on child table can have show_if expression of [Order Status]<>“Complete”, the one based on slice can have show_if expression of [Order Status] = “Complete”
One little drawback is when you make the status complete in the form itself , the related child records do not show in the form view till the form is saved. I believe this will happen when child table records are marked " as part of" master table.
Edit: added description that the slice is on the child table.

3 Likes

Build a how-to app based on the Suvrutt_Gurjar’s comment
https://www.appsheet.com/samples/preview?appGuidString=83be58ea-1901-4a6d-ac9c-38c7c555d8cd.
It works well and there are two more things I want to mention:

  1. We need to give these two rev-ref columns different name.
  2. The appsheet will create a new column RELATED ORDER DETAILS automatically, just click the SHOW? button to make sure it won’t show up.


3 Likes

is there a way we can make this such a way that only certain users can get the add button to edit the info…

@DPM_reports,

Please explore if following helps.

With reference to the sample app shared by @ZhipengY, please try in the show_if constraint of the reverse reference list type column “Open Order Details”, an expression like following

OR([Order Status] = “OPEN”, AND([Order Status] = “Complete”, IN(USEREMAIL(), LIST(“allow1@email.com,"allow2@email.com" ))))

Here “allow1@email.com,"allow2@email.com" are emails where you wish to allow add access to the child table, even after the order status is “complete”

Please try in the show_if constraint of the reverse reference list type column “Complete Order Details”, an expression like following

AND([Order Status] = “Complete”, IN(USEREMAIL(), LIST(“disallow1@email.com,"disallow2@email.com", disallow3@email.com" ))))

disallow2@email.com”, disallow3@email.com" are emails to whom you do not wish to allow add access to the child table, once the order status is complete.

Edit: Please test it well that it satisfies your requirements.

2 Likes

hi i have a table where i have users who i have set as admin via a Yes or No …
cant i use this table in the expression to say whoever is not admin will not have edit access to add items…and those who have can have edit access

@DPM_reports,

Yes, in general I believe you should be able to do that.

2 Likes

in that case can u help with the expression…

I believe,your expressions will need to include lists of user emails built with SELECT () expressions around your USER table

In case of above, an expression something like below may be tried

OR([Order Status] = “OPEN”, AND([Order Status] = “Complete”, IN(USEREMAIL(),
SELECT(Your User TableName[USER Emails Column Name], [Your Admin Role Column]=TRUE)
)))

In case of above , please try an expression something like,

AND([Order Status] = “Complete”, IN(USEREMAIL(), SELECT(Your User TableName[USER Emails Column Name], [Your Admin Role Column]=FALSE))))

Please test these well as per your requirement.

1 Like