- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Add editable UDF to AR Invoice History Screen
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-13-2011 06:56 AM
My client woud like a field on the AR Invoice History header panel in which they can type notes.
By default, it seems the UDF will be read only (like all fields of a history object). Is it possible to add an editable UDF to this screen?
Interestingly, I recently added some UDFs to the PO History screen which were able to be edited.
Re: Add editable UDF to AR Invoice History Screen
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-13-2011 09:43 AM
Added a script and used the oScript object to programatically enable the field upon reading a record.
Re: Add editable UDF to AR Invoice History Screen
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-13-2011 10:48 AM
Hi Justin,
Although this may enable the field for editting, I don't think it will save that information to the Invoice Header/Detail records.
Re: Add editable UDF to AR Invoice History Screen
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-13-2011 02:55 PM
Surprinsingly, moving off the record after editing this field prompted me to save.
Anyways, my client has changed their mind on what they need.
Now, I'm attempting to access the lines of the AR Invoice History via oBusObj, but the object doesn't seem to have a 'Lines' property. According to the BOI Object reference, it should have a property named Detail_Object, but that property can't be recognized either.
Can I get a handle to the lines object using the Invoice History oBusObj?
Re: Add editable UDF to AR Invoice History Screen
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-13-2011 04:54 PM - last edited on 12-13-2011 04:57 PM
The history header/detail files are not like data entry header/detail files. It doesn't have a Lines property. It has a Detail_Object property. You may need to do the following to get it to work:
oInvDetailObj = oBusObj.Detail_Object
if oInvDetailObj<>0 then set oInvDetailObj=oSession.AsObject(oInvDetailObj)
Then do oInvDetailObj.SetKeyValue(), oInvDetailObj.SetKey(), etc...
Sr. Software Engineer
Sage 100 ERP
Re: Add editable UDF to AR Invoice History Screen
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2011 07:58 AM - last edited on 12-14-2011 08:30 AM
Thanks Natasha. I was able to get the object created.
From what I can tell, I will need to specify which records I need from the detail object. I'm attempting to use the SetFilter method of the detail object to filter by invoice number/headerseqno and access only the lines related to the current invoice. Is this the most efficient way to get those results? It seems like the method is timing out and throwing an error in the script (this particular MAS company's AR History is very large)
I have the invoice number and headerseqno available - I'm wondering if I can come up with some logic to pass detailseqNo's to the SetKey() method to avoid searching through thousands of records for the 5 - 10 that I need.
If the header contains a linecount, and the detailSeqNos ALWAYS start with zero and will always be incremented by 1, I think I will be able to use setKey()
Thanks again.
EDIT: Repeatedly calling the detail objects SetKey() method in a loop with incremented DetailSeqNo worked great.
Re: Add editable UDF to AR Invoice History Screen
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2011 10:45 AM
You can use SetFilter like this:
retVal = oInvDetailObj.SetFilter("", invoiceNo+HeaderSeqNo)
Note that if you have invoice number shorter than 7 characters, you need to pad it with null.
Then you can move through the lines and test for EOF.
retVal = oInvDetailObj.MoveFirst()
retVal = oInvDetailObj.MoveNext()
oInvDetailObj.EOF
Sr. Software Engineer
Sage 100 ERP
Re: Add editable UDF to AR Invoice History Screen
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2011 11:01 AM
Just curious, but I thought SetBrowseFilter was used with the Move functions. So SetFilter works with them too?
Re: Add editable UDF to AR Invoice History Screen
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2011 11:04 AM
I believe the history detail object is an exception to that rule.
But since you brought it up Gator, I was wondering if you found SetBrowseFilter more efficient than GetResultSets or vice versa?
Re: Add editable UDF to AR Invoice History Screen
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-14-2011 11:49 AM
If you use a service object, you have to use SetBrowseFilter(). If you use a business object, you can use SetBrowseFilter() or SetFilter().
I think that GetResultsSets() should be faster than SetFilter or SetBrowseFilter because you don't have to move through each line yourself. If you want to write back, you have to read one line at a time.
Sr. Software Engineer
Sage 100 ERP


