Picklists
The Picklists module provides access to picklist configuration data when a widget is rendered within supported locations. Widgets can retrieve predefined picklist values and related metadata for use in validations, conditional logic, and UI extensions.
Methods
Get Picklist Details
Retrieves data related to the current context. This method allows your widget to fetch record details, field values, or metadata required for rendering or processing logic.
Commonly used for :
- Fetch record information
- Read field values
- Access contextual module data
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.get('picklist').then(function (data) {
}).catch(function (err) {
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| picklist_number | picklist.picklist_number |
| date | picklist.date |
| notes | picklist.notes |
| assignee_id | picklist.assignee_id |
| line_items | picklist.line_items |
| warehouse_id | picklist.warehouse_id |
| location_id | picklist.location_id |
| custom_fields | picklist.custom_fields |
Set Picklist Details
Updates or sets data within the current context. This method allows your widget to modify field values, update state, or pass data back to the host application.
Commonly used for :
- Update field values
- Set widget or module state
- Pass data to the parent application
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.set('picklist.name', <value>).then(function (data) {
}).catch(function (err) {
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| picklist_number | picklist.picklist_number |
| date | picklist.date |
| notes | picklist.notes |
| assignee_id | picklist.assignee_id |
| line_items | picklist.line_items |
| warehouse_id | picklist.warehouse_id |
| location_id | picklist.location_id |
| custom_fields | picklist.custom_fields |
Set Picklist customfields
Specifically designed to update custom field values within the current context. This method allows your widget to target and modify custom fields without affecting standard fields, ensuring precise data management.
Commonly used for :
- Update custom field values
- Manage user-defined data points
- Ensure targeted updates to specific fields
Supported Locations :
picklist.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.set('picklist.<custom_field_api_name>',<value>).then(function (data) {
}).catch(function (err) {
});
});
}
Get Line Items
This method allows you to retrieve the line items associated with the current picklist. It can be used to fetch details such as product information, quantity, rate, and total for each line item. This is particularly useful when you want to display or utilize the picklist's line item details within your widget or extension.
Supported Locations :
picklist.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.get('picklist.line_items').then(function (res) {
console.log('picklist line items : ', res);
}).catch(function (err) {
console.log('Error while fetching picklist line items : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| line_item_id | line_item_id |
| so_line_item_id | so_line_item_id |
| pr_line_item_id | pr_line_item_id |
| quantity_to_be_picked | quantity_to_be_picked |
| quantity_picked | quantity_picked |
| status | status |
| item_custom_fields | item_custom_fields |
| storages | storages |
| batches | batches |
| serial_numbers | serial_numbers |
Show More Supported Input Keys
| Property | Request |
|---|
| preferred_storage_id | preferred_storage_id |
Set Line Items
This methods is to allowed for set a list of line items in the current picklist. It can be used to set details such as product information, quantity, rate, and total for multiple line items. This is particularly useful when you want to update or set multiple line items details within your widget or extension.This methods is append the line items to the existing line items in the picklist.
Supported Locations :
picklist.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
var lineItemMetaData =[{'rate':'1000','description':'Table','name':'Table'},{'rate':'1000','description':'Monitor','name':'Monitor'}]
ZFAPPS.set('picklist.line_items',lineItemMetaData).then(function (res) {
console.log('picklist line items : ', res);
}).catch(function (err) {
console.log('Error while fetching picklist line items : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| line_item_id | line_item_id |
| so_line_item_id | so_line_item_id |
| pr_line_item_id | pr_line_item_id |
| quantity_to_be_picked | quantity_to_be_picked |
| quantity_picked | quantity_picked |
| status | status |
| item_custom_fields | item_custom_fields |
| storages | storages |
| batches | batches |
| serial_numbers | serial_numbers |
Show More Supported Input Keys
| Property | Request |
|---|
| preferred_storage_id | preferred_storage_id |
Set Single Line Items
This methods is to allowed for setting/updating a single line item in the current picklist. It can be used to set details such as product information, quantity, rate, and total for a single line item. This is particularly useful when you want to update or set a single line item details within your widget or extension.
Supported Locations :
picklist.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.set('picklist.line_items[0]',{'rate':'1000'}).then(function (res) {
console.log('picklist line item rate : ', res);
}).catch(function (err) {
console.log('Error while fetching picklist line item rate : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| line_item_id | line_item_id |
| so_line_item_id | so_line_item_id |
| pr_line_item_id | pr_line_item_id |
| quantity_to_be_picked | quantity_to_be_picked |
| quantity_picked | quantity_picked |
| status | status |
| item_custom_fields | item_custom_fields |
| storages | storages |
| batches | batches |
| serial_numbers | serial_numbers |
Show More Supported Input Keys
| Property | Request |
|---|
| preferred_storage_id | preferred_storage_id |
Set Bulk Line Items
This methods is to allowed for replacing/updating all the existing line items in the current picklist. It can be used to set details such as product information, quantity, rate, and total for multiple line items. This is particularly useful when you want to update or set multiple line items details within your widget or extension.
Supported Locations :
picklist.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
var lineItemMetaData =[{'rate':'1000','description':'Table','name':'Table'},{'rate':'1000','description':'Monitor','name':'Monitor'}]
ZFAPPS.set('picklist.line_items.bulk_update',lineItemMetaData).then(function (res) {
console.log('picklist line items : ', res);
}).catch(function (err) {
console.log('Error while fetching picklist line items : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| line_item_id | line_item_id |
| so_line_item_id | so_line_item_id |
| pr_line_item_id | pr_line_item_id |
| quantity_to_be_picked | quantity_to_be_picked |
| quantity_picked | quantity_picked |
| status | status |
| item_custom_fields | item_custom_fields |
| storages | storages |
| batches | batches |
| serial_numbers | serial_numbers |
Show More Supported Input Keys
| Property | Request |
|---|
| preferred_storage_id | preferred_storage_id |
Set Line Items Customfields
This method is allowed for setting/updating custom fields for line items in the picklist. It can be used to set details such as product information, quantity, rate, total, and custom field values for multiple line items. This is particularly useful when you want to update or set multiple line items details along with their custom field values within your widget or extension.
Supported Locations :
picklist.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
var lineItemMetaData =[{'rate':'1000','description':'Table','name':'Table','item_custom_fields':[{'api_name':'<line_item_custom_field_name>', 'value':'<value>'}]}]
ZFAPPS.set('picklist.line_items',lineItemMetaData).then(function (res) {
console.log('picklist line items : ', res);
}).catch(function (err) {
console.log('Error while fetching picklist line items : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| line_item_id | line_item_id |
| so_line_item_id | so_line_item_id |
| pr_line_item_id | pr_line_item_id |
| quantity_to_be_picked | quantity_to_be_picked |
| quantity_picked | quantity_picked |
| status | status |
| item_custom_fields | item_custom_fields |
| storages | storages |
| batches | batches |
| serial_numbers | serial_numbers |
Show More Supported Input Keys
| Property | Request |
|---|
| preferred_storage_id | preferred_storage_id |