DynaPDF.Table.SetCellAction
---------------------------

Adds an action to a cell.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [9.1](newinversion91.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.Table.SetCellAction"; Table; Row; Col; ActionHandle; Mode ) 

**MBS**( **"DynaPDF.Table.SetCellAction";** /\* Adds an action to a cell. \*/  
**$Table**; /\* The identifier for the table. \*/   
**$Row**; /\* The row number. Range from 0 to [DynaPDF.Table.GetNumRows](DynaPDFTableGetNumRows.md)-1. Pass -1 for all rows.e.g. 0 \*/   
**$Col**; /\* The column number. Range from 0 to [DynaPDF.Table.GetNumCols](DynaPDFTableGetNumCols.md)-1. Pass -1 for all columns.e.g. 0 \*/   
**$ActionHandle**; /\* The action handlee.g. $action \*/   
**$Mode**) /\* The new highlight mode. Can be None, Invert, Outline, Push or PushUpd.e.g. "Invert" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Table | The identifier for the table. | $Table |
| Row | The row number. Range from 0 to [DynaPDF.Table.GetNumRows](DynaPDFTableGetNumRows.md)-1. Pass -1 for all rows. | 0 |
| Col | The column number. Range from 0 to [DynaPDF.Table.GetNumCols](DynaPDFTableGetNumCols.md)-1. Pass -1 for all columns. | 0 |
| ActionHandle | The action handle | $action |
| Mode | The new highlight mode. Can be None, Invert, Outline, Push or PushUpd. | "Invert" |

### Result

Returns OK or error.

### Description

Adds an action to a cell.  
Creates an invisible link annotation for the specified cell or table and associates the provided action with that annotation. The result is an interactive area that executes the action if the user clicks on cell or table.   
A cell action is always a background object that is created in the size of the background area when the table is drawn.   
  
Unlike other cell objects like images, text, and so on, a cell link is no persistent object because the action will be deleted when then PDF file in memory will be closed or when [DynaPDF.Release](DynaPDFRelease.md) will be called.   
If the table should be drawn into more than one PDF file then re-create the actions and cell action before drawing the table into the next PDF file.   
Actions can be created with functions like [DynaPDF.CreateGoToAction](DynaPDFCreateGoToAction.md), [DynaPDF.CreateGoToRAction](DynaPDFCreateGoToRAction.md), and so on.  
### Examples

Adds a go-to action for a cell in the table:

 Set Variable \[ $NamedDest ; Value: MBS ( "[DynaPDF.CreateNamedDest](DynaPDFCreateNamedDest.md)"; $pdf ; "test"; 2; "Fit") \]   
Set Variable \[ $Action ; Value: MBS ( "[DynaPDF.CreateGoToActionEx](DynaPDFCreateGoToActionEx.md)"; $PDF ; $NamedDest ) \]   
Set Variable \[ $r ; Value: MBS ( "DynaPDF.Table.SetCellAction"; $Table ; $rowNum ; 0; $action ; "Invert" ) \]  
### See also

- [DynaPDF.CreateGoToRAction](DynaPDFCreateGoToRAction.md)
- [DynaPDF.Table.GetNumCols](DynaPDFTableGetNumCols.md)
- [DynaPDF.Table.SetCellImage](DynaPDFTableSetCellImage.md)
- [DynaPDF.Table.SetCellOrientation](DynaPDFTableSetCellOrientation.md)
- [DynaPDF.Table.SetCellPadding](DynaPDFTableSetCellPadding.md)
- [DynaPDF.Table.SetCellSpacing](DynaPDFTableSetCellSpacing.md)
- [DynaPDF.Table.SetCellTemplate](DynaPDFTableSetCellTemplate.md)
- [DynaPDF.Table.SetCellText](DynaPDFTableSetCellText.md)
- [DynaPDF.Table.SetColorFloat](DynaPDFTableSetColorFloat.md)
- [DynaPDF.Table.SetColWidth](DynaPDFTableSetColWidth.md)

### Release notes

- **Version 9.1**
    - Added [DynaPDF.Table.SetCellAction](http://www.mbsplugins.eu/DynaPDFTableSetCellAction.shtml) function.

### Example Databases

- [DynaPDF/Book Creation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Book%20Creation.shtml#3ScriptAnchor_)
- [DynaPDF/Merge PDFs](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Merge%20PDFs.shtml#5ScriptAnchor_)

### Blog Entries

- [Things you can do with DynaPDF](https://www.mbsplugins.de/archive/2021-07-02/Things_you_can_do_with_DynaPDF/monkeybreadsoftware_blog_filemaker)
- [Example Script for DynaPDF.FindText and DynaPDF.WebLink](https://www.mbsplugins.de/archive/2020-05-04/Example_Script_for_DynaPDFFind/monkeybreadsoftware_blog_filemaker)
- [Merge PDF with table of contents](https://www.mbsplugins.de/archive/2020-02-25/Merge_PDF_with_table_of_conten/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.1pr4](https://www.mbsplugins.de/archive/2019-02-25/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 22nd February 2019 , last changed 5th December 2019

  
[DynaPDF.Table.SetBoxProperty](DynaPDFTableSetBoxProperty.md) - [DynaPDF.Table.SetCellImage](DynaPDFTableSetCellImage.md)

[HTML Version](DynaPDFTableSetCellAction.shtml)