Posts

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\...

Saved Search Build : Just the Posted Transaction Lines

Image
Build Difficulty: 💗💗 This one is for when you like to get only the posting lines that are created or approved within the x amount of days as specified.  These will be in the GL accounts and you should not be seeing any sales order, purchase orders, and requisitions.  Also, you should not see any unapproved transactions. TRANSACTION search CRITERIA ( Type is Journal OR Main Line = F ) AND (( System Notes : Field = Posting Period AND System Notes : New Vale is not empty AND System Notes : within 5 days ago and 1 days ago ) OR ( Posting = T AND Date is within 5 days ago and 1 days ago )) RESULTS Internal ID Document ID Date Period Account : Number Type Amount Word of Wisdom In this example the x day is set to 5, obviously you may interchange this as you wish. When posting period is not empty it would imply posting is true. Journals do not have the notion of main lines.  In fact, if you try to look for main line in journals you will see return of null value (this is also a ...

Saved Search Build : Full Licensed Users Last Sign In

Image
Build Difficulty: 💗 This one is for when you would like to find out the last successful login of a full licensed user.  If a full licensed user have not login for a while, you can probably take them out to repurpose it for another user.  This also helps so you do not have to purchase additional user subscriptions. EMPLOYEE search CRITERIA Login Audit Trail : Status = Success Role : Center Type != Employee Center RESULTS Name (Group) Login Audit Trail : Date (Maximum) Role (Count) Word of Wisdom The performance of this can get slow when you get a larger set of data, in particular, large amount of users with frequent usage (in such case, you might want to consider filtering the audit dates).  Note that this search accounted for how many full licensed roles the user currently have.  It is when the administrator removes all full licensed roles then the provision is released back.

Saved Search Build : Employee Center Users Last Sign In

Image
Build Difficulty: 💗 This one is for when you would like to find out the last successful login of an employee center licensed user (also refer here as an employee user).  If an employee user have not login for a while, you can probably take them out to repurpose it for another user.  This also helps so you do not have to purchase additional user subscriptions. EMPLOYEE search CRITERIA Login Audit Trail : Status = Success Role : Center Type = Employee Center RESULTS Name (Group) Login Audit Trail : Date (Maximum) Role (Count) Word of Wisdom The performance of this can get slow when you get a larger set of data, in particular, large amount of users with frequent usage (in such case, you might want to consider filtering the audit dates).  Note that this search accounted for how many employee licensed roles the user currently have.  It is when the administrator removes all those roles then the provision is released back.