Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Simple - Copy field value to another in a grid

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Simple - Copy field value to another in a grid

    I did this before but cannot seem to make it work and I am driving myself crazy.

    This is a Grid (Detail View) V12

    I have a field called
    Called From (its a phone number)

    I have another one called
    Call Back (its also a phone number)

    Since sometimes these numbers are different BUT sometimes the same, I want the Call Back number to be the same as the Called From number by way of clicking a button, otherwise I would just enter the differing call back number.

    So can someone please direct me?
    I have a button and I am trying to use the onClick event in the Javascript field properties.
    I have tried so many things that if I had a loaded revolver I would have shot the monitor 5 times, and then turned the gun on my app giving it one last chance...lol

    Help!
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

    #2
    Re: Simple - Copy field value to another in a grid

    Hello

    You should be able to do without the button Ajax callback. Probably not necessary to have the button.
    Use the onChange event of the called from field harvest the e.dataSubmittedNew.calledFrom then e.set.callBack.value= that value you harvested.
    This way you can change it when you arrive at that field or leave it alone.
    If you still did not get this to work by tomorrow evening I will send you a screencast, I am away in Florida till tomorrow night.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    [email protected]
    Skype:[email protected]
    1 914 924 5171

    Comment


      #3
      Re: Simple - Copy field value to another in a grid

      Many Thanks!
      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

      Comment


        #4
        Re: Simple - Copy field value to another in a grid

        I would probably stay on the client side and do this with the Alpha Javascript methods. No real need to make a round trip to the server.

        Create your button, and in it's Javascript onClick event do this...

        Code:
        var calledFrom = {grid.Object}.getValue('D','Called_From');
        {grid.Object}.setValue('D','Call_Back', calledFrom);
        You don't have spaces in your field names... do you?
        Last edited by Davidk; 01-25-2014, 01:00 AM.

        Comment


          #5
          Re: Simple - Copy field value to another in a grid

          David, no I do not have spaces and that snippet is perfect AND at least I know I had the right idea, in fact I wrote code so close to that! I get it - I left out some important aspects of it, like apostrophes.
          I also tried 35 varieties of {grid.object}.setValue(D,Called_From,Call_Back,' '); etc. which all I got was 1 parentheses or nothing, lol
          Thank you - my button is working exactly as I wanted and I hope this helps out someone else as well!

          Can I write 3 varieties of similar code on the same button? Like creating 3 vars and have them all fire on the same button click?
          SO I can just "Copy" values like from ship to/bill to?

          Lastly Ghandi - I would still like to see your idea on how to accomplish this because I learn so much from you - I think many have.

          Thanks Again guys!
          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

          Comment


            #6
            Re: Simple - Copy field value to another in a grid

            hello
            Can I write 3 varieties of similar code on the same button? Like creating 3 vars and have them all fire on the same button click?
            SO I can just "Copy" values like from ship to/bill to?
            this is one of my old videos
            http://www.screencast.com/t/b4uqKldt
            where it updates the shipping address as you type in the billing address ( without round trip to server) of course you can put a button and copy to i have to look for that video i will post back when i locate it.
            if you want to do all you have to do is combine all the separate codes to one and call with inline javascript of the button onClick event
            thanks for reading

            gandhi

            version 11 3381 - 4096
            mysql backend
            http://www.alphawebprogramming.blogspot.com
            [email protected]
            Skype:[email protected]
            1 914 924 5171

            Comment


              #7
              Re: Simple - Copy field value to another in a grid

              Thanks Gandi - all good information...
              NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

              Comment


                #8
                Re: Simple - Copy field value to another in a grid

                I am trying to do this same thing. Using a button on a new record in a dialog. The record has not been saved yet, but I need a button to copy address info.

                Comment


                  #9
                  Re: Simple - Copy field value to another in a grid

                  Keith
                  This was answered by David Kates:


                  "Create your button, and in it's Javascript onClick event (text mode) do this..."

                  Code:
                  var calledFrom = {grid.Object}.getValue('D','Called_From');
                  {grid.Object}.setValue('D','Call_Back', calledFrom);
                  Thats for syncing from a field called "Called_From" so what happens is the field in detail view called "Call_Back" equals the value in Called_From

                  so I took it a step further with another button to copy the fields from the jobsite address with a click to the billing address fields. Heres the code I used

                  var getadd1 = {grid.Object}.getValue('D','address');
                  {grid.Object}.setValue('D','Billing_Address', getadd1);

                  var getcity1 = {grid.Object}.getValue('D','city');
                  {grid.Object}.setValue('D','Billing_city', getcity1);

                  var getstate1 = {grid.Object}.getValue('D','state');
                  {grid.Object}.setValue('D','Billing_State', getstate1);

                  var getzip1 = {grid.Object}.getValue('D','zipcode');
                  {grid.Object}.setValue('D','Billing_zipcode', getzip1);

                  So I hope with these two examples you can figure out the logic of creating a variable - assigning it the entered value from a field and then setting the value of another field with the variable.

                  Thank you David for taking the time to explain it to me by showing me a working clear example! I get it!
                  NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                  Comment


                    #10
                    Re: Simple - Copy field value to another in a grid

                    This is what I have in the onlick

                    var getadd1 = {grid.Object}.getValue('D','MAILINGADDRESS1');
                    {grid.Object}.setValue('D','PHYSICALADDRESSLINE1', getadd1);

                    It does nothing in working preview, or in the published version.

                    I'm wondering if it's because it's not saved yet?

                    Comment


                      #11
                      Re: Simple - Copy field value to another in a grid

                      This worked fine for me in a normal grid, with similar pasted into the onclick event for javascript (textmode)
                      I am not sure about your fields being referenced in all caps. I heard javascript is case sensitive but not sure in this case.
                      I would try naming your fields in all lowercase but again not sure about that as far as I can tell this should work fine.
                      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                      Comment


                        #12
                        Re: Simple - Copy field value to another in a grid

                        Ok I changed the first line to match the Field name and added a window.alert. The message I get is false?

                        var getadd1 = {grid.Object}.getValue('D','Mailingaddress1');
                        window.alert(getadd1);

                        Comment


                          #13
                          Re: Simple - Copy field value to another in a grid

                          Using a button on a new record in a dialog
                          var getadd1 = {grid.Object}.getValue('D','Mailingaddress1');
                          you want to use in dialog, but using grid methods.
                          will not work.
                          look for e.dataSubmitted property.
                          and e._set property
                          for example
                          Code:
                          dim add1 as c
                          add1 = e.dataSubmitted.mailingaddress1
                          e._set.physicaladdressline1.value = add1
                          will copy in dialog.
                          Last edited by GGandhi; 02-09-2014, 05:28 PM.
                          thanks for reading

                          gandhi

                          version 11 3381 - 4096
                          mysql backend
                          http://www.alphawebprogramming.blogspot.com
                          [email protected]
                          Skype:[email protected]
                          1 914 924 5171

                          Comment


                            #14
                            Re: Simple - Copy field value to another in a grid

                            Keith,

                            Govindan is right in that you're using grid methods in a place in the dialog where (in this case) they don't belong.

                            However... there's still no need to make a round trip to the server to get this done...

                            Code:
                            var _phone = {dialog.Object}.getValue('PHONE');
                            {dialog.Object}.setValue('FAX', _phone);
                            in a client-side event will get you what you want.

                            You were putting your original code into the client-side onClick event... right? In Text mode.

                            At the bottom of that Text mode screen you'll a link... Insert UX Component Method... where you'll find the format of these and other methods.

                            Comment


                              #15
                              Re: Simple - Copy field value to another in a grid

                              I'm about to give up. I know we are real close, but it doesn't work.

                              It's component type is updateable grid. layout is form. And it's set to create a new record. The copying needs to take place before the save.

                              Comment

                              Working...
                              X