© Oracle | NetSuite Inc. 2018 Technical Part MPH_ACEN - SUITEBUILDER Žampiónový krém 2 © Oracle | NetSuite Inc. 2018 OUTLINE • Introduction • Technical part logistics • Syllabus 3 © Oracle | NetSuite Inc. 2018 INTRODUCTION •Libor Nekula • ESF Graduate − Economic Information Systems − Business Management • 4 years technical consultant in Y Soft • 2 years senior technical consultant in NS − Consultant + developer − Code review owner − Technical interviewer 2006 2012 2016+ 4 © Oracle | NetSuite Inc. 2018 LOGISTICS OF TECHNICAL PART • 6 Sections • 6 Assignments − 5 points per assignment − 1 extra point when submitted via Git repository • Final written exam/test − 25 points 5 © Oracle | NetSuite Inc. 2018 TECHNICAL PART SYLLABUS SuiteCloud SuiteBuilder • Advanced PDF SuiteScript SuiteFlow Electronic Funds Transfer © Oracle | NetSuite Inc. 2018 MPH_ACEN - SUITEBUILDER 7 © Oracle | NetSuite Inc. 2018 AGENDA • General Overview – NS Anatomy • Initial setup • Custom fields • Custom forms • Custom records SuiteCloud SuiteBuilder • Advanced PDF SuiteScript SuiteFlow 8 © Oracle | NetSuite Inc. 2018 NetSuite Anatomy Record Form Field Subtab Custom List Sublist Script 9 © Oracle | NetSuite Inc. 2018 WALKTHROUGHS 10 © Oracle | NetSuite Inc. 2018 INITIAL SETUP • Show internal ids − Home icon > Set Preferences • Custom Records − Setup > Company > Enable features > SuiteCloud 11 © Oracle | NetSuite Inc. 2018 WT I - Creating a new custom list and subtab • Customization > Forms > Subtabs • Customization > Lists, Records, Fields > Lists https://system.netsuite.com/app/help/helpcenter.nl?fid=section_n2852278.html BEST PRACTICE FOR INTERNAL ID include _acen_sec Example: _acen_sec_voucher_code 12 © Oracle | NetSuite Inc. 2018 WT II - Creating a new custom field • Customization > Lists, Records, Fields > − Item − Entity − Transaction https://system.netsuite.com/app/help/helpcenter.nl?topic=EDIT_CUSTENTITYFIELD BEST PRACTICE FOR INTERNAL ID include _acen_sec Example: _acen_sec_voucher_code 13 © Oracle | NetSuite Inc. 2018 WT III - Creating custom record • Customization > Lists, Records, Fields > Record Types https://system.netsuite.com/app/help/helpcenter.nl?topic=EDIT_CUSTRECORD BEST PRACTICE FOR INTERNAL ID include _acen_sec Example: _acen_sec_voucher_code 14 © Oracle | NetSuite Inc. 2018 WT IV - Creating custom Form https://system.netsuite.com/app/help/helpcenter.nl?topic=EDIT_CUSTENTITYFIELD BEST PRACTICE FOR INTERNAL ID include _acen_sec Example: _acen_sec_voucher_code 15 © Oracle | NetSuite Inc. 2018 WT V – Creating a new script 16 © Oracle | NetSuite Inc. 2018 • &xml=t VIEWING FIELD IDS • Via field help © Oracle | NetSuite Inc. 2018 MPH_ACEN - SUITEFLOW Žampiónový krém 18 © Oracle | NetSuite Inc. 2018 MINOR CHANGES IN LOGISTICS • First Assignment deadline – Fri, Nov 9, 2018 • Submissions done on or before Tue, Nov 6, 2018 for 1 bonus point • 5 Late Days for everyone applicable to Assignments 2-6 − 5x 1 day later − 1x 5 days later 19 © Oracle | NetSuite Inc. 2018 INITIAL QUICK SETUP • Show internal ids − Home icon > Set Preferences • SuiteFlow − Setup > Company > Enable features > SuiteCloud • Invoice in Advance of Fulfillment − Setup > Accounting > Accounting Preferences > Order Management 20 © Oracle | NetSuite Inc. 2018 INSTALLING A BUNDLE • MPH_ACEN_I – 256797 21 © Oracle | NetSuite Inc. 2018 A BIT OF THEORY • What is SuiteFlow? • Workflow elements − States − Transitions − Actions − Triggers 22 © Oracle | NetSuite Inc. 2018 Triggers 23 © Oracle | NetSuite Inc. 2018 NEW WORKFLOW • Customization > Workflow > Workflows > New • Necessary values 24 © Oracle | NetSuite Inc. 2018 NEW WORKFLOW II • Necessary values 25 © Oracle | NetSuite Inc. 2018 WALKTHROUGHS – Create and deploy a new workflow 26 © Oracle | NetSuite Inc. 2018 SIMPLE WORKFLOW SET DEPARTMENT AND SHOW CONFIRMATION 27 © Oracle | NetSuite Inc. 2018 MULTI-STATE WORKFLOW CUSTOM APPROVE © Oracle | NetSuite Inc. 2018 MPH_ACEN - SUITESCRIPT Žampiónový krém 29 © Oracle | NetSuite Inc. 2018 AGENDA I - SUITESCRIPT • NS Data architecture • Client Scripts • User Event Scripts SuiteCloud SuiteBuilder • Advanced PDF SuiteScript SuiteFlow 30 © Oracle | NetSuite Inc. 2018 AGENDA II – SUITESCRIPT TODAY • NS Data architecture • Client vs Server • Demo + Script anatomy • Walkthroughs 31 © Oracle | NetSuite Inc. 2018 DEMO - OUR FIRST SCRIPT – HELLO WORLD! 32 © Oracle | NetSuite Inc. 2018 INSTALLING A BUNDLE • MPH_ACEN_III – 257612 33 © Oracle | NetSuite Inc. 2018 • Validate Field • Save record • HAS TO RETURN BOOL (T/F) value ENTRY POINTS • Page init • Field changed 34 © Oracle | NetSuite Inc. 2018 WALKTHROUGH – SAMPLE SCRIPT CREATION AND DEPLOYMENT © Oracle | NetSuite Inc. 2018 MPH_ACEN – SUITESCRIPT II Žampiónový krém 36 © Oracle | NetSuite Inc. 2018 AGENDA – SUITESCRIPT TODAY • Example of what can be done with SuiteScript • Server side scripts – User Event + triggers • Demo + Script anatomy • Walkthrough 37 © Oracle | NetSuite Inc. 2018 EXAMPLES • RESTlet • Suitelet + Client + Map/Reduce 38 © Oracle | NetSuite Inc. 2018 • Before Load • Before Submit • After Submit USER EVENT 39 © Oracle | NetSuite Inc. 2018 INSTALLING A BUNDLE • MPH_ACEN_IV – 258465 40 © Oracle | NetSuite Inc. 2018 WALKTHROUGH – SAMPLE SCRIPT © Oracle | NetSuite Inc. 2018 PRINTING NS DOCUMENTS 42 © Oracle | NetSuite Inc. 2018 PRINTING AND ADVANCED PDFS • Printing documents in NetSuite is simple 43 © Oracle | NetSuite Inc. 2018 PRINTING SETUP AND TEMPLATE CUSTOMIZATION 1. Let’s customize an invoice PDF template − WYSIWYG − Freemarker - https://freemarker.apache.org/docs/index.html 2. Create a new transaction form to use our template for printing − Select printing type − And template 44 © Oracle | NetSuite Inc. 2018 INTRO TO ADVANCED PDF/HTML TEMPLATES 45 © Oracle | NetSuite Inc. 2018 Advanced PDF/HTML Templates − Advanced PDF/HTML is a template-based model for printing transactions − Output is either HTML or PDF (we will focus on the PDF output) − Feature supports an alternate model for customizing printed transactions − The template editor uses FreeMarker-based syntax 46 © Oracle | NetSuite Inc. 2018 How does it work? The PDF printing subsystem uses a combination of two 3rd party libraries • FreeMarker scripting in XML, generates static XML for BFO • BFO (Big Faceless Report Generator) Freemarker  PDF 47 © Oracle | NetSuite Inc. 2018 BASIC CODING 48 © Oracle | NetSuite Inc. 2018 BASIC JAVASCRIPT/Freemarker - EXPRESSIONS • Expressions are usually surrounded by ${} • Variable is accessed by its name ${record.total} − Conditions <# if record.total > 0 > • Support for map keys and collection indexes ${person.phones[1]} • Logical operations: &&, ||, !, ==, !=, <, >, <=, >= 49 © Oracle | NetSuite Inc. 2018 BASIC JAVASCRIPT/Freemarker - CONDITIONS • <#if expression>, <#elseif expression>, <#else> • <#if> is pair tag, it must be closed • Character < must be escaped or surrounded by () , <#if x > 1 > vs. <#if (x > 1)> <#if x == 1> “x is 1” <#elseif x == 2> “x is 2“ <#elseif x == 3> “x is 3” 50 © Oracle | NetSuite Inc. 2018 UPLOAD AN IMAGE • Documents > Files > Images > New 51 © Oracle | NetSuite Inc. 2018 WALKTHROUGH – SAMPLE PDF 52 © Oracle | NetSuite Inc. 2018 THANK YOU FOR ATTENTION!