Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Loading custom fields from Quickbooks

Loading custom fields from Quickbooks

Scheduled Pinned Locked Moved The Weird and The Wonderful
saleshelp
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeremy D Lee
    wrote on last edited by
    #1

    99% of the time,

    customer.DataExtRetList != null

    . This was supposed to fix the edge cases when

    customer.DataExtRetList == null

    .

    if (customer.DataExtRetList != null) {
    this.QBInfo.DateCatSent = "";
    this.Source = "";
    } else {
    for (int i = 0; i < customer.DataExtRetList.Count; i++) {
    IDataExtRet ext = customer.DataExtRetList.GetAt(i);
    if (ext.DataExtName.GetValueOrEmpty() == "Date Cat. Sent")
    this.QBInfo.DateCatSent = ext.DataExtValue.GetValueOrEmpty();
    else if (ext.DataExtName.GetValueOrEmpty() == "Source")
    this.Source = ext.DataExtValue.GetValueOrEmpty();
    }
    }

    B B B C 4 Replies Last reply
    0
    • J Jeremy D Lee

      99% of the time,

      customer.DataExtRetList != null

      . This was supposed to fix the edge cases when

      customer.DataExtRetList == null

      .

      if (customer.DataExtRetList != null) {
      this.QBInfo.DateCatSent = "";
      this.Source = "";
      } else {
      for (int i = 0; i < customer.DataExtRetList.Count; i++) {
      IDataExtRet ext = customer.DataExtRetList.GetAt(i);
      if (ext.DataExtName.GetValueOrEmpty() == "Date Cat. Sent")
      this.QBInfo.DateCatSent = ext.DataExtValue.GetValueOrEmpty();
      else if (ext.DataExtName.GetValueOrEmpty() == "Source")
      this.Source = ext.DataExtValue.GetValueOrEmpty();
      }
      }

      B Offline
      B Offline
      Bernhard Hiller
      wrote on last edited by
      #2

      Daer frnds, need help urgenz. Most time my code simply not work. Sometime it give errro refernce not setting object. Plz help its urgentz.

      J 1 Reply Last reply
      0
      • B Bernhard Hiller

        Daer frnds, need help urgenz. Most time my code simply not work. Sometime it give errro refernce not setting object. Plz help its urgentz.

        J Offline
        J Offline
        Jeremy D Lee
        wrote on last edited by
        #3

        Why do you think I posted it in this forum? Did you miss the mistake? :)

        B 1 Reply Last reply
        0
        • J Jeremy D Lee

          99% of the time,

          customer.DataExtRetList != null

          . This was supposed to fix the edge cases when

          customer.DataExtRetList == null

          .

          if (customer.DataExtRetList != null) {
          this.QBInfo.DateCatSent = "";
          this.Source = "";
          } else {
          for (int i = 0; i < customer.DataExtRetList.Count; i++) {
          IDataExtRet ext = customer.DataExtRetList.GetAt(i);
          if (ext.DataExtName.GetValueOrEmpty() == "Date Cat. Sent")
          this.QBInfo.DateCatSent = ext.DataExtValue.GetValueOrEmpty();
          else if (ext.DataExtName.GetValueOrEmpty() == "Source")
          this.Source = ext.DataExtValue.GetValueOrEmpty();
          }
          }

          B Offline
          B Offline
          Brisingr Aerowing
          wrote on last edited by
          #4

          Ouch.

          I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image. Stephen Hawking

          1 Reply Last reply
          0
          • J Jeremy D Lee

            Why do you think I posted it in this forum? Did you miss the mistake? :)

            B Offline
            B Offline
            Bernhard Hiller
            wrote on last edited by
            #5

            And do you see that I marked it as a joke? Oh dear, I know the meaning of this forum, and I saw the problems the code snippet causes. And I posted like someone would do who uses to write such code. That seems to be beyond the joking capacity of an average CP member though, as can be deduced from the votes...

            1 Reply Last reply
            0
            • J Jeremy D Lee

              99% of the time,

              customer.DataExtRetList != null

              . This was supposed to fix the edge cases when

              customer.DataExtRetList == null

              .

              if (customer.DataExtRetList != null) {
              this.QBInfo.DateCatSent = "";
              this.Source = "";
              } else {
              for (int i = 0; i < customer.DataExtRetList.Count; i++) {
              IDataExtRet ext = customer.DataExtRetList.GetAt(i);
              if (ext.DataExtName.GetValueOrEmpty() == "Date Cat. Sent")
              this.QBInfo.DateCatSent = ext.DataExtValue.GetValueOrEmpty();
              else if (ext.DataExtName.GetValueOrEmpty() == "Source")
              this.Source = ext.DataExtValue.GetValueOrEmpty();
              }
              }

              B Offline
              B Offline
              BobJanova
              wrote on last edited by
              #6

              That is a level of fail which leaves me speechless.

              1 Reply Last reply
              0
              • J Jeremy D Lee

                99% of the time,

                customer.DataExtRetList != null

                . This was supposed to fix the edge cases when

                customer.DataExtRetList == null

                .

                if (customer.DataExtRetList != null) {
                this.QBInfo.DateCatSent = "";
                this.Source = "";
                } else {
                for (int i = 0; i < customer.DataExtRetList.Count; i++) {
                IDataExtRet ext = customer.DataExtRetList.GetAt(i);
                if (ext.DataExtName.GetValueOrEmpty() == "Date Cat. Sent")
                this.QBInfo.DateCatSent = ext.DataExtValue.GetValueOrEmpty();
                else if (ext.DataExtName.GetValueOrEmpty() == "Source")
                this.Source = ext.DataExtValue.GetValueOrEmpty();
                }
                }

                C Offline
                C Offline
                Clodetta del Mar
                wrote on last edited by
                #7

                I can do it even better ... Yesterday I found that gem in my own code

                Boolean deleted = false;
                if(deleted){
                ...
                }

                what a great luck I wrote it only five minutes before I observed my supersophisticated State-of-the-art-Failure... :-D :-O

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups