Toby,
To me, who is a novice at .NET, it looks like that code is doing a simple
lookup and insert into the db using the information from the form.  It is
using the e-mail as the item to match on and then inserting the answers from
the survey into the DB using the methods written in .NET (this is just a
sub-sample of the entire application as it is calling some other methods)

But what it is clearly stating, is that it is expecting either a 0 or a 1
for whether or not the respondent likes ice cream, and that the numerical
values for hair color need to be inserted instead of the actual name.  Also
looks to be validating and formating the Postal Code correctly, but all in
all pretty straight forward stuff.  Do you need to write CF to interact with
the .NET or just to replace what it is doing?

Rob

On Thu, Oct 23, 2008 at 8:37 AM, Toby King <[EMAIL PROTECTED]> wrote:

> Hi there
>
> I have a really tricky task to try and complete.
>
> I have been handed an application to build an integration from the CF
> application to a CRM application.
>
> Basically here is what I am trying to do
>
>
> Basically I have a form which has been created
>
> Collects data from a user - namely First Name, Postcode, Email Address,
> Favourite Hair Colour with four possible selections, and also a check box -
> Do you like icecream (yep I know very complicate.
>
> I want to capture this information and integrate the answers with the CRM.
>
> I have some sample code (from .Net I think but have no idea what it is
> trying to do.
>
> Hoping someone might be able to shed some light onto how I convert the .Net
> code to CF.
>
> Here is the code below:
>
> Imports Traction.Integration
> Imports Traction.Integration.DataObjects
> Imports Traction.Integration.Result
> Imports Traction.Integration.TractionTypes.CustomerAttributes
> Imports Traction.Integration.TractionTypes.CustomerAttributes.Default
> Imports Traction.Integration.Result.Errors
>
> ....
>    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>        'instantiate a new SurveyDataObject using the web.config
> configuration "MySurvey1"
>        Dim SurveyResponse As New SurveyDataObject("MySurvey1")
>
>        With SurveyResponse
>
>            'customer details
>            With .Customer
>                'default attributes
>                .FirstName.Value = txtFirstName.Text
>                .Email.Value = txtEmail.Text
>
>                'custom attributes are pre-defined in the web.config
> configuration;
>                'in this case there is only one custom attribute (postcode),
> which is a text attribute
>                CType(.CustomAttributes(0), TextCustomerAttribute).Value =
> txtPostcode.Text
>
>                'validate and handle any errors before posting to Traction
>                If .Validate.Length > 0 Then
>                    'pre-post error handling if the Validate method returns
> any errors
>                End If
>
>            End With
>
>
>            'match key is email
>            .MatchKey =
> TractionTypes.Enumerations.Traction_MatchKeyEnumeration.E
>            .MatchValue = txtEmail.Text
>
>            'survey responses:
>
>            'list boxes and dropdown boxes should return the sequential
> option number per Traction,
>            'not the option text
>            .Questions(0).Answer = lbxHairColour.SelectedValue  'e.g. "2",
> not "Brunette"
>
>            'check boxes should return the string representation of the
> Checked boolean property
>            .Questions(1).Answer = cbxIceCream.Checked.ToString 'e.g. "True"
>
>        End With
>
>        'perform the post
>        Dim MyResult As SurveyResult = Post.SurveyPost(SurveyResponse)
>
>        'examine the result
>        If MyResult.Success Then
>            lblResult.Text = "Thanks for entering!"
>        Else
>            'handle error conditions
>        End If
>
>    End Sub
>
>
>
> Thanking anyone who replies.
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314293
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to