Using Preview Extension

Dear friends,I just Enabled Preview Extension, it works very good.
But I have problem how to set only to view (for a condition) - can’t edit or add in detail table.Here is my situation ( I have master/detail table).
Master : poheader
Detail : podetailI put below code in podetail – function ListOptions_Rendered()

    $PODetNo = $this->po_no->CurrentValue;
    $POState = ExecuteScalar ("SELECT po_state FROM poheader WHERE po_no = '".$PODetNo."'");
      
    if($POState=="P" or $POState=="C"){
    $this->ListOptions->Items["edit"]->Body="";
    }

Also in ListOptions_Rendering()

if($POState=="P" or $POState=="C" ){
    $this->OtherOptions["addedit"]->Items["add"]->Visible = FALSE;
    $this->OtherOptions["addedit"]->Items["gridadd"]->Visible = FALSE;
    $this->OtherOptions["addedit"]->Items["gridedit"]->Visible = FALSE;
}

Those are work well for normal page.But where to put those code for PreviewOverlay ? I would like to have the same condition for the Preview.Kindly help. Thanks in advanced

You may search in this forum by using one of the following keywords:

  • DetailAdd
  • DetialEdit
  • DetailView

Thanks for the reply,I have search, and tried this :

   if ($this->po_state->CurrentValue == "C" or $this->po_state->CurrentValue == "P"){
       $GLOBALS["podetail"]->DetailEdit = false;        
   }

I put above code in poheader.
ListOptions_Rendering()
Again for normal page is Worked.
But in preview… I can still see "edit"Kindly help. thanks

To control permissions, you better use TablePermission_Loaded server event instead. Without Edit permission, the Edit link/button will not show.

Thank you. Will try.