Thursday, April 30, 2015

PriceList_DefaultPrice of ivPriceMatrix not returning a price

I turned on script log and saw that it's seeing the Default UM as empty. That's weird, because i'm passing in the IV_Item object with the table, and it clearly has a Default UM.

Then I copy and pasted the GP code into my program so that i could put breakpoints and step through the code. It turned out that the IV_Item object's table reference was empty by the time it reached the PriceList_DefaultPrice function.

Why?

Well, I created the IV_Item object in a form proc using that proc's table buffer. Once the scope left that proc, the table buffer was discarded, and therefore resulted in the IV_Item's table reference going bye bye.

Solution
Create the IV_Item object with a table buffer that stays in scope when calling PriceList_DefaultPrice. I added an IV_Item object to my scrolling window, and then passed in a table buffer (which is then in scope of the scrolling window) to the proc that creates the IV_Item object. Because the table buffer was in scope, it could find the Default UM and spit out a price!

No comments:

Post a Comment

There was an error in this gadget