Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 21, 2013 @ 16:06
    Fuji Kusaka
    0

    Increment Records

    Hi guys,

    Can someone point out if its possible to retrieve the number of records in contour or make an increment for each records ?

    What i would like to do is be able to make a Ref Number automatically for each records in contour. For each records it will send an automatic xslt transformed email with date and ref.

    Something like Ref: VREAS-dd-mm-yyyy-01 (01 here is the number of record) and so on.

    I was thinking of pulling the records id instead but it way too long event if i trim to .

    <xsl:value-of select="umbraco.library:TruncateString($records/id, 8, '')" disable-output-escaping="yes"/>

    Any thoughts how to achieve this ?

    //fuji

     

     

  • Comment author was deleted

    Sep 23, 2013 @ 09:38

    Hey Fuji,

    Think counting isn't save since what happens when a record get's deleted...

    So what I would suggest is to add a new column to the ufrecord db table, just an column of type int that will auto increment

    THen you'll just need a helper method to get that id based on the guid :)

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 23, 2013 @ 09:43
    Fuji Kusaka
    0

    Ok lets try this!! :)

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 23, 2013 @ 22:25
    Fuji Kusaka
    0

    It seems to be working in the db for each entry, but how to pull the data in xslt transformed.

    The entry is not considered as part of the xml right?

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 24, 2013 @ 10:01
    Fuji Kusaka
    0

    Hi Tim,  how do I include this in my xml or retrieve this value ? 

  • Comment author was deleted

    Sep 24, 2013 @ 10:13

    With a helper :) just make an xslt extension and you should be able to call that from inside the xslt

  • Comment author was deleted

    Sep 24, 2013 @ 10:18
  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 01, 2013 @ 13:11
    Fuji Kusaka
    0

    Hi Tim,

    Thanks for the Url, this seems to be the way it will make it work but how will this ID be added in the entries of Contour. How will the admin get the ID in the entries here ?

    //fuji

  • Comment author was deleted

    Oct 01, 2013 @ 15:27

    Ah you also need it there, you then maybe just add a hidden field and populate that with the db value from a workflow , you won't need the xslt extension then

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 01, 2013 @ 17:31
    Fuji Kusaka
    0

    This is exactly what i wanted to do using workflow with a hidden field using Post as XML right? What does the Alias and Url stands for in the workflow ? and which method do i used

  • Comment author was deleted

    Oct 02, 2013 @ 10:08

    Details on workflows can be found here http://our.umbraco.org/projects/umbraco-pro/contour/documentation/Developer/Extending-Contour/

    Default providers sourcecode here http://t.co/0mmT4XJRur

    Should give you enough details to get started :)

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 03, 2013 @ 09:27
    Fuji Kusaka
    0

    Thanks Tim but no sure how to get started here ! :( 

  • Comment author was deleted

    Oct 03, 2013 @ 10:56

    Have you taken a look at the default workflow code?

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 03, 2013 @ 11:16
    Fuji Kusaka
    0

    From the umbraco. Forms solution i had a look at the PostAsXML.cs file.

    Since contour 3.0 is fully customizable cant i create a nee textField with the FieldType.Textfield.cshtml to pull the data or FieldType.HiddenField ?

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 04, 2013 @ 13:10
    Fuji Kusaka
    0

    Tim, I started with the umbraco.Forms.Core providers but can add umbraco.Forms.Core Reference to run it. 

     

Please Sign in or register to post replies

Write your reply to:

Draft