Page 1 of 1

Disable detail preview based on condition

Posted: Wed May 24, 2023 9:43 pm
by philmills

In my project detail tables can be viewed either by clicking the arrow to the left of the record, or by clicking the row.
I need to disable detail preview for records that do not belong to current user.
I'm guessing I need to add code to ListOptions_Rendered

Using v2022


Re: Disable detail preview based on condition

Posted: Thu May 25, 2023 8:41 am
by mobhar

You may simply try, for example:

// hide detail preview in Orders List page with OrderID = 11075
if ($this->OrderID->CurrentValue == "11075") {
    $option = $this->ListOptions["preview"];
    $option->Body = "";
}

Re: Disable detail preview based on condition

Posted: Thu May 25, 2023 2:28 pm
by philmills

That worked perfectly.
Thanks!