Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 6 of 6

Thread: Customer ExtensionData?

  1. #1
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default Customer ExtensionData?

    Hello,

    I would like to use the ExtensionData field in the Customer table. Here, I am going to store the CUST_CD from our system. I already added the field in the account.aspx page under the phone number. However, I now need to be able to populate that field when the page loads, just like the first name, last name, phone number, et cetera . . . and I want the customer to be able to update or enter their customer code if it is blank. Of course, in return, I want it to update the database in the ExtensionData field.

    Could someone please tell me how I can accomplish this?

    Thank you very much in advance,

    ~D

  2. #2
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Anyone? Surely, someone has done this . . .

  3. #3
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Hi Donato,

    I'm going to guess that you are using v8. If you are using v9, let me know. Use the 'Phone' field as a guide but of course you'll call your on-screen field something else. In this example, I'll use 'CustCD' which you'll need to make an onscreen text field in account.aspx (I think you've done this).

    - To populate the CustCD field:

    In account.aspx.cs, in the Page_Load() method, just below the line ' Phone.Text = ThisCustomer.Phone;' at approx line 112, insert:

    CustCD.Text = ThisCustomer.ExtensionData;

    - To update the Customer record with the contents of CustCD:

    In account.aspx.cs, in the btnUpdateAccount() method, change this line at approx line 231:

    /*ExtensionData*/ null,

    To this:

    /*ExtensionData*/ CustCD.Text,

    That's it.

  4. #4
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Quote Originally Posted by webopius View Post
    Hi Donato,

    I'm going to guess that you are using v8. If you are using v9, let me know. Use the 'Phone' field as a guide but of course you'll call your on-screen field something else. In this example, I'll use 'CustCD' which you'll need to make an onscreen text field in account.aspx (I think you've done this).

    - To populate the CustCD field:

    In account.aspx.cs, in the Page_Load() method, just below the line ' Phone.Text = ThisCustomer.Phone;' at approx line 112, insert:

    CustCD.Text = ThisCustomer.ExtensionData;

    - To update the Customer record with the contents of CustCD:

    In account.aspx.cs, in the btnUpdateAccount() method, change this line at approx line 231:

    /*ExtensionData*/ null,

    To this:

    /*ExtensionData*/ CustCD.Text,

    That's it.
    Thank you very much! However, when I type ThisCustomer. - I do not get ExtensionData in IntelliSense. Is that part of the ThisCustomer object?

    Thanks again . . .

  5. #5
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    That'll teach me to look at customized code! You are absolutely right, the Customer class does not have ExtensionData exposed as a field by default.

    You could either modify the Customer.cs object so that it retrieves and updates the ExtensionData field. Or you could put SQL into the account.aspx.cs code so that it retrieves and updates ExtensionData for the current Customer.

  6. #6
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Quote Originally Posted by webopius View Post
    That'll teach me to look at customized code! You are absolutely right, the Customer class does not have ExtensionData exposed as a field by default.

    You could either modify the Customer.cs object so that it retrieves and updates the ExtensionData field. Or you could put SQL into the account.aspx.cs code so that it retrieves and updates ExtensionData for the current Customer.
    Believe it or not . . . I am using VATRegistrationID . . . I don't think we'll ever use that field.

    Thanks again!