Custom Scripts
Custom Scripts If you wish to change any OneHash form formats, you can do so by using Custom Scripts. For example, if you wish to add a submit button after saving, to a Lead form, you can do so by creating your own script. Custom Scripts are small code snippets that are executed in the browser to extend or customize the standard functionality of OneHash. ++Home Customization Form Customization Custom Script++ (https://storage.crisp.chat/users/helpdesk/website/6f1c2c7b8034d000/146Some readersDocuments and Reports : Print Format
Print Formats are the layouts that are generated when you want to Print or Email a transaction. This feature comes handy for all the transactions in OneHash like all the sales and purchase transactions, HR documents and lot more. In OneHash , there are three types of Print Formats, namely, Standard Print Format, Custom Print Format and HTML Print Format. Standard Print Format Every Printable Document Type in OneHash will have it's own Standard Print Format whicSome readersChanging Attachment Limits
Changing Attachment Limits In OneHash, you can limit how many files can be attached to specific Document. Using Customize Form, you can set Maximum Attachments which can be added to a particular documents. Let's assume we need to update Max Attachment for Quotation to five. Step 1: Setup ++Home Customization Form Customization Customize Form++ Step 2: Select Document Type StepFew readersKanban Board
Kanban Board is a tool which will give you a descriptive layout of your data in OneHash based on status and a virtual board. This board shall consist of cards which represent the various Documents listed in a particular Document Type aligned as per the stage of operation of the transactions represented by Status Columns. The card status can be changed easily by dragging and dropping the cards across the board. A Kanban Board helps to visualize, control and optimize work-flow whSome readersServer Script
Server Script A Server Script lets you dynamically define a Python Script that is executed on the server on a document event or API To create a Server Script You must set serverscriptenabled as true in siteconfig.json of your site. To add/edit Server Script, ensure your role is System Manager. Create a new server script via "New Server Script" in the toolbar. Set the type of server script (Document Event / API). Set the document type anPopularDocuments and Reports : Document Title
You can customize the title of documents based on properties so that you have meaningful information for the list views. For example, the default title on a Quotation is the customer name, but if you are dealing with only a few customers and sending lots of quotations to each customer, you may want to customize. Setting Title Fields From OneHash, all transactions have a 'TiFew readersCustomization : DocType
DocType A DocType is the core building block of any application based on the Frappe Framework. It describes the Model and the View of your data. It contains what fields are stored for your data, and how they behave with each other. It contains information about how your data is named. The forms like Sales Order, Sales Invoices, Work Order are added as DocTypes in the backend. DocType allows you to insert custom forms in OneHash as per your requirement. For more understanding on DocTypSome readersAuthorization Rule
Authorization Rule allows configuring a custom authorization / approval on a documents, based on conditions defined. Example: If a Sales Order's Grand Total exceeds $1,000, then it should be verified/Submitted by the Sales Manager only, even if Sales User has submit permission. On the same lines, you can define authorization rule based on the fields like Net Total, Grand Total, Discount % and specify who would be document approver if authorization condition is matched.Few readersCustomize Form
Customize Form Customize Form is a tool which enables you to make changes to a Form Type or a Document Type (DocType) on the front-end. It allows you to insert Custom Fields as per your requirement or customize the properties of standard fields. Before we venture to learn the Form Customization tool, click here to understand the architecture of forms in OneHash. IPopularCustom Field
Custom Field Every form in OneHash has a standard set of fields. If you need to capture some information, but there is no standard Field available for it, you can insert Custom Field in a form as per your requirement. You can go to Customize Form and add the Field in a particular Form or a Document type (hereafter referred to as DocType) . To access Custom Field, go to: ++Home Customization Form Customization Custom FieldPopularAllow Fields to be changed after Submission
Allow Fields to be Changed After Submission Once a document is submitted, fields are frozen, and no editing is allowed. However, there are certain standard fields like Letter Head, Print Heading which can still be edited. Under Custom Field, if Allow on Submit property is checked, this custom field will be editable even after the document is submitted. To set this property, Go to Customize Form. Select the Form in which youFew readersCustomizing Data Visibility in Child Tables
Customizing Data Visibility in Child Tables In OneHash, there is a feature called the editable grid. This allows the user to add values in the child table without opening a dialog box/form for each row. This is how the Quotation Item table renders value when the Editable Grid is enabled. It will have a maximum of four columns in the table. As per the default setting, only four columns are listed inSome readersCustomizing sorting order in the List View
Customizing Sorting Order in the List View Question: I want records in my Item List sorted based on Descending Order of Item Code. Answers: Following are the steps to customize Sort Order for the Item master. These steps will be applicable for customizing Sort Order for the other documents as well. Step 1: Go to Customize Form ++ Home Customization Form Customization Customize Form ++ Step 2: Select DocType Select document type for which Sort Order is to be customized.Few readersField types
Field Types The following are the types of fields you can define while creating new ones, or while amending standard ones. Link Link field is connected to another master from where it fetches data. For example, in the Quotation master, the Customer is a Link field. Dynamic Link Dynamic Link field is one which can search and hold value of any document/doctype. Check This will enable you to have a checkbox here. (https://storage.crisp.chat/users/helpdesk/wSome readersTable MultiSelect Field
Table MultiSelect Field The Table MultiSelect field is very similar to Link Field. The key difference is that Table MultiSelect field allows you to select multiple values. Let us consider an example to understand the same. Let's say you want to assign a ToDo to multiple users, as shown below: You can add a Table MultiSelect Field by using the following steps: Step 1: Create a child DocType. CrSome readersSearch Record by Specific Field
Search Record by Specific Field While creating any DocType, you may want to link a particular field to another DocType. For example, in Sales Order DocType, 'Customer' field allows you to select an existing customer. Such fields are called Link Fields. Using Link Fields you can create Let's assume that you want to see that Item in a Sales Order along with its Item Group. The steps to do this are given below: Step 1: Go to Customize Form ++Home Customization Form Customization >Few readersDate Validation
Date ValidationFew readersUpdate Date Field Based On Value In Other Date Field
Update Date Field Based On Value In Other Date Field The script given below would auto-set value for the date field, based on the value in another date field. Example: Production Due Date must be set as two days before Delivery Date. Let us assume that the Delivery Date for a project has already been defined, and there is a Field 'Production Due Date' as a 'Date' field type present already in the form. Applying the following script shall ensure that the Production Due Date gets auto updatedFew readersHide Buttons in Form View
Hide Buttons in Form View In a submitted Sales Order, you can see buttons like Update Items, Status. Also there are many options under 'Create' button. You can write custom script as shown below to hide these buttons.Few readersFetch Value in Child Table Field
Example showing how to fetch value in a child table field from Master DocType Sample Script to fetch expirydate field from Batch doctype to Sales Invoice Item table Step 1: Create Custom Script for Sales Invoice (parent) doctype Step 2: Script as below & SavePopularRestrict Purpose Of Stock Entry
Restrict Purpose Of Stock EntryFew readersRename Buttons in Form View
Rename Buttons in Form View In a submitted Sales Order, you can see multiple options under the 'Create' option: You can use this custom script to rename the buttons: Using this script, we have removed/hidden the unwanted buttons, and then renamed one: (https://storage.crisp.chat/users/helpdesk/website/6f1c2c7Few readersAdd a Custom Button
Add a Custom ButtonFew readersGenerate Item Code Based on Custom Logic
Generate Item Code Based On Custom Logic Add this Custom Script in the script of Item, so that the new Item Code is generated just before the Item gets saved.Few readersRestrict User Based On Child Record
Restrict User Based On Child RecordFew readersFilter Options in Select Field
Filter Options in Select Field Let's say you have two drop-down fields named State and City. State has two values Karnataka and Maharashtra and City has four values, Bangalore, Mysore, Mumbai, and Pune. If you would like to filter options in City based on the value chosen in State, you can write custom script as shown below.Some readersRestrict Cancel Rights
Restrict Cancel Rights Add a handler to ++custombeforecancel++ event:Few readersMake Read Only After Saving
Make Read Only After Saving Use the method ++curfrm.setdfproperty++ to update the field's display. In this script we also use the ++islocal ++ property of the DocType to check if the document has been saved at least once or is never saved. If ++islocal++ is ++1++, then the document has never been saved.Few readersSales Invoice ID Based On Sales Order ID
Sales Invoice ID Based On Sales Order ID The script given below allows you to apply naming series to a Sales Invoice, same as that of the corresponding Sales Order. Sales Invoice uses a prefix M- but the number duplicates itself from the Sales Order Name. Example: If Sales Order ID is SO-12345, then corresponding Sales Invoice ID will be set as M-12345.Few readersLock Time Sheets Based on Date
Lock Time Sheets Based on Date Let's say you would like all employees to fill time sheets by Friday of every week. And allow only those users having 'Projects Manager' role to edit or add time sheets for days prior to the latest Friday. Below custom script will implement this feature.Few readersCustom Script : Fetch Values from Master
Custom Script for Fetching Values From Master To pull a value of a link on selection, use the ++addfetch++ method. Example Let' say you have created a Custom Field VAT ID (vatid) in Customer and Sales Invoice and want to make sure that this value gets updated every time you select a Customer in a Sales Invoice. To configure this, in the Sales Invoice Custom Script, you can add thiFew readersTranslations
Translations OneHash is available in more than 80 languages most of which has been contributed by OneHash community. Open Translations Tool from the awesome bar Select the language of your choice Click any source message from left sidebar for which you want to add translation. In the Translated Text field enter your suggested translation and click on Suggest. You can click on another source text from left sidebar and add another translaFew readersCustom Translations
With Custom Translations, user can print the customer's and supplier's document in their local language. For example, if you have customers from Germany and France who want quotations in German and French, it's possible using Custom Translations. In the Customer master, select the default Language. Say, the default language for the Customer is Spanish. Same way, you can also set default language in the Supplier master.Some readers