User Manual

06.26.2025

MANUAL

Developer Function: Script: $p.getValue

## Overview This method is used to retrieve the value of a field by its name on the edit screen. It should be used when utilizing the values of the target fields. ## Limitations 1. The value of "[Comment](/en/manual/table-management-comments)" cannot be retrieved. ## Syntax ##### JavaScript ``` $p.getValue('Field Name or Display Name') ``` ## Retrieved Content For "[Class Column](/en/manual/table-management-class)", "[Numeric Value Column](/en/manual/table-management-num)", "「Date Column」", "「Description Column」", "「Check Column」", and "「Attachment Column」", the following results are returned ### Class Column * ・The content retrieved depends on the selected options. "ID", "Version", "[Title](/en/manual/tenant-logo)", "[Status](/en/manual/table-management-status)", "Administrator", "Responsible Person" behave similarly. |Option Setting|Retrieved Content|Remarks| |---|---|---| |Unset|Entered string|Corresponds to "ID", "Version", and "Title". A free-text field.| |String|Option string|| |Code and String|Option code| "[Status](/en/manual/table-management-status)" corresponds here. Use "「$p.getControl」" to retrieve the option string.| |Link to another table|Option code (Record ID)|"Administrator", "Responsible Person" correspond here. Use "「$p.getControl」" to retrieve the option string.| ### Numeric Value Column * ・The input value is retrieved as a "string". Please cast the type as needed when using it in scripts. * ・Decimal values are retrieved with zero-padding based on the significant digits (only for read-only spinner controls). * ・If a format is specified, the value before format conversion is retrieved. * ・If units are set, the retrieved value will not include the units. * ・This applies to fields such as "Workload", "Progress", and "Remaining Workload". ### Date Column * ・The input value is retrieved as a "string". Please cast the type as needed when using it in scripts. * ・The same applies to "Start" and "Completion" fields. ### Description Column * ・The input value is retrieved as a "string". * ・Pasted images are retrieved as URL strings. * ・The same applies to "[Body](/en/manual/table-management-body)" column. ### Check Column * ・The value is retrieved as a Boolean (true/false) based on the input checkbox (ON/OFF). ### Attachment Column * ・The value is retrieved as a "string" in the following array format: ``` [{"Guid":"1234...","Name":"testPDFfile.pdf","Size":12345},{"Guid":"ABCD...","Name":"testxlsxfile.xlsx","Size":45678},{"Guid":"4E5F6G...","Name":"testpptxfile.pptx","Size":901234}] ``` ## Usage Example Set the following sample code in the Pleasanter script, set the output destination to "[Editor](/en/manual/table-management-editor)", and then navigate to the editing screen. The values will be output to the Developer Tools Console. ##### JavaScript ``` $p.events.on_editor_load = function () { // Output values to Developer Tools Console console.log($p.getValue('Customer')); // Code (Record ID) of the selected option in 'Customer' (ClassA) console.log($p.getValue('ClassA')); // Can also retrieve by field name 'ClassA' console.log($p.getValue('Subject')); // 『Subject』 console.log($p.getValue('Body')); // 『Content』field retrieved by Body field name console.log($p.getValue('Status')); // Code of selected option in『Status』 console.log($p.getValue('Expected Order Date')); // 『Expected Order Date』 console.log($p.getValue('ClassB')); // 『Product Classification』retrieved by 'ClassB' field name console.log($p.getValue('Sales')); // 『Sales』field, retrieves value before format conversion console.log($p.getValue('NumD')); // 『Gross Profit Rate』retrieved by 'NumD', excludes unit value } ``` #### Output Result ![image](https://pleasanter.org/binaries/791d6d050c3c41b9b3448cbcb95ffb8f) ## Supported Versions |Supported Versions|Body| |:--|:--| |1.4.12.0 and later|Added function| ## Related Information <div id="ManualList"><ul><li><a href="/en/manual/table-management-body">Table Management: Item: Body</a><span>08.13.2024 up</span></li> <li><a href="/en/manual/table-management-status">Manage Table: Column: Status</a><span>10.02.2024 up</span></li> <li><a href="/en/manual/table-management-class">Table Management: Item: Classification</a><span>08.13.2024 up</span></li> <li><a href="/en/manual/table-management-num">Manage Table: Column: Numerical Value</a><span>10.02.2024 up</span></li> <li><a href="/en/manual/table-management-comments">Table Management: Item: Comment</a><span>08.13.2024 up</span></li></ul></article> <ul><li><a href="/en/manual/table-management-editor">Manage Table: Editor</a><span>06.20.2025 up</span></li></ul></article> <ul><li><a href="/en/manual/tenant-logo">Tenant Management Function: Logo, Title, Logo Image</a><span>10.08.2024 up</span></li></ul></article></div><input id="SearchTextHidden" type="hidden" value="" />
TOP
このページをシェアする
記載された商品名、各製品名は各社の登録商標または商標です。 © Implem Inc.