Posts

Showing posts from December, 2022

SuiteScript : Defaulting Tax Code at Line Level

Image
Script Difficulty: 💚 Here is a time where you would like to set the tax code at the line level to select a certain tax.  This is an alternative solution to demonstrate that you can consider scripting to implement at the line level.  The solution also combined with a control point visible to the user for triggering of the script actions. Exercise goal: for all Invoices, have a custom checkbox that controls the triggering of setting tax code to NoTax to every line and override the tax to zero at save. Create a new custom checkbox and give it a good name, in our case it's Wipe Tax.  Set the checkbox's internal ID to custbody_wipetax .  Customization > Scripting > Scripts > New Script Under Script File field, upload the JavaScript  > Create Script Record > User Event Give it a good name. Under Script tab, set BEFORE SUBMIT FUNCTION to userEventBeforeSubmit . Under Deployments tab, apply the script to Invoice.  Give a good deploy name, set Deploy...

Saved Search Build : Find And Replace Substrings

Image
Build Difficulty: 💗💗💗💗 The time has come that you need to find certain string in the column and replace it with a hard-coded ones.  Additionally, we are combining this search & replace with a nested comparison logic. Exercise goal: look at the Posting Period and replace with the first of the month instead of of the abbreviations in the results.  For example, transform from "Feb 2022" to "2-1-2022". TRANSACTION search CRITERIA Posting = T RESULTS Document Number Formula Text = "CASE WHEN REGEXP_SUBSTR({postingperiod},'\A\w\w\w\s')='Jan ' THEN REGEXP_REPLACE({postingperiod},'\A\w\w\w\s','1-1-') WHEN REGEXP_SUBSTR({postingperiod},'\A\w\w\w\s')='Feb ' THEN REGEXP_REPLACE({postingperiod},'\A\w\w\w\s','2-1-') WHEN REGEXP_SUBSTR({postingperiod},'\A\w\w\w\s')='Mar ' THEN REGEXP_REPLACE({postingperiod},'\A\w\w\w\s','3-1-') WHEN REGEXP_SUBSTR({postingperiod},'\A\w\...