- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
4.4 Scripting - Extended Descriptio ns
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-18-2011 12:42 PM
I am working on a script that generates Purchase Orders when a Sales Order is saved (and yes I know this feature will be added later, but the client needs it now).
It is all working correctly, but I am not sure how to go about getting the extended description to copy over from the Sales Order line to the Purchase Order line. I will play with this some more, but I was hoping someone had worked on this before and would have a quick answer.
Thanks in advance.
Solved! Go to Solution.
Re: 4.4 Scripting - Extended Descriptio ns
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-21-2011 11:04 AM
OK, I finally figured this out. There is apparently a property that is available to us in the memory channel of the lines (I had to look through the source code to find this as we are also an MD). The extended description is held in "ExtDescriptionText$". When I was looping through the S/O lines, I called:
retVal = oLines.GetValue("ExtDescriptionText$",extDescText)
But, this property can be blank if you have not editted the extended description. So I had to also see if an Extended Description Key was available, and lastly I needed to have the Item Code Description available as follows:
retVal = oLines.GetValue("ItemCodeDesc$", itemCodeDesc)
extDescText2 = ""
extDescText = ""
retVal = oLines.GetValue("ExtDescriptionText$",extDescText2 )
if Trim(extDescText2) = "" then
if Not(IsObject(oExtDescObj)) then
Set oExtDescObj = oSession.AsObject(oSession.GetObject("CI_ExtendedD escription_bus"))
end if
retVal = oLines.GetValue("ExtendedDescriptionKey$",extDescK ey)
retVal = oExtDescObj.SetKey(extDescKey)
retVal = oExtDescObj.GetValue("ExtendedDescriptionText$",ex tDescText)
if Trim(extDescText)<> "" then
itemCodeDesc = extDescText
end if
else
itemCodeDesc = extDescText2
end if
retVal = oPOLines.SetValue("ItemCode$", itemCode)
retVal = oPOLines.SetValue("ItemCodeDesc$", itemCodeDesc)


