"Serialized C1 Function Call"

Topics: General
Aug 1, 2011 at 7:56 AM

With respect to the FunctionBasedNewInstanceDefaultFieldValue() attribute, what is a "serialized C1 function call"?

Aug 1, 2011 at 9:01 AM

That is something we usually refer to as "function markup". You can find a description here

Aug 1, 2011 at 9:12 AM

gilmae, C1 Function calls can be serialized as XML, and it is such a serialization that is expected. The concept is that you can point to a function to get a value, rather than specifying a static value.

Here are examples or (xml) serialized C1 Functions

    A constant value - here we use a parameter:
    <f:function xmlns:f="http://www.composite.net/ns/function/1.0" name="Composite.Constant.Integer">
      <f:param name="Constant" value="2011" />
    </f:function>

    The current date / time - no parameters here:
    <f:function xmlns:f="http://www.composite.net/ns/function/1.0" name="Composite.Utils.Date.Now" />
You can use the C1 Function call designer to build op you call and have the XML handed to you - just use the C1 Console to edit a page's html markup, an xslt (something XML'ish) and use the "Insert | Function Markup" command.

Aug 1, 2011 at 2:01 PM

And in respect to the current attribute in question, which i don't think is answered here, is that you can emulate the default-value functionality you would normally get by using a SQL server, but here with XML files. By creating an instance if a IData-type, which have this attribute set on a property, the datalayer will initialize that property to the return-value of the function call.

Aug 2, 2011 at 5:09 AM

Thank-you very much.