Discount Code

Does anyone know how to use the ...

Public Property Set DiscountReasonCode(Value As ReasonCode) ...

I wrote some code that based on some criteria will discount some items,

but looks like I also need to set the Discount Code... Any ideas or example would be great

TIA

Reply to
Alias
Loading thread data ...

This is a private mail.. but I think that the example can be useful for someone...

/************************ email ****************************/ Hi Chuck,

I looked into documentation, and the property DiscountReasonCode is a property that require an ReasonCode object.. The ReasonCode is a wrapper of the record 'ReasonCode' from database.. and for work correctly with property you must to assign the value to a reasoncodeclass instance..

Example: Set E.DiscountReasonCode = 16

replace with..

Set E.DiscountReasonCode = LookReasonCode("16")

and the code of 'LookReasonCode'

Function LookReasonCode(ByVal code as String) as ReasonCode Dim x as Session.ReasonCode

For Each x in Session.ReasonCodes if x.Code = code then begin Set LookReasonCode = x Exit Function endif

Next x

Set LookReasonCode = Nothing 'Exit with error! End Function

bye Antonio

Reply to
Antonio Mazzeo

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.