1
votes

In transactions -> Financial -> Make journal entries

Let say I create a line with Class AA and Department BB and click add

Then on the second line, I enter the account and hit tab, I would like the previous class and deparment to be taken and populate the current line.

I know I have to create a client script, but how can I the values of the previous line ?

Thanks Mark

1

1 Answers

0
votes

You want it to populate the class and department after hitting tab and entering account? That would need to be a field changed function. My answer will be in 2.0 as i believe all should be coding in that lately.

I believe in context there is an attribute for line. context.line gives you the line number you are on. If line !=0 then you could do getSublistValue () of line -1 and set fieldId to class and call again for department. Then use setCurrentSublistValue () to set the line you are on.

Where you will probably want to add some logic is I am assuming you probably want every 2 lines to match (debit and credit) not necessarily all lines. Without knowing your business, it is hard to best identify how to do this but it is something you should consider.