I need to get the text (display) value of a field in order to compare the date ranges of the posting period. Below is my formula, I am pushing filter filter array with other filters which I need to run
var column = []; Columns Push (new nlobj search column ('transaction number')); Columns Push (new nlobj search column ('line')); Columns Push (new nlobj search column ('item')); Columns Push (new nlobj search column ('account')); Columns Push (new nlobj search column ('zodiac')); Columns Push (new nlobj search column ('vsoeallocation')); Columns Push (new nlobj searchcollection ('Posting Period')); Columns Pash (new nlobj searchcolom ('srctranpostperiod', 'revrecschedule')); Columns Push (New NLobes Search Column ('Rikarmount', 'Riversideul')); Columns Push (New NLobes Search Columns ('Jadock', 'Riversideual')); Columns [0] .setSort (); Columns [1] .setSort (); Var filter = []; Var formula = "case when TO_DATE ({postingperiod.displayname}, 'mn y y y y')) gt =" + newselectedDate.getFullYear () + "then 1 and 0 end"; Filter.push (new nlobj SearchFilter ('revrecenddate', null, 'after', newselectedDate)); Filter.push (new nlobjSearchFilter ('type', null, 'anyof', ['custInvc', 'cashseale'])); Filter.push (new nlobjSearchFilter ('templatename', 'revrecschedule', 'isnotempty')); Filter.push (new nlobjSearchFilter ('deferredamount', 'revrecschedule', 'isnot', 0)); Filter.push (new nlobj search filter ('formulaic', blank, 'barto', 1) .setFormula (formula)); Var Search = nlapiCreateSearch ('Transactions', Filters, Columns); Var searchersult = search. Aaron Search ();
What works in theory except that instead of that lesson the value of that field (it becomes a non-date value) I know that once you run a search to get the text instead of the value (nlobjSearchResult.getText), I know that I have not found any way to do this within a formula.
Any thoughts?
var formula = "TODATE (SUBSTR ({postingperiod}, - 8,8), ' MON YYYY ')> = "+ newselectedDate.getFullYear () +" then 1 and 0th ";
To pass the fundamental function, basically adding a SUBSTR function to take the last 8 characters in the string.
No comments:
Post a Comment