ライターでマージAPIを使用してサブフォームフィールドをマージする方法

ライターでマージAPIを使用してサブフォームフィールドをマージする方法

お知らせ:当社は、お客様により充実したサポート情報を迅速に提供するため、本ページのコンテンツは機械翻訳を用いて日本語に翻訳しています。正確かつ最新のサポート情報をご覧いただくには、本内容の英語版を参照してください。


普通のフィールドとRLフィールドの両方を含むMergeテンプレートの例:

こんにちは<<連絡先。名>>
<<連絡先。メール>>宛にメールを送信する

請求書所有者
請求書番号
作成者
期限
<<請求書。請求書所有者>>
<<請求書。請求書番号>>
<<請求書。作成者>>
<<請求書。期限>>

商品コード

商品説明

数量

単価

 

«商品。Product_Code»

 

«商品。Product_Description»

 

«商品。Item_Quantity»

 

«商品。Item_Price»


2. サンプルコード(番号)リアルタイムフィールド情報の取得

fields = invokeurl
[
type: GET
connection:'writercrm'
];
info fields;

document_id
-> 文書の表示urlから取得できます: https://{{domain}}/writer/表示/eb4kob4cf65bb6d074af****************
例: document_id='eb4kob4cf65bb6d074af****************'

connection_name -> DelugeにおけるConnectionとその作成方法については、このリンクを参照してください。
例: connection_name='writer_name'

手順 2のサンプルレスポンス:

 

{

'merge': [

{

'id': 'First_Name',

'groupname': '連絡先',

'display_name': '名',

'type': 'text'

},

{

'id': 'メール',

'groupname': '連絡先',

'display_name': 'メール',

'type': 'email'

},

{

'id': '請求書',

'display_name': '請求書',

'type': 'subform',

'fields': [

{

'id': '請求書。所有者',

'groupname': '請求書',

'display_name': '請求書所有者',

'type': 'text'

},

{

'id': '請求書。Invoice_Number',

'groupname': '請求書',

'display_name': '請求書番号',

'type': 'number'

},

{

'id': '請求書。Created_By',

'groupname': '請求書',

'display_name': '作成者',

'type': 'text'

},

{

'id': '請求書。Due_Date',

'groupname': '請求書',

'display_name': '期限',

'type': 'text'

}

]

},

{

'id': '商品',

'display_name': '商品',

'type': 'subform',

'fields': [

{

'id': '商品。Product_Code',

'groupname': '商品',

'display_name': '商品 コード',

'type': 'text'

},

{

'id': '商品。Product_Description',

'groupname': '商品',

'display_name': '製品の説明',

'type': 'text'

},

{

'id': '商品。Item_Quantity',

'groupname': '商品',

'display_name': '商品 数量',

'type': 'number'

},

{

'id': '商品。Item_Price',

'groupname': '商品',

'display_name': '商品 価格',

'type': 'number'

}

]

}

],

'sign': {},

'fill': {}

3. サンプル番号のRLフィールドをdelugeを利用してマッピングする


invoicesRecords = zoho.crm.getRecordById('請求書', invoiceId);

 

CustomerInvoice = Map();

CustomerInvoice.put('First_Name', invoicesRecords.get('Account_Name').get('name'));

CustomerInvoice.put('メール', invoicesRecords.get('Account_Name').get('id'));

 

invoicesList = list();

invoiceDetails = Map();

 

invoiceDetails.put('請求書。所有者', invoicesRecords.get('所有者').get('name'));

invoiceDetails.put('請求書。Invoice_Number', invoicesRecords.get('Invoice_Number'));

invoiceDetails.put('請求書。Created_By', invoicesRecords.get('Created_By').get('name'));

invoiceDetails.put('請求書。Due_Date', invoicesRecords.get('Due_Date'));

invoicesList.add(invoiceDetails);

 

productList = list();

productDetails = Map();

productDetails.put('商品。Product_Code', invoicesRecords.get('Product_Code'));

productDetails.put('商品。Product_Description', invoicesRecords.get('Product_Description'));

productDetails.put('商品。Item_Quantity', invoicesRecords.get('Item_Quantity'));

productDetails.put('商品。Item_Price', invoicesRecords.get('Item_Price'));

productList.add(productDetails);

 

 

CustomerInvoice.put('請求書', invoicesList);

CustomerInvoice.put('商品', productList)

 

 

mergedata = Map();

mergedata.put('merge_data', {'data': CustomerInvoice});

mergedata.put('subject', '請求書の詳細');

 

//optional

mergedata.put('message', '請求書が添付されていますので、ご確認ください。');

情報 合併データ;

 

zoho。writer。mergeAndSend('eb4kob4cf65bb6d074af7a7de21e561119eb9', 'pdf', invoicesRecords。get('email'), 合併データ, 'writer_name');

4. API を通じた RL フィールドを含むサンプル JSON データ

{

'data': [

{

'First_Name': 'アメリア',

'メール': 'amelia@zylker。com',

'請求書': [

{

'請求書。所有者': 'ジョン',

'請求書。Invoice_Number': 1279,

'請求書。Created_By': 'アメリア',

'請求書。Due_Date': '2020/07/10'

}

]

'商品': [

{

'商品。Product_Code': 'A123',

'商品。Product_Description': '電話ケース',

'商品。Item_Quantity': 2,

'商品。Item_Price': 1000

}

]

}

]

}
利用可能なすべてのマージフィールドタイプの値をどのように渡すかについての情報は、こちらのリンクをご参照ください。

    Zoho CRM 管理者向けトレーニング

    「導入したばかりで基本操作や設定に不安がある」、「短期間で集中的に運用開始できる状態にしたい」、「運用を開始しているが再度学び直したい」 といった課題を抱えられているユーザーさまに向けた少人数制のオンライントレーニングです。

    日々の営業活動を効率的に管理し、導入効果を高めるための方法を学びましょう。

    Zoho CRM Training



              Zoho WorkDrive Resources



                Zoho Desk Resources

                • Desk Community Learning Series


                • Digest


                • Functions


                • Meetups


                • Kbase


                • Resources


                • Glossary


                • Desk Marketplace


                • MVP Corner


                • Word of the Day









                                  Resources

                                  Videos

                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                  eBooks

                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                  Webinars

                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                  CRM Tips

                                  Make the most of Zoho CRM with these useful tips.