Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Form Default Value from Custom Table View modes: 
User avatar
Member
Member
egarrison-wte - 7/25/2012 4:44:37 PM
   
Form Default Value from Custom Table
I have a BizForm that I want to pre-populate with values retrieved on page from a custom_table. I have the SQL pulling back the fields in transformations, but now want to set a field like "CurrentPayoff". I can easily populate if the value is in the URL using {%PayOff%} but I would rather not have that data in URL string. I also thought of setting into a cookie and reading from cookie, but cannot find how to pass the Eval("Payoff") value from the custom query to the Set Cookie webpart.

What is the context for referencing CustomTable data in other object?

User avatar
Member
Member
egarrison-wte - 7/31/2012 11:28:36 AM
   
RE:Form Default Value from Custom Table
Does anyone have ideas on how to do this?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 8/3/2012 10:18:08 PM
   
RE:Form Default Value from Custom Table
Hi,

The {%something%} expression is a querystring macro, but you should be allowed to use any other type of macros (see types of macros in DevGuide), including those with K# syntax

The entering macros and autocompletion article should also provide some help. Custom tables are accessible e.g. from GlobalObjects..

You could also write a custom macro in order to use custom API code (custom macros in DevGuide).

Regards,
Zdenek

User avatar
Member
Member
egarrison-wte - 8/7/2012 10:05:56 PM
   
RE:Form Default Value from Custom Table
Thank. I think I am on the right path. I am not able to figure out how to get the a field back from the Macro. I META data to print all day long, but not a specific data element. I also cannot seem to find documentation on this. How do I select ItemText from the Sample table where ItemID = X.

GlobalObjects.CustomTables["customtable.SampleTable"].???
What next.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/11/2012 3:10:47 PM
   
RE:Form Default Value from Custom Table
Hi,

you can create a custom macro for this and call it using for example:

{%ProcessCustomMacro("macroname"|(default)X") |(default)X, "%}

Where X is an ItemID.

In the code of custom macro you can parse value and select data using custom table API. Then you can return a value you need. More information you can find here:
custom table api
custom macro

Best regards,
Ivana Tomanickova