Bug reports Found a bug? Post it here please.
Version 4.x > Bug reports > Inappropriate cache in BizFormInfoProvider? View modes: 
User avatar
Member
Member
Josh Larios - 11/10/2009 5:07:57 PM
   
Inappropriate cache in BizFormInfoProvider?
I'm writing a replacement for the "Generate Table Layout" button on the BizForm layout editing page, and to get all the information I want, I'd like to parse the bizform's definition. My first attempt was (roughly) this:

BizFormInfo bfi = BizFormInfoProvider.GetBizFormInfo(bizFormId);
stringToParse = bfi.Form.GetXmlDefinition();

But it turned out that if I changed the fields on the bizform (by adding or deleting a field, or any other change), the definition string contained an old version. So I changed my method to this:

BizFormInfo bfi = BizFormInfoProvider.GetBizFormInfo(bizFormId);
DataClassInfo dci = DataClassInfoProvider.GetDataClass(bfi.FormClassID);
stringToParse = dci.ClassFormDefinition;

And that works. DataClassInfo.ClassFormDefinition contains current info, while BizFormInfo.Form.GetXmlDefinition() doesn't.

Is that supposed to be the case? Or is there some method of BizFormInfo I could call which would force it to flush its cache? TouchKeys() didn't seem to do anything.

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 12/2/2009 3:01:32 AM
   
RE:Inappropriate cache in BizFormInfoProvider?
Hi Josh,

please note that bfi.Form.GetXmlDefinition() does not contain class form definition of the BizForm, but it contains definition of custom layout from 'Form' tab of BizForm. If you need to acquire definition of fields from 'Fields' tab, you should actually use dci.ClassFormDefinition.

Best Regards,

Martin Dobsicek