Editing Fields After Submission and Changing Data Types

Editing Fields After Submission and Changing Data Types

Overview

Efficient data entry and clear document identification are critical for productivity in iVendNext. This guide covers two powerful features:


  1. Setting default values to automate repetitive inputs.

  2. Creating multi-field document titles for better readability and searchability.




Part 1: Setting Default Values

1.1 Why Use Default Values?

  • Saves time: Auto-fills frequently used data (e.g., default country, tax codes).

  • Reduces errors: Ensures consistency for mandatory fields.

  • Supports conditional logic: Dynamic defaults based on other fields.


1.2 How to Configure Default Values

Step 1: Access Field Properties

  1. Go to Customize Form → Select the target DocType (e.g., "Sales Invoice").

  2. Locate the field → Expand its properties.


Step 2: Define the Default

  • Static Value: Enter directly in Default Value (e.g., "USD" for Currency).

  • Dynamic Reference: Use {field_name} syntax (e.g., {today} for current date).


Example:


  • Field: Posting Date

  • Default Value: {today}



Advanced: Conditional Defaults

Use Custom Scripts to set defaults based on dependencies:


# Set "Territory" to "North" if "Region" is "EMEA"

if doc.region == "EMEA":

    doc.territory = "North"




Part 2: Multi-Field Document Titles

2.1 Benefits of Multi-Field Titles

  • Clarity: Combines key details (e.g., {customer_name} - {invoice_date}).

  • Searchability: Simplifies filtering in list views.


2.2 How to Configure

Step 1: Identify Title Fields

Ensure referenced fields exist (e.g., customer_name, invoice_date).


Step 2: Create a Consolidated Field

  1. Add a Read Only or HTML field (e.g., "Consolidated Title").

  2. In Options, enter the template:


{customer_name} - Invoice #{name} ({posting_date})  


Note:


  • Avoid Data field types (they don’t support dynamic updates).

  • Use {name} for the document’s auto-generated ID.



Step 3: Set as Document Title

  1. In Customize Form, go to View Settings.

  2. Under Title Field, select the consolidated field.


Output Example:


"Acme Corp - Invoice #INV-2024-001 (2024-06-20)"




3. Best Practices & Troubleshooting

Here’s a quick look at some of the best practices for setting Default Values and Multi-Field document titles.


3.1 For Default Values


Scenario

Recommendation

Date-dependent defaults

Use {today} or frappe.utils.nowdate().

User-specific defaults

Reference frappe.session.user.

Mandatory fields

Combine with Is Mandatory flag.


3.2 For Multi-Field Titles

  • Test Formatting: Ensure long fields don’t break layouts.

  • Avoid Circular References: E.g., {title} in a title field.

  • Use HTML for Rich Text: Add icons/colors via <span> tags.




    • Related Articles

    • Creating and Managing Custom Fields

      Overview Custom fields in iVendNext let you tailor forms to fit your specific data needs—like extra customer info, project tags, or inventory tweaks. They help your system match your workflow, not the other way around. This guide walks you through ...
    • Understanding Field Types

      Overview Fields in iVendNext shape how data is entered, shown, and used across forms and documents. Choosing the right type—whether for sales, inventory, or customer records—boosts accuracy and efficiency. This guide covers field types, their uses, ...
    • Understanding Frozen Fields in the Item Master

      Overview This article will explain what frozen fields are, why they are frozen, and how to manage them effectively in the Item Master. What Are Frozen Fields? Frozen fields are fields in the Item master that become read-only after certain actions are ...
    • Understanding the Three Types of Reports

      Overview Reports are a critical component of iVendNext, enabling users to extract, analyze, and present data efficiently. This article explores the three primary types of reports available in iVendNext: Report Builder, Query Reports, and Script ...
    • Understanding User Types

      Overview iVendNext has two user types: System Users and Website Users. Choosing the right type is key to avoiding access or security issues. This article covers their differences, common uses, and setup guidelines. What Are System Users? System Users ...