Cスクリプトを利用して年齢を即時に算出する

Cスクリプトを利用して年齢を即時に算出する

あらかじめ連絡先タブに項目=年齢(API name = Nenrei)を追加


let birth = ZDK.Page.getField('Date_of_Birth');
let birthd = birth.getValue();

// 誕生日を保持したDateインスタンスを生成
var birthday = new Date(birthd);
// 今日の日付を保持したDateインスタンスを生成
var today = new Date();

// 現在の年から誕生年を減算
var age = today.getFullYear() - birthday.getFullYear();

// 現在の年で誕生日が来ていなければ減算
if ( today < birthday.setFullYear( today.getFullYear() ) ){
age--;
}
let agedate = ZDK.Page.getField('Nenrei');
agedate.setValue(age);


      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ



                                ご検討中の方