Deactivate adding positions action

Hello all,

I have a question regarding the deactivation of actions. I created a simple app:

Table “Request”

Table “RequestDetails”

Column “Order ID” is a Ref from Request Details to Request

After the Request was created with some detail lines I create an email, everything is fine. When email is sent, the column “LastUpdated” is updated with the current DateTime.

After the email is sent it should not be possible to add any positions, so I’ve put this expression to the “Add” action in RequestDetails table:

So could anybody explain why I still see the “add” action in Requests that are already sent? Where is my mistake?

Artikel Hinzufügen = Add

Yes, the column LastUpdated is updated accordingly

Thanks a lot and greetings from Germany

Michael

Add action is not a row level action. As such one cannot have a specific row level expressions to its condition such as ISBLANK([Order ID].[LastUpdated] in you case

There are several posts in the community on this topic of disallowing any adds to children records based on certain condition in the parent.

You could search them.

In general,

  1. Please create a read only or update only slice ( as per your requirement) called say “RO_Request_details” on the child table.

  2. In the parent table add a reverse reference column related to this read only or update only slice created in step 1 above. The general expression for this reverse reference column would be REF_ROWS(“RO_Request_details”, “Order ID”). Let us say the name of this column in [Related RO_RequestDetails]

  3. You will already have a system created reverse reference column in the parent table called something like [Related RequestDetails]

  4. On the show_if of the column [Related RO_RequestDetails] , please have an expression of ISNOTBLANK([LastUpdated])

  5. On the show_if of the column [Related RequestDetails] , please have an expression of ISBLANK([LastUpdated])

2 Likes

Thanks a lot for this very simple solution and sorry, but I did not use the right words to search obviously…

Funny thing is, now I have both tables…

And yes, I’ve done the show_if setting for both columns

Any idea why it doesn’t work?

I believe it should work, all looks good. Hope you saved the columns after set up.

2 Likes

I did, even in Desktop mode I have both tables :disappointed_face:

Even the Test of the formula says it shouldn’t show the first table…

But it’s there.

Does [lastupdated] column has an initial value so that it is never blank?

In that case you may need to ensure it is blank to start with.

1 Like

No, there is no initial value, the data is added by an automation after saving the form.

What are the test results for ISNOTBLANK([lastupdated])

2 Likes

As expected, everything is on Y

Interesting: both tables are shown in the Detail view, but not in the form view. In the form it works as expected.

This presentation:

Steve_0-1730383013869.png

occurs when the Ref column of the child table has Is a part of enabled:

1 Like

Yes, and that’s the expected behavior. For new entries everything works.

But for existing entries I want to avoid adding lines. But when using the solution provided by @Suvrutt_Gurjar I still have both tables, even if I deactivate “Is a part of”:

I don’t get it. I clearly stated the show_if constraints for both tables…

1 Like

Let’s confirm Show_If works at all: set the expression for both to FALSE. Does that change anything?

2 Likes

Thanks Steve, indeed this doesn’t change anything. I’ve set both to FALSE and both tables are still there:

1 Like

Please post a screenshot of the detail view configuration showing the list of columns to display and that shows these two columns included.

2 Likes

Thanks, hope this is what you want to see:

1 Like

Everything looks correct as far as I can see. One last thing to try: set Show? to OFF for both columns. Does that have any effect?

2 Likes

If I set Show to off, both columns disappear:

1 Like

You seem to have a "Required_if column setting for the [Related RquestDetails]. You may want to share and check if that is not impacting the show_if?

2 Likes

It’s the same formula as for the show_if:

Removing the formula doesn’t change the displaying behavior.

2 Likes