• Homepage
  • FAQ
  • Modules
    • Workflow Designer
      • Documentation
      • Changelog VT 7
      • Task Updates
      • Knowledge Base
    • Colorizer
      • Changelog
    • CloudFile
    • Coupons
    • VtigerCRM Tools
    • Other Documentations
  • VtigerCRM
  • Tickets
  • Redoo Networks Homepage
  • German
  • Homepage
  • FAQ
  • Modules
    • Workflow Designer
      • Documentation
      • Changelog VT 7
      • Task Updates
      • Knowledge Base
    • Colorizer
      • Changelog
    • CloudFile
    • Coupons
    • VtigerCRM Tools
    • Other Documentations
  • VtigerCRM
  • Tickets
  • Redoo Networks Homepage
  • German
home/Knowledge Base/Workflow Designer/Developer/How to add custom inventory fields

How to add custom inventory fields

150 views 0 August 19, 2016 sysadmin

If you implement custom fields in your Inventory Records, like Invoice, Quotes, the values will be deleted during any workflows and you couldn’t interact with this values from Workflow Designer before version 600.0825.
With this version, you could create a file named “InventoryFields.inc.php” directly into the “extends” directory.
This file will not be overwritten during updates of the module.

In this file you could configure the fields you create and want to keep during Workflows.
This file MUST have the following structure.
Because this file will be included during every Workflow execution in the Inventory Modules, you should proceed with caution.
Every Error in this file could make it impossible to execute any workflows.

<?php
/**
 * You need to enter the following php structure
 *
 * return array(
 *    'tableCol' => array('inventoryField' => 'FieldNameWithoutProductIndex', 'label' => 'Label of this field'),
 * );
 */
// Example:
 
return array(
    'test' => array('inventoryField' => 'testCol', 'label' => 'Testvalue'),
);
tableColThis is the name of the column in the vtiger_inventoryproductrel table. Won’t be used to read from database , but will be a good and unique name
TestvalueThe label of this field, which will be shown on task configurations
FieldNameWithoutProductIndexThis is the Key of the value in the ProductsArray. You use this value in the “getAssociatedProducts” function

This structure will make it possible to also set this fields if you create an Invoice in an Workflow.

Was this helpful?

Yes  No
Related Articles
  • Task Development
  • Add a custom Record Selection method
  • General Information for Developers
  • Add custom Template field shortcuts
  • Using HTTP Handler to create Webforms
  • How to implement an own Inventory Loader?
Leave A Comment Cancel reply

New title
  • Workflow Designer 3
    • Developer 14
    • General 13
    • Example Workflows 2
  • VtigerCRM 0
    • EventHandlers 4
    • Modifications 1
    • General 4
    • VtigerCRM 6 1
  • CloudFile 1
  • Coupons 1
  • Colorizer 2
  • Flex Reports 1
Popular Articles
  • How to debug VtigerCRM?
  • Coupons
  • [VT6] use custom Product price fields for special modules
  • SMTP Server Konfiguration
  • Workflow Designer Quick Start

  How to execute a Workflow by PHP

How to add custom fileactions  

  • Impressum

Zum shop

  • Deutsch