View previous topic :: View next topic |
Author |
Message |
DaveB
Joined: 08 Feb 2011 Posts: 15
|
Posted: Tue Feb 08, 2011 5:34 pm Post subject: CustomGenerator and Sale->Select Key |
|
|
I have a simple CustomGenerator that looks at Customer and Sale and ensures sale price is in the correct range. It also formats the ProductInfo based on sale date and evaluation true/false.
My problem is this: when keys are assigned to a distributor, CustomGenerator is called with Customer and Sale null, which seems right. However, when the sale is made, and I click 'Select...' in the 'Edit/Add Sale' dialog, I need CustomGenerator to be called again so I can check price and format ProductInfo.
Anyone else have this issue with keys assigned to a distributor? _________________ Dave |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Feb 08, 2011 11:14 pm Post subject: |
|
|
The Custom Generator is only called when license keys are generated. If you pre-generate license keys then it will be called when you create the license keys for the distributor - not later when you assign the keys to a sale. If you need to have the Custom Generator passed the sale/customer information then you should enable the "Generate Keys at Point of Sale" option for the Product (on the "Key Generation" tab). Then instead of using the "Select" button in the Sale dialog to select existing license keys use the "Generate" button. Your custom generator will then be passed the Customer and Sale. _________________ Infralution Support |
|
Back to top |
|
|
DaveB
Joined: 08 Feb 2011 Posts: 15
|
Posted: Tue Feb 08, 2011 11:38 pm Post subject: |
|
|
I do have "Generate Keys at Point of Sale" checked, and it does work if I always use 'Generate' in the Sale dialog.
However, I would like to take advantage of the License Tracker feature which allows me to issue keys to distributors in advance, recording the sales at the time they occur.
Since the CustomGenerator parameters are Customer and Sale, it makes sense that it would be called when the sale is made. Otherwise, those parameters are null and the CustomGenerator can serve no real purpose. _________________ Dave |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Feb 09, 2011 5:50 am Post subject: |
|
|
The point of a Custom Generator is to enable you to generate keys with custom product info (which can potentially depend on the Customer and Sale data). If the license key has alread been generated and issued previously then there is no point calling a Custom Generator because you can't change the product info that is in the already generated key.
I suspect you might be trying to use the Custom Generator for something it is not designed for. _________________ Infralution Support |
|
Back to top |
|
|
DaveB
Joined: 08 Feb 2011 Posts: 15
|
Posted: Wed Feb 09, 2011 4:33 pm Post subject: |
|
|
Ah, yes you're right - I forgot that ProductInfo is not changeable after the key is issued. _________________ Dave |
|
Back to top |
|
|
|