Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          copyAttachmentAsync()

          copyAttachmentAsync()

          This Framework function is used to copy the file and the related thumbnails.

          Required Editions

          Available in Lightning Experience in Professional, Unlimited, and Enterprise Editions that have Consumer Goods Cloud enabled.

          Parameters

          • srcBlobPkey: is the Pkey of the source from where the attachment is copied. The value of the parameter should be a non-empty string.

          • destBlobPkey: is the Pkey of the destination to which the attachment is copied. The value of the parameter should be a non-empty string.

          • tableName: table in which the Pkey would be used. The value of the parameter should be a non-empty string.

          Returns

          • result(promise): The API returns a promise.The fulfilled promise contains the result. If invalid input parameters are given, the promise is rejected.

          Example

          var srcPkey = "00100000003ifwfs",
          destPkey = "fs1000fw00i31100",
          tableName = "BpaAttachment";
          Facade.copyAttachmentAsync(srcPkey , destPkey, tableName).then(
          function (info) {
          // info is an object containing the following properties -
          // info.width = 100
          // info.height = 200
          // info.path = "BpaAttachmentBlob/fs1000fw00i31100.png"
          console.log("copy file success:" + JSON.stringify(info));
          },
          function (error) {
          console.log("copy file failure:" + JSON.stringify(error));
          });
           
          Loading
          Salesforce Help | Article