熱烈歡迎我們的 網站的 新面貌!
我們很高興推出全新且改進的網站體驗!
我們一直在努力讓您的訪問更加愉快和資訊豐富。我們的新設計針對輕鬆導航、更快的載入時間和更直覺的使用者體驗進行了最佳化。
近期變化概覽:
該網站的設計考慮到了可訪問性,確保用戶可以輕鬆理解 VTAP 概念並使用其工具,而無需廣泛的編碼知識。每個範例都配有清晰的說明和螢幕截圖,使其易於遵循和實施。
這使得任何人,無論其技術背景如何,都可以自信地瀏覽該平台並充分利用其功能。
愉快的瀏覽!
VTAP 客戶用例
若要在 VTAP API 中管理行項目以更新記錄,新增或刪除項目時必須遵循特定格式。以下介紹如何在 VTAP API 中新增和刪除報價記錄的行項目。
新增行項目的範例程式碼:
// 假設您已經擁有現有的訂單項目詳細信息
let existingLineItems = { hdnProductId1:’<product_record_id>’, productName1: '<product_name>', comment1: '', qty1: 1, listPrice1: 700.00};
let existingLineItems = {
hdnProductId1:’<product_record_id>’,
productName1: '<product_name>',
comment1: '',
qty1: 1,
listPrice1: 700.00
};
// 將新行項目新增至現有報價記錄中
let newLineItem = { hdnProductId2: ‘<product_record_id>’, productName2: '<product_name>', comment2: '', qty2: 5, listPrice2: 500.00};
let newLineItem = {
hdnProductId2: ‘<product_record_id>’,
productName2: '<product_name>',
comment2: '',
qty2: 5,
listPrice2: 500.00
// 合併現有的和新的行項目
let params = { module: 'Quotes', id: quoteId, // replace with the actual Quote ID ...existingLineItems, ...newLineItem, totalProductCount: 2 // Update this count as per the total number of line items};
let params = {
module: 'Quotes',
id: quoteId, // replace with the actual Quote ID
...existingLineItems,
...newLineItem,
totalProductCount: 2 // Update this count as per the total number of line items
// 使用VTAP API發送請求
VTAP.Api.Put('records', params, (error, response) => { if (error) { console.error("Error adding line item:", error); } else { console.log("Line item added successfully:", response); }});
VTAP.Api.Put('records', params, (error, response) => {
if (error) {
console.error("Error adding line item:", error);
} else {
console.log("Line item added successfully:", response);
}
});
刪除行項目的範例程式碼:
// 取得現有的行項目並過濾掉要刪除的項目
let lineItems = { hdnProductId1:’<product_record_id>’, productName1: '<product_name>', comment1: '', qty1: 1, listPrice1: 700.00, hdnProductId2: ’<product_record_id>’, productName2: '<product_name>', comment2: '', qty2: 5, listPrice2: 500.00};
let lineItems = {
listPrice1: 700.00,
hdnProductId2: ’<product_record_id>’,
// 假設我們要刪除第二行項目
delete lineItems.hdnProductId2;delete lineItems.productName2;delete lineItems.comment2;delete lineItems.qty2;delete lineItems.listPrice2;
delete lineItems.hdnProductId2;
delete lineItems.productName2;
delete lineItems.comment2;
delete lineItems.qty2;
delete lineItems.listPrice2;
// 使用剩餘的行項目更新有效負載
let updatedPayload = { module: 'Quotes', id: quoteId, // replace with the actual Quote ID ...lineItems, totalProductCount: 1 // Update the count as needed};
let updatedPayload = {
...lineItems,
totalProductCount: 1 // Update the count as needed
// 發送更新後的請求
VTAP.Api.Post('records', updatedPayload, (error, response) => { if (error) { console.error("Error deleting line item:", error); } else { console.log("Line item deleted successfully:", response); }});
VTAP.Api.Post('records', updatedPayload, (error, response) => {
console.error("Error deleting line item:", error);
console.log("Line item deleted successfully:", response);
註冊以接收最新更新!
我看過了 如何得知我們? Vtiger。