You need to sign in to do that
Don't have an account?
KRavi
Logical complication while using Map
I thought I’d share a logical complication am dealing with, as figuring this is kind of crushing me.
I have the below data in a map…..
while creating invoice for 120 quantity
First 100 qty should be charged for $20 each
Next 20 qty should be charged for $15 each
Invoice Total = (100 X 20) + (20 X 15) = $2300.
But Inside trigger, I couldn’t get the exact price ($15) for next 20 qty, as I do not have a proper unique key on Map…..couldn’t think of decent logic to get there. any thoughts would be appreciated.
Thanks
Kishore
I have the below data in a map…..
while creating invoice for 120 quantity
First 100 qty should be charged for $20 each
Next 20 qty should be charged for $15 each
Invoice Total = (100 X 20) + (20 X 15) = $2300.
Item | Description | Billing Unit | Price | Frequency of Threshold | Start Date of Calculation | Expiration Date of | Threshold Min | Threshold Max |
Chem01 | LandDrop | Drum | $20.00 | Yearly | 01/01/17 | 12/31/17 | 1 | 100 |
Chem01 | LandDrop | Drum | $15.00 | Yearly | 01/01/17 | 12/31/17 | 101 | 150 |
Chem01 | LandDrop | Drum | $10.00 | Yearly | 01/01/17 | 12/31/17 | 151 | 200 |
But Inside trigger, I couldn’t get the exact price ($15) for next 20 qty, as I do not have a proper unique key on Map…..couldn’t think of decent logic to get there. any thoughts would be appreciated.
Thanks
Kishore
**Using Map you cannot have duplicate keys.