Methods
Get Creditnote 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
Supported Locations :
creditnote.details.sidebarcreditnote.creation.sidebarcreditnote.details.buttoncreditnote.bulkaction.button
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.get('creditnote').then(function (data) {
}).catch(function (err) {
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| adjustment | creditnote.adjustment |
| adjustment_description | creditnote.adjustment_description |
| adjustment_formatted | creditnote.adjustment_formatted |
| approver_id | creditnote.approver_id |
| approvers_list | creditnote.approvers_list |
| balance | creditnote.balance |
| balance_formatted | creditnote.balance_formatted |
| billing_address | creditnote.billing_address |
| branch_id | creditnote.branch_id |
| color_code | creditnote.color_code |
Show More Supported Input Keys
| Property | Request |
|---|
| comments | creditnote.comments |
| contact_category | creditnote.contact_category |
| contact_persons | creditnote.contact_persons |
| created_by_id | creditnote.created_by_id |
| created_time | creditnote.created_time |
| creditnote_id | creditnote.creditnote_id |
| creditnote_number | creditnote.creditnote_number |
| creditnote_refunds | creditnote.creditnote_refunds |
| currency_code | creditnote.currency_code |
| currency_id | creditnote.currency_id |
| currency_symbol | creditnote.currency_symbol |
| current_sub_status | creditnote.current_sub_status |
| current_sub_status_formatted | creditnote.current_sub_status_formatted |
| current_sub_status_id | creditnote.current_sub_status_id |
| custom_field_hash | creditnote.custom_field_hash |
| custom_fields | creditnote.custom_fields |
| customer_id | creditnote.customer_id |
| customer_name | creditnote.customer_name |
| date | creditnote.date |
| date_formatted | creditnote.date_formatted |
| discount | creditnote.discount |
| discount_applied_on_amount | creditnote.discount_applied_on_amount |
| discount_type | creditnote.discount_type |
| documents | creditnote.documents |
| ewaybills | creditnote.ewaybills |
| exchange_rate | creditnote.exchange_rate |
| html_string | creditnote.html_string |
| invoice_id | creditnote.invoice_id |
| invoices_credited | creditnote.invoices_credited |
| is_discount_before_tax | creditnote.is_discount_before_tax |
| is_emailed | creditnote.is_emailed |
| is_eway_bill_required | creditnote.is_eway_bill_required |
| is_inclusive_tax | creditnote.is_inclusive_tax |
| is_pre_gst | creditnote.is_pre_gst |
| is_square_transaction | creditnote.is_square_transaction |
| last_modified_by_id | creditnote.last_modified_by_id |
| last_modified_time | creditnote.last_modified_time |
| line_items | creditnote.line_items |
| notes | creditnote.notes |
| orientation | creditnote.orientation |
| page_height | creditnote.page_height |
| page_width | creditnote.page_width |
| price_precision | creditnote.price_precision |
| reference_number | creditnote.reference_number |
| roundoff_value | creditnote.roundoff_value |
| roundoff_value_formatted | creditnote.roundoff_value_formatted |
| salesperson_id | creditnote.salesperson_id |
| salesperson_name | creditnote.salesperson_name |
| shipping_address | creditnote.shipping_address |
| shipping_charge | creditnote.shipping_charge |
| shipping_charge_exclusive_of_tax | creditnote.shipping_charge_exclusive_of_tax |
| shipping_charge_exclusive_of_tax_formatted | creditnote.shipping_charge_exclusive_of_tax_formatted |
| shipping_charge_formatted | creditnote.shipping_charge_formatted |
| shipping_charge_inclusive_of_tax | creditnote.shipping_charge_inclusive_of_tax |
| shipping_charge_inclusive_of_tax_formatted | creditnote.shipping_charge_inclusive_of_tax_formatted |
| shipping_charge_sac_code | creditnote.shipping_charge_sac_code |
| shipping_charge_tax | creditnote.shipping_charge_tax |
| shipping_charge_tax_exemption_code | creditnote.shipping_charge_tax_exemption_code |
| shipping_charge_tax_exemption_id | creditnote.shipping_charge_tax_exemption_id |
| shipping_charge_tax_formatted | creditnote.shipping_charge_tax_formatted |
| shipping_charge_tax_id | creditnote.shipping_charge_tax_id |
| shipping_charge_tax_name | creditnote.shipping_charge_tax_name |
| shipping_charge_tax_percentage | creditnote.shipping_charge_tax_percentage |
| shipping_charge_tax_type | creditnote.shipping_charge_tax_type |
| status | creditnote.status |
| status_formatted | creditnote.status_formatted |
| sub_statuses | creditnote.sub_statuses |
| sub_total | creditnote.sub_total |
| sub_total_formatted | creditnote.sub_total_formatted |
| sub_total_inclusive_of_tax | creditnote.sub_total_inclusive_of_tax |
| sub_total_inclusive_of_tax_formatted | creditnote.sub_total_inclusive_of_tax_formatted |
| subject_content | creditnote.subject_content |
| submitted_by | creditnote.submitted_by |
| submitted_date | creditnote.submitted_date |
| submitted_date_formatted | creditnote.submitted_date_formatted |
| submitter_id | creditnote.submitter_id |
| tax_rounding | creditnote.tax_rounding |
| tax_total | creditnote.tax_total |
| tax_total_formatted | creditnote.tax_total_formatted |
| taxes | creditnote.taxes |
| template_id | creditnote.template_id |
| template_name | creditnote.template_name |
| template_type | creditnote.template_type |
| template_type_formatted | creditnote.template_type_formatted |
| terms | creditnote.terms |
| total | creditnote.total |
| total_credits_used | creditnote.total_credits_used |
| total_formatted | creditnote.total_formatted |
| total_refunded_amount | creditnote.total_refunded_amount |
| transaction_rounding_type | creditnote.transaction_rounding_type |
Set Creditnote 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
Supported Locations :
creditnote.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.set('creditnote.name', <value>).then(function (data) {
}).catch(function (err) {
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| adjustment | creditnote.adjustment |
| adjustment_description | creditnote.adjustment_description |
| adjustment_formatted | creditnote.adjustment_formatted |
| approver_id | creditnote.approver_id |
| approvers_list | creditnote.approvers_list |
| balance | creditnote.balance |
| balance_formatted | creditnote.balance_formatted |
| billing_address | creditnote.billing_address |
| branch_id | creditnote.branch_id |
| color_code | creditnote.color_code |
Show More Supported Input Keys
| Property | Request |
|---|
| comments | creditnote.comments |
| contact_category | creditnote.contact_category |
| contact_persons | creditnote.contact_persons |
| created_by_id | creditnote.created_by_id |
| created_time | creditnote.created_time |
| creditnote_id | creditnote.creditnote_id |
| creditnote_number | creditnote.creditnote_number |
| creditnote_refunds | creditnote.creditnote_refunds |
| currency_code | creditnote.currency_code |
| currency_id | creditnote.currency_id |
| currency_symbol | creditnote.currency_symbol |
| current_sub_status | creditnote.current_sub_status |
| current_sub_status_formatted | creditnote.current_sub_status_formatted |
| current_sub_status_id | creditnote.current_sub_status_id |
| custom_field_hash | creditnote.custom_field_hash |
| custom_fields | creditnote.custom_fields |
| customer_id | creditnote.customer_id |
| customer_name | creditnote.customer_name |
| date | creditnote.date |
| date_formatted | creditnote.date_formatted |
| discount | creditnote.discount |
| discount_applied_on_amount | creditnote.discount_applied_on_amount |
| discount_type | creditnote.discount_type |
| documents | creditnote.documents |
| ewaybills | creditnote.ewaybills |
| exchange_rate | creditnote.exchange_rate |
| html_string | creditnote.html_string |
| invoice_id | creditnote.invoice_id |
| invoices_credited | creditnote.invoices_credited |
| is_discount_before_tax | creditnote.is_discount_before_tax |
| is_emailed | creditnote.is_emailed |
| is_eway_bill_required | creditnote.is_eway_bill_required |
| is_inclusive_tax | creditnote.is_inclusive_tax |
| is_pre_gst | creditnote.is_pre_gst |
| is_square_transaction | creditnote.is_square_transaction |
| last_modified_by_id | creditnote.last_modified_by_id |
| last_modified_time | creditnote.last_modified_time |
| line_items | creditnote.line_items |
| notes | creditnote.notes |
| orientation | creditnote.orientation |
| page_height | creditnote.page_height |
| page_width | creditnote.page_width |
| price_precision | creditnote.price_precision |
| reference_number | creditnote.reference_number |
| roundoff_value | creditnote.roundoff_value |
| roundoff_value_formatted | creditnote.roundoff_value_formatted |
| salesperson_id | creditnote.salesperson_id |
| salesperson_name | creditnote.salesperson_name |
| shipping_address | creditnote.shipping_address |
| shipping_charge | creditnote.shipping_charge |
| shipping_charge_exclusive_of_tax | creditnote.shipping_charge_exclusive_of_tax |
| shipping_charge_exclusive_of_tax_formatted | creditnote.shipping_charge_exclusive_of_tax_formatted |
| shipping_charge_formatted | creditnote.shipping_charge_formatted |
| shipping_charge_inclusive_of_tax | creditnote.shipping_charge_inclusive_of_tax |
| shipping_charge_inclusive_of_tax_formatted | creditnote.shipping_charge_inclusive_of_tax_formatted |
| shipping_charge_sac_code | creditnote.shipping_charge_sac_code |
| shipping_charge_tax | creditnote.shipping_charge_tax |
| shipping_charge_tax_exemption_code | creditnote.shipping_charge_tax_exemption_code |
| shipping_charge_tax_exemption_id | creditnote.shipping_charge_tax_exemption_id |
| shipping_charge_tax_formatted | creditnote.shipping_charge_tax_formatted |
| shipping_charge_tax_id | creditnote.shipping_charge_tax_id |
| shipping_charge_tax_name | creditnote.shipping_charge_tax_name |
| shipping_charge_tax_percentage | creditnote.shipping_charge_tax_percentage |
| shipping_charge_tax_type | creditnote.shipping_charge_tax_type |
| status | creditnote.status |
| status_formatted | creditnote.status_formatted |
| sub_statuses | creditnote.sub_statuses |
| sub_total | creditnote.sub_total |
| sub_total_formatted | creditnote.sub_total_formatted |
| sub_total_inclusive_of_tax | creditnote.sub_total_inclusive_of_tax |
| sub_total_inclusive_of_tax_formatted | creditnote.sub_total_inclusive_of_tax_formatted |
| subject_content | creditnote.subject_content |
| submitted_by | creditnote.submitted_by |
| submitted_date | creditnote.submitted_date |
| submitted_date_formatted | creditnote.submitted_date_formatted |
| submitter_id | creditnote.submitter_id |
| tax_rounding | creditnote.tax_rounding |
| tax_total | creditnote.tax_total |
| tax_total_formatted | creditnote.tax_total_formatted |
| taxes | creditnote.taxes |
| template_id | creditnote.template_id |
| template_name | creditnote.template_name |
| template_type | creditnote.template_type |
| template_type_formatted | creditnote.template_type_formatted |
| terms | creditnote.terms |
| total | creditnote.total |
| total_credits_used | creditnote.total_credits_used |
| total_formatted | creditnote.total_formatted |
| total_refunded_amount | creditnote.total_refunded_amount |
| transaction_rounding_type | creditnote.transaction_rounding_type |
Get Creditnotes List
Retrieves multiple data points or a collection of records related to the current context. This method is useful for fetching lists, related records, or bulk data required for your widget's functionality.
Commonly used for :
- Fetch related records
- Retrieve collections of data
- Access lists or tables of information
Supported Locations :
creditnote.list.sidebarcreditnote.list.buttoncreditnote.bulkaction.button
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.get('creditnotes').then(function (data) {
}).catch(function (err) {
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| applied_invoices | creditnote.applied_invoices |
| balance | creditnote.balance |
| balance_formatted | creditnote.balance_formatted |
| created_time | creditnote.created_time |
| creditnote_id | creditnote.creditnote_id |
| creditnote_number | creditnote.creditnote_number |
| currency_code | creditnote.currency_code |
| currency_id | creditnote.currency_id |
| customer_id | creditnote.customer_id |
| customer_name | creditnote.customer_name |
Show More Supported Input Keys
| Property | Request |
|---|
| date | creditnote.date |
| date_formatted | creditnote.date_formatted |
| exchange_rate | creditnote.exchange_rate |
| has_attachment | creditnote.has_attachment |
| is_emailed | creditnote.is_emailed |
| last_modified_time | creditnote.last_modified_time |
| reference_number | creditnote.reference_number |
| salesperson_id | creditnote.salesperson_id |
| salesperson_name | creditnote.salesperson_name |
| status | creditnote.status |
| status_formatted | creditnote.status_formatted |
| template_id | creditnote.template_id |
| template_type | creditnote.template_type |
| total | creditnote.total |
| total_formatted | creditnote.total_formatted |
| selected | creditnote.selected |
Set Creditnote 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 :
creditnote.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.set('creditnote.<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 credit note. 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 credit note's line item details within your widget or extension.
Supported Locations :
creditnote.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.get('creditnote.line_items').then(function (res) {
console.log('creditnote line items : ', res);
}).catch(function (err) {
console.log('Error while fetching creditnote line items : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| item_id | item_id |
| line_item_id | line_item_id |
| account_id | account_id |
| name | name |
| description | description |
| item_order | item_order |
| rate | rate |
| quantity | quantity |
| tax_id | tax_id |
| tags | tags |
Show More Supported Input Keys
| Property | Request |
|---|
| tax_exemption_code | tax_exemption_code |
| tax_exemption_id | tax_exemption_id |
| product_type | product_type |
| avatax_tax_code | avatax_tax_code |
| discount | discount |
| discounts | discounts |
| discount_account_id | discount_account_id |
| discount_account_name | discount_account_name |
| item_custom_fields | item_custom_fields |
| hsn_or_sac | hsn_or_sac |
| warehouse_id | warehouse_id |
| location_id | location_id |
| serial_numbers | serial_numbers |
| batches | batches |
| gst_treatment_code | gst_treatment_code |
| tax_treatment_code | tax_treatment_code |
| is_item_shipped | is_item_shipped |
| invoice_item_id | invoice_item_id |
| invoice_id | invoice_id |
| is_returned_to_stock | is_returned_to_stock |
| salesreturn_item_id | salesreturn_item_id |
| project_id | project_id |
| pricebook_id | pricebook_id |
| is_discounted | is_discounted |
| tds_tax_id | tds_tax_id |
| unit | unit |
| unit_conversion_id | unit_conversion_id |
| code | code |
| revenue_recognition_rule_id | revenue_recognition_rule_id |
| service_start_date | service_start_date |
| allocation_mode | allocation_mode |
| recognition_type | recognition_type |
| revenue_recognition_deferred_account_id | revenue_recognition_deferred_account_id |
| service_end_date | service_end_date |
| asset_price | asset_price |
| item_meta_fields | item_meta_fields |
| sat_item_key_code | sat_item_key_code |
| unitkey_code | unitkey_code |
| modified_asset_price | modified_asset_price |
| non_taxable_amount | non_taxable_amount |
| identification_number | identification_number |
| storages | storages |
| tax_category | tax_category |
| sales_rate | sales_rate |
| label_rate | label_rate |
| product_tax_category | product_tax_category |
| mapped_items | mapped_items |
| tax_selection_mode | tax_selection_mode |
| line_item_taxes | line_item_taxes |
| line_item_tds | line_item_tds |
| taxes | taxes |
Set Line Items
This methods is to allowed for set a list of line items in the current credit note. 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 credit note.
Supported Locations :
creditnote.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('creditnote.line_items',lineItemMetaData).then(function (res) {
console.log('creditnote line items : ', res);
}).catch(function (err) {
console.log('Error while fetching creditnote line items : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| item_id | item_id |
| line_item_id | line_item_id |
| account_id | account_id |
| name | name |
| description | description |
| item_order | item_order |
| rate | rate |
| quantity | quantity |
| tax_id | tax_id |
| tags | tags |
Show More Supported Input Keys
| Property | Request |
|---|
| tax_exemption_code | tax_exemption_code |
| tax_exemption_id | tax_exemption_id |
| product_type | product_type |
| avatax_tax_code | avatax_tax_code |
| discount | discount |
| discounts | discounts |
| discount_account_id | discount_account_id |
| discount_account_name | discount_account_name |
| item_custom_fields | item_custom_fields |
| hsn_or_sac | hsn_or_sac |
| warehouse_id | warehouse_id |
| location_id | location_id |
| serial_numbers | serial_numbers |
| batches | batches |
| gst_treatment_code | gst_treatment_code |
| tax_treatment_code | tax_treatment_code |
| is_item_shipped | is_item_shipped |
| invoice_item_id | invoice_item_id |
| invoice_id | invoice_id |
| is_returned_to_stock | is_returned_to_stock |
| salesreturn_item_id | salesreturn_item_id |
| project_id | project_id |
| pricebook_id | pricebook_id |
| is_discounted | is_discounted |
| tds_tax_id | tds_tax_id |
| unit | unit |
| unit_conversion_id | unit_conversion_id |
| code | code |
| revenue_recognition_rule_id | revenue_recognition_rule_id |
| service_start_date | service_start_date |
| allocation_mode | allocation_mode |
| recognition_type | recognition_type |
| revenue_recognition_deferred_account_id | revenue_recognition_deferred_account_id |
| service_end_date | service_end_date |
| asset_price | asset_price |
| item_meta_fields | item_meta_fields |
| sat_item_key_code | sat_item_key_code |
| unitkey_code | unitkey_code |
| modified_asset_price | modified_asset_price |
| non_taxable_amount | non_taxable_amount |
| identification_number | identification_number |
| storages | storages |
| tax_category | tax_category |
| sales_rate | sales_rate |
| label_rate | label_rate |
| product_tax_category | product_tax_category |
| mapped_items | mapped_items |
| tax_selection_mode | tax_selection_mode |
| line_item_taxes | line_item_taxes |
| line_item_tds | line_item_tds |
| taxes | taxes |
Set Single Line Items
This methods is to allowed for setting/updating a single line item in the current credit note. 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 :
creditnote.creation.sidebar
Sample Code :
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.set('creditnote.line_items[0]',{'rate':'1000'}).then(function (res) {
console.log('creditnote line item rate : ', res);
}).catch(function (err) {
console.log('Error while fetching creditnote line item rate : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| item_id | item_id |
| line_item_id | line_item_id |
| account_id | account_id |
| name | name |
| description | description |
| item_order | item_order |
| rate | rate |
| quantity | quantity |
| tax_id | tax_id |
| tags | tags |
Show More Supported Input Keys
| Property | Request |
|---|
| tax_exemption_code | tax_exemption_code |
| tax_exemption_id | tax_exemption_id |
| product_type | product_type |
| avatax_tax_code | avatax_tax_code |
| discount | discount |
| discounts | discounts |
| discount_account_id | discount_account_id |
| discount_account_name | discount_account_name |
| item_custom_fields | item_custom_fields |
| hsn_or_sac | hsn_or_sac |
| warehouse_id | warehouse_id |
| location_id | location_id |
| serial_numbers | serial_numbers |
| batches | batches |
| gst_treatment_code | gst_treatment_code |
| tax_treatment_code | tax_treatment_code |
| is_item_shipped | is_item_shipped |
| invoice_item_id | invoice_item_id |
| invoice_id | invoice_id |
| is_returned_to_stock | is_returned_to_stock |
| salesreturn_item_id | salesreturn_item_id |
| project_id | project_id |
| pricebook_id | pricebook_id |
| is_discounted | is_discounted |
| tds_tax_id | tds_tax_id |
| unit | unit |
| unit_conversion_id | unit_conversion_id |
| code | code |
| revenue_recognition_rule_id | revenue_recognition_rule_id |
| service_start_date | service_start_date |
| allocation_mode | allocation_mode |
| recognition_type | recognition_type |
| revenue_recognition_deferred_account_id | revenue_recognition_deferred_account_id |
| service_end_date | service_end_date |
| asset_price | asset_price |
| item_meta_fields | item_meta_fields |
| sat_item_key_code | sat_item_key_code |
| unitkey_code | unitkey_code |
| modified_asset_price | modified_asset_price |
| non_taxable_amount | non_taxable_amount |
| identification_number | identification_number |
| storages | storages |
| tax_category | tax_category |
| sales_rate | sales_rate |
| label_rate | label_rate |
| product_tax_category | product_tax_category |
| mapped_items | mapped_items |
| tax_selection_mode | tax_selection_mode |
| line_item_taxes | line_item_taxes |
| line_item_tds | line_item_tds |
| taxes | taxes |
Set Bulk Line Items
This methods is to allowed for replacing/updating all the existing line items in the current credit note. 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 :
creditnote.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('creditnote.line_items.bulk_update',lineItemMetaData).then(function (res) {
console.log('creditnote line items : ', res);
}).catch(function (err) {
console.log('Error while fetching creditnote line items : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| item_id | item_id |
| line_item_id | line_item_id |
| account_id | account_id |
| name | name |
| description | description |
| item_order | item_order |
| rate | rate |
| quantity | quantity |
| tax_id | tax_id |
| tags | tags |
Show More Supported Input Keys
| Property | Request |
|---|
| tax_exemption_code | tax_exemption_code |
| tax_exemption_id | tax_exemption_id |
| product_type | product_type |
| avatax_tax_code | avatax_tax_code |
| discount | discount |
| discounts | discounts |
| discount_account_id | discount_account_id |
| discount_account_name | discount_account_name |
| item_custom_fields | item_custom_fields |
| hsn_or_sac | hsn_or_sac |
| warehouse_id | warehouse_id |
| location_id | location_id |
| serial_numbers | serial_numbers |
| batches | batches |
| gst_treatment_code | gst_treatment_code |
| tax_treatment_code | tax_treatment_code |
| is_item_shipped | is_item_shipped |
| invoice_item_id | invoice_item_id |
| invoice_id | invoice_id |
| is_returned_to_stock | is_returned_to_stock |
| salesreturn_item_id | salesreturn_item_id |
| project_id | project_id |
| pricebook_id | pricebook_id |
| is_discounted | is_discounted |
| tds_tax_id | tds_tax_id |
| unit | unit |
| unit_conversion_id | unit_conversion_id |
| code | code |
| revenue_recognition_rule_id | revenue_recognition_rule_id |
| service_start_date | service_start_date |
| allocation_mode | allocation_mode |
| recognition_type | recognition_type |
| revenue_recognition_deferred_account_id | revenue_recognition_deferred_account_id |
| service_end_date | service_end_date |
| asset_price | asset_price |
| item_meta_fields | item_meta_fields |
| sat_item_key_code | sat_item_key_code |
| unitkey_code | unitkey_code |
| modified_asset_price | modified_asset_price |
| non_taxable_amount | non_taxable_amount |
| identification_number | identification_number |
| storages | storages |
| tax_category | tax_category |
| sales_rate | sales_rate |
| label_rate | label_rate |
| product_tax_category | product_tax_category |
| mapped_items | mapped_items |
| tax_selection_mode | tax_selection_mode |
| line_item_taxes | line_item_taxes |
| line_item_tds | line_item_tds |
| taxes | taxes |
Set Line Items Customfields
This method is allowed for setting/updating custom fields for line items in the current credit note. 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 :
creditnote.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('creditnote.line_items',lineItemMetaData).then(function (res) {
console.log('creditnote line items : ', res);
}).catch(function (err) {
console.log('Error while fetching creditnote line items : ', err);
});
});
}
Supported Input Keys :
| Property | Request |
|---|
| item_id | item_id |
| line_item_id | line_item_id |
| account_id | account_id |
| name | name |
| description | description |
| item_order | item_order |
| rate | rate |
| quantity | quantity |
| tax_id | tax_id |
| tags | tags |
Show More Supported Input Keys
| Property | Request |
|---|
| tax_exemption_code | tax_exemption_code |
| tax_exemption_id | tax_exemption_id |
| product_type | product_type |
| avatax_tax_code | avatax_tax_code |
| discount | discount |
| discounts | discounts |
| discount_account_id | discount_account_id |
| discount_account_name | discount_account_name |
| item_custom_fields | item_custom_fields |
| hsn_or_sac | hsn_or_sac |
| warehouse_id | warehouse_id |
| location_id | location_id |
| serial_numbers | serial_numbers |
| batches | batches |
| gst_treatment_code | gst_treatment_code |
| tax_treatment_code | tax_treatment_code |
| is_item_shipped | is_item_shipped |
| invoice_item_id | invoice_item_id |
| invoice_id | invoice_id |
| is_returned_to_stock | is_returned_to_stock |
| salesreturn_item_id | salesreturn_item_id |
| project_id | project_id |
| pricebook_id | pricebook_id |
| is_discounted | is_discounted |
| tds_tax_id | tds_tax_id |
| unit | unit |
| unit_conversion_id | unit_conversion_id |
| code | code |
| revenue_recognition_rule_id | revenue_recognition_rule_id |
| service_start_date | service_start_date |
| allocation_mode | allocation_mode |
| recognition_type | recognition_type |
| revenue_recognition_deferred_account_id | revenue_recognition_deferred_account_id |
| service_end_date | service_end_date |
| asset_price | asset_price |
| item_meta_fields | item_meta_fields |
| sat_item_key_code | sat_item_key_code |
| unitkey_code | unitkey_code |
| modified_asset_price | modified_asset_price |
| non_taxable_amount | non_taxable_amount |
| identification_number | identification_number |
| storages | storages |
| tax_category | tax_category |
| sales_rate | sales_rate |
| label_rate | label_rate |
| product_tax_category | product_tax_category |
| mapped_items | mapped_items |
| tax_selection_mode | tax_selection_mode |
| line_item_taxes | line_item_taxes |
| line_item_tds | line_item_tds |
| taxes | taxes |
Events
CREDITNOTE_SAVED
This event is triggered after the creditnote record is successfully saved in your organization. You can use this event to perform post-save actions such as syncing data, triggering notifications, or updating external systems.
Supported Locations :
creditnote.creation.sidebar
Sample Code :
ZFAPPS.extension.init().then(function(App) {
App.instance.on('ON_CREDITNOTE_SAVED').then(function(data) {
var recordId = data && data.record_id;
ZFAPPS.invoke('SHOW_NOTIFICATION', {
type: 'success',
message: 'Record saved successfully. Record ID: ' + recordId
});
console.log('Saved record ID:', recordId);
}).catch(function(err) {
console.error('Error:', err);
});
});
ON_CREDITNOTE_CHANGE
This event is triggered whenever a supported field value is changed within the creditnote form. The event is fired based on the configured supported keys, allowing your widget to react dynamically to user input.
Supported Locations :
creditnote.creation.sidebar
Sample Code :
ZFAPPS.extension.init().then(function(App) {
App.instance.on('ON_CREDITNOTE_CHANGE').then(async function() {
var record = await ZFAPPS.get('creditnote');
record = record?.['custom_fields'];
if (record.cf_special_flag) {
ZFAPPS.invoke('SHOW_NOTIFICATION', {
type: 'success',
message: 'Special option selected. Please review additional details before saving.'
});
}
}).catch(function(err) {
console.error('Error:', err);
});
});
ON_CREDITNOTE_PREVIEW
This event is triggered when the preview of a creditnote record is opened in your organization. It allows your widget to access record data and render contextual information during the preview phase.
Supported Locations :
creditnote.details.sidebar
Sample Code :
ZFAPPS.extension.init().then(function(App) {
App.instance.on('ON_CREDITNOTE_PREVIEW').then(async function() {
var record = await ZFAPPS.get('creditnote');
record = record?.['custom_fields'];
if (record.cf_priority_level === 'High') {
ZFAPPS.invoke('SHOW_NOTIFICATION', {
type: 'error',
message: 'This record is marked as High Priority.'
});
}
}).catch(function(err) {
console.error('Error:', err);
});
});
ON_CREDITNOTE_PRE_SAVE
This event is triggered just before the creditnote record is saved in your organization. It allows your widget to validate data, modify field values, or perform custom checks before the save operation is completed.
Supported Locations :
creditnote.creation.sidebar
Sample Code :
ZFAPPS.extension.init().then(function(App) {
App.instance.on('ON_CREDITNOTE_PRE_SAVE').then(async function() {
var record = await ZFAPPS.get('creditnote');
record = record?.['custom_fields'];
if (record.cf_approval_required && !record.cf_approval_notes) {
await ZFAPPS.invoke('SHOW_NOTIFICATION', {
type: 'error',
message: 'Approval notes are required when Approval Required is selected.'
});
return {
prevent_save: true
};
}
}).catch(function(err) {
console.error('Error:', err);
});
});
ON_CREDITNOTE_PAGE_LOAD
This event is triggered when the widget is loaded for the first time on the creditnote page. You can use this event to initialize data, fetch required resources, or set up the initial state of your widget.
Supported Locations :
creditnote.creation.sidebar
Sample Code :
ZFAPPS.extension.init().then(function(App) {
App.instance.on('ON_CREDITNOTE_PAGE_LOAD').then(async function() {
await ZFAPPS.set('creditnote.cf_priority_level', 'Normal');
ZFAPPS.invoke('SHOW_NOTIFICATION', {
type: 'success',
message: 'Default priority level has been set to Normal.'
});
}).catch(function(err) {
console.error('Error:', err);
});
});