熱烈歡迎我們的 網站的 新面貌!

我們很高興推出全新且改進的網站體驗!

我們一直在努力讓您的訪問更加愉快和資訊豐富。我們的新設計針對輕鬆導航、更快的載入時間和更直覺的使用者體驗進行了最佳化。

近期變化概覽:

  • 增強的導航: 透過我們簡化的選單結構快速輕鬆地找到您需要的內容。
  • 改進的內容組織: 我們的內容現在組織得更好並且更容易理解。
  • 針對行動裝置進行了最佳化: 無論您使用的是桌上型電腦還是智慧型手機,我們的網站看起來都很棒且功能也很流暢。
  • 增強的搜尋功能: 透過我們改進的搜尋功能準確找到您正在尋找的內容。

該網站的設計考慮到了可訪問性,確保用戶可以輕鬆理解 VTAP 概念並使用其工具,而無需廣泛的編碼知識。每個範例都配有清晰的說明和螢幕截圖,使其易於遵循和實施。 

這使得任何人,無論其技術背景如何,都可以自信地瀏覽該平台並充分利用其功能。

愉快的瀏覽!

 
 
 

VTAP 客戶用例

 
 
如何使用 VTAP API 更新/刪除庫存行項目?

若要在 VTAP API 中管理行項目以更新記錄,新增或刪除項目時必須遵循特定格式。以下介紹如何在 VTAP API 中新增和刪除報價記錄的行項目。

新增行項目
  • 取得現有的行項目: 首先,檢索報價記錄的所有現有行項目。
  • 建置有效負載: 將所有現有行項目包含在負載中,並依序附加新的行項目詳細資訊。
  • 透過總產品數: 負載應包含totalProductCount參數以指示行項目的數量。
 

如何使用 VTAP API 更新/刪除庫存行項目?

若要在 VTAP API 中管理行項目以更新記錄,新增或刪除項目時必須遵循特定格式。以下介紹如何在 VTAP API 中新增和刪除報價記錄的行項目。

新增行項目
  • 取得現有的行項目: 首先,檢索報價記錄的所有現有行項目。
  • 建置有效負載: 將所有現有行項目包含在負載中,並依序附加新的行項目詳細資訊。
  • 透過總產品數: 負載應包含totalProductCount參數以指示行項目的數量。
 
 
 

新增行項目的範例程式碼:

 
 

// 假設您已經擁有現有的訂單項目詳細信息

 

// 假設您已經擁有現有的訂單項目詳細信息


  

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發送請求


  

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 = {

    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

};

 

// 假設我們要刪除第二行項目

 

// 假設我們要刪除第二行項目


  

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 = {

    module: 'Quotes',

    id: quoteId, // replace with the actual Quote ID

    ...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) => {

    if (error) {

        console.error("Error deleting line item:", error);

    } else {

        console.log("Line item deleted successfully:", response);

    }

});

 
 

註冊以接收最新更新!