Addsum web site and general info

Postings here will focus mainly on Advanced Accounting software updates, tips, and related topics. They will also include general comments relating to troubleshooting PC/Windows/network problems and may also include reference to our other software products and projects including any of our various utilities, or to the TAS Premier programming language. We considered setting up separate blogs for different topics so that users/others could subscribe to topics mostly aligned with their interests, but decided that it would be better to keep things simple since some topics cross over into others. We would nonetheless welcome your feedback/input in this regard. Our web site URL is www.addsuminc.com. Call us at 800-648-6258 or 801-277-9240. We also maintain www.advancedaccounting.us so that older Business Tools users in particular have a greater chance to find us.

Follow

We highly recommend that accounting software users "follow" this blog via e-mail (enter your address and click on Submit below) or subscribe to a feed (see also below) as a way to keep current on the latest updates and accounting software news and information. You may also want to whitelist this e-mail address: noreply@blogger.com.

Sunday, February 15, 2026

Creating or adding text to sales order header notes

 Advanced Accounting has extensive support for notes.  A single note can be up to 5,000 characters in length and attached (i.e. linked) to a number of different types of accounting software data including:  customer codes, vendor codes, inventory (aka product or item) codes, sales order headers (the main record associated with a sales order containing the customer code, billing and ship to address, terms, etc.), sales order line items, posted invoices (via after invoice maintenance), quote headers, quote line items, purchase order line items, employees, general ledger codes, journal entries, and also in the time and billing module where they are used extensively.   Notes can be accessed through a variety of options and reports.   And in sales orders, quotes and purchase order entry, existing notes attached to those line items can be automatically retrieved and attached as sales order line items, and then edited as necessary (since they then exist separately as a new, cloned note).

While most notes also can be printed on various documents (for example, notes attached to sales order line items), some notes are mainly for internal reference (but all notes can still be via the UT-E Notes Report option).  Sales order and quotes "header" notes are examples of notes used mainly for internal review.

For special customized applications, it may be desirable to automatically assign (i.e. "populate") note instructions into the header field.  The following examples are for programming reference should this type of customization be required and would generally apply to any type of note in the system provided that the appropriate "where from" and link code is provided.  This approach does not require the tas_notes option nor loading the wbknotes program into memory (which happens in the initial_setup call including in almost all Advanced Accounting programs) nor use of the special user defined commands that are included in the ADV60.LCY (encrypted ADV60.LIB) file as normally used when processing notes in other programs.

Example #1: add a header note to sales order that has no current header note

#lib addsum 
(* has the chk_open UDF *)

define bksycbnt_hndl type i size 5

(* the add word reset after "size 5" if used within the accounting software environment and the program has an initial_setup UDC i.e. user defined command which has already opened the notes file*)

(*defines for bksymstr_hndl and bkarinv_hndl should already in the file definition file, otherwise they need to also be defined *)
 
define note_num,so_num type R size 9
define where_from type A size 3

//start: label here if the #FORCERWN compiler directive is used

(*if initial_setup has not been included in the applicable program then open the notes file *)

openv 'bksycbnt' ext 'c'+co() fnum bksycbnt_hndl lock o
bksymstr_hndl=chk_open('BKSYMSTR','R',true)
bkarinv_hndl = chk_open('BKARINV','r',.f.)

where_from='SOH'

(*get the next note number - or replace with bkar.inv.note# if in SO-A*)

(*get the applicable BKARINV record, if bkar.inv.note# is zero, assign a note # *)

//where so_num is the desired so_num with the header note to update
//or you could scan the entire file using the SCAN command

so_num = 123456

findv m fnum bkarinv_hndl key bkar.inv.sonum val so_num

if flerr(bkarinv_hndl) <> 0 then quit 
// and then a ret after the quit depending on program type

if bkar.inv.note#=0
   inc bksy.next.note#
   note_num=bksy.next.note#
   save @bksymstr_hndl nocnf
endif

bkcbnt_note='Desired header note text'
bkcbnt_code = trim(str(note_num),'l')
bkcbnt_who = 'SOA'
bkcbnt_whr_frm = where_from
bkcbnt_date = date(
bkcbnt_time = time()
save @bksycbnt_hndl nocnf


(*bkar.inv.note# should be set to note_num and then save the BKARINV record *)

bkar.inv.note#=note_num
save @bkarinv_hndl nocnf //and probably a noclr

Example #2 -retrieve existing SO header note and add some text to it

define code type A size 25
define where_from type A size 3
define so_note type A size 5000

where_from='SOH'

(*get the bkarinv record similar to the code in example #1 with error handling then exit or quit if bkar.inv.note#=0 *)

note_num=bkar.inv.note#
code=trim(str(note_num),'l')
findv g fnum bksycbnt_hndl key cbnote_key val where_from,code,0,0

if flerr(bksycbnt_hndl)=0 .and. bkcbnt_code = code \\
 .and. bkcbnt_whr_frm = where_from
    //found it
else
   msg 'Could not find the desired note.'
   quit
   
   ret

endif

so_note=bkcbnt_note
so_note=trim(so_note,'t') + ' now add some additional text'
bkcbnt_note=so_note
save @bksycbnt_hndl nocnf

//the header note has now been updated with the additional text


Postscript:  the SOH "where from" value stands for sales order header. In quotes, we instead use QUH for the quotes header note reference.








No comments:

Post a Comment