[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-703152-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-703152-en":130,"doc-similar-703152":162},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","apex-tutorial-salesforce-apex-programming-basics","Apex Tutorial - Salesforce Apex Programming Basics","","Apex is a strongly typed, object-oriented programming language used on the Force.com platform with the Force.com API, enabling developers to run flow and transaction control statements. The tutorial targets Salesforce programmers new to Apex, guiding learners from foundational concepts to an intermediate level through hands-on code. It outlines required Salesforce platform knowledge, assumes the Salesforce instance is already set up for practice, and provides clear guidance on key topics such as syntax, the environment, data types, variables, and decision making.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/apex-tutorial-salesforce-apex-programming-basics/703152/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/apex-tutorial-salesforce-apex-programming-basics/703152.png","ImageObject",300,407,{"name":42,"@type":43},"nayy☆","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-22","2026-11-13",true,{"@type":52,"interactionType":53,"userInteractionCount":33},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What is Apex and what is it used for?","Question",{"text":62,"@type":63},"Apex is a strongly typed, object-oriented programming language on the Force.com platform. It lets developers execute flow and transaction control statements together with Force.com API calls.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"Who is this tutorial intended for?",{"text":67,"@type":63},"The tutorial is targeted for Salesforce programmers beginning to learn Apex, aiming to build competence up to an intermediate level.",{"name":69,"@type":60,"acceptedAnswer":70},"What prerequisites are required before starting?",{"text":71,"@type":63},"Basic knowledge of the Salesforce platform and development is needed. It also assumes the learner has already set up the Salesforce instance used for Apex programming.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},703152,1794561718,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":33,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":79,"read_time":144,"preview_page_count":33,"preview_urls":145},962090893153,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","About the Tutorial  \n\n| Apex is a proprietary language developed [by Salesforce.com. It](by Salesforce.com. It) is a strongly typed, objectoriented programming language that allows developers to execute flow and transaction control statements on the [Force.com](Force.com) platform server in conjunction with calls to the [Force.com](Force.com) API.\u003Cbr>Audience |\n| --- |\n| This tutorial is targeted for Salesforce programmers beginning to learn Apex. This will bring you to an Intermediate level of expertise in Apex programming covering all the important aspects of Apex with complete hands-on code experience.\u003Cbr>Prerequisites |\n| Basic knowledge of Salesforce platform and development is needed. Apex is a programming language which has to be used with Salesforce. This tutorial assumes that you already have set up the Salesforce instance which will be used to do our Apex programming.\u003Cbr>Copyright & Disclaimer |\n\n􀂤 Copyright 2017 by Tutorials Point (I) Pvt. Ltd.  \nAll the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher.  \nWe strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website orin this tutorial, please notify us at [contact@tutorialspoint.com](contact@tutorialspoint.com)  \nTable of Contents  \nAbout the Tutorial.................................................................................................................................... i  \nAudience .................................................................................................................................................. i  \nPrerequisites ............................................................................................................................................ i  \nCopyright & Disclaimer............................................................................................................................. i  \nTable of Contents .................................................................................................................................... ii  \n1. APEX – OVERVIEW ............................................................................................................... 1  \nWhat is Apex? .........................................................................................................................................1  \nFeatures of Apex as a Language ..............................................................................................................1  \nWhen Should Developer Choose Apex?...................................................................................................2  \nFlow of Actions........................................................................................................................................3  \nUnderstanding the Apex Syntax ..............................................................................................................3  \n2. APEX – ENVIRONMENT ........................................................................................................ 5  \nExecuting Code in Developer Console .....................................................................................................7  \n3. APEX – EXAMPLE ............................................................................................................... 10  \nEnterprise Application Development Example ...................................................................................... 10  \nCreating the Custom Fields for Customer object ........","cbCaicq9ijzuHBv4","https://ap.wps.com/l/cbCaicq9ijzuHBv4","pdf",2018338,27,"English","# 1. APEX – OVERVIEW\n## What is Apex?\n## Features of Apex as a Language\n## When Should Developer Choose Apex?\n## Flow of Actions\n## Understanding the Apex Syntax\n# 2. APEX – ENVIRONMENT\n## Executing Code in Developer Console\n# 3. APEX – EXAMPLE\n## Enterprise Application Development Example\n## Creating the Custom Fields for Customer object\n## Creating Invoice Object\n## Creating the Custom Fields for Invoice object\n# 4. APEX – DATA TYPES\n## Understanding the Data Types\n## Primitive Data Types\n# 5. APEX – VARIABLES\n# 6. APEX – STRINGS\n## String Methods\n# 7. APEX – ARRAYS\n# 8. APEX – CONSTANTS\n# 9. APEX – DECISION MAKING\n## Apex- if statement\n## Apex – if else statement\n## Apex- if elseif else statement","[{\"question\":\"What is Apex and what is it used for?\",\"answer\":\"Apex is a strongly typed, object-oriented programming language on the Force.com platform. It lets developers execute flow and transaction control statements together with Force.com API calls.\"},{\"question\":\"Who is this tutorial intended for?\",\"answer\":\"The tutorial is targeted for Salesforce programmers beginning to learn Apex, aiming to build competence up to an intermediate level.\"},{\"question\":\"What prerequisites are required before starting?\",\"answer\":\"Basic knowledge of the Salesforce platform and development is needed. It also assumes the learner has already set up the Salesforce instance used for Apex programming.\"}]","Apex Tutorial - Salesforce Apex Programming Basics | PDF",68,[146,150,154,158],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-13/ba8596b548a5e943c7ceb414739de9f7.webp",983,1390,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-13/83fd0ccc299d0ea53d780a12c28d9809.webp",982,1388,{"page_no":30,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-13/565ff00356dd9eb67bd05a617295ba29.webp",981,1387,{"page_no":33,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-13/baa6e749f7c954ccae2d82f8726813fd.webp",980,1385,{"list":163,"token":11},[164,170,176,181,187,193,199,206,212,219],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":33,"category_name":29,"create_tm":169},703154,"Record Logger Developer Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230013421135/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=94HaZqC01qkRs3XMdekoWKa5PKo%3D","record-logger-developer-guide",1794561726,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":30,"category_name":29,"create_tm":175},703155,"Salesforce Knowledge Developer Guide - Chapter 1 Developing with Salesforce Knowledge","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230013421037/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=W6Tx5RjlNXe%2BYEXI98jZ%2B%2BxFZQk%3D","salesforce-knowledge-developer-guide-chapter-1-developing-with-salesforce-knowledge",1794561727,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":110,"category_name":29,"create_tm":79},703151,"Salesforce Maps Apex Developer Guide - Version 68.0 - Winter ’27","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230013420978/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=I%2B0uJmv%2FDrgywDRT6ooEX61rrSc%3D","salesforce-maps-apex-developer-guide-version-680-winter-27",{"doc_id":182,"doc_title":183,"file_type":137,"home_preview_img_url":184,"slug":185,"view_count":33,"category_name":29,"create_tm":186},703158,"Salesforce Apex Design Patterns - Architecting Salesforce solutions with Apex design patterns","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230013421203/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=gcRy6L%2B%2BawhaxUnRvqyBT10u7IM%3D","salesforce-apex-design-patterns-architecting-salesforce-solutions-with-apex-design-patterns",1794561732,{"doc_id":188,"doc_title":189,"file_type":137,"home_preview_img_url":190,"slug":191,"view_count":105,"category_name":29,"create_tm":192},681827,"Platform Events Developer Guide - Version 68 - Developer guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999226531/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=FlbTCCVjptRU0mgPlO%2FnC0x5tXc%3D","platform-events-developer-guide-version-68-developer-guide",1793954888,{"doc_id":194,"doc_title":195,"file_type":137,"home_preview_img_url":196,"slug":197,"view_count":33,"category_name":29,"create_tm":198},697965,"Arrays Made Easy - An Introduction to Arrays and Array Processing - SUGI 30 Tutorials","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146275/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=vsLldAzxcyTCwEu%2BGnASZJXnFxQ%3D","arrays-made-easy-an-introduction-to-arrays-and-array-processing-sugi-30-tutorials",1794446535,{"doc_id":200,"doc_title":201,"file_type":137,"home_preview_img_url":202,"slug":203,"view_count":204,"category_name":29,"create_tm":205},656406,"Apex Developer Guide - Version 68.0 - Winter ’27","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975308709/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=f5BclvKtfW0r6u4gYDjefNf2pJw%3D","apex-developer-guide-version-680-winter-27",22,1792968277,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":105,"category_name":29,"create_tm":211},701324,"IRAS API Services - Interface Specifications - Submission of Donation Records (Corppass) - Version 1.4","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012290377/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=1P33JnRn%2BxNFZ7edqsiddgi%2B%2BiM%3D","iras-api-services-interface-specifications-submission-of-donation-records-corppass-version-14",1794527459,{"doc_id":213,"doc_title":214,"file_type":137,"home_preview_img_url":215,"slug":216,"view_count":217,"category_name":29,"create_tm":218},347077,"Thinking in Java - 4th Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910997714/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=WNR5MPYvI9snRA1L4xmwqffS9Tg%3D","thinking-in-java-4th-edition",18,1790065169,{"doc_id":220,"doc_title":221,"file_type":137,"home_preview_img_url":222,"slug":223,"view_count":105,"category_name":29,"create_tm":224},700982,"Java Scripting Programmer's Guide - Release 11","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011575643/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110859&Signature=iWc%2FgFKdA%2BjsrwRV87SU5ei6B74%3D","java-scripting-programmers-guide-release-11",1794522624]