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

UX Component -> calculated field based on lookup field value. How to refresh?

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

  • UX Component -> calculated field based on lookup field value. How to refresh?

    So, I have put some time into this problem before writing this question, but I find myself getting farther and farther from home.

    I have a UX Component. In that component there is a control with a lookup function that gets a value from a grid. Several fields in the UX are then filled from the corresponding fields in the grid record selected in the lookup.
    That all works, and the fields are filled correctly.

    Now, the UX's calculated fields are executed on init of the UX component. I know that much. Which means, the calculated field is set to 0 because on init there has not been any record selected in the lookup yet.
    Once the record is selected in the lookup, the value of the fields filled changes.
    One of those changed fields is used in the calculated field. The latter one does not recompute automatically when the value of one of the used fields in the calculated field changes.

    So how do I "refresh" the calculated field?

    I have tried to do it with Javascript action scripting on the OnChange event of the used field, but no cigar.

    Before I take a really really deep dive into this and spend hours and hours of time, maybe one of you guys can point me into the right direction on how to solve this? Hopefully.

    So, example:

    (1) Lookup: "choose your package". It provides records of packages available in a grid by means of a lookup.

    Shown:
    Record 1:
    Name: package A
    Price: $10

    Record 2:
    Name: package B
    Price: $20

    (2) UX Controls:

    (a) UX Control: "Chosen Package" -> value inserted from lookup
    (b) UX Control: "Price p/package" -> value inserted from lookup
    (c) UX Control: quantity -> input from user
    (d) UX calculated field: COST (quantity * Price p/package)

    Problem: on selecting the package in the lookup field, (a), (b) get filled in correctly. (d) is still 0.
    Once the quantity (c) is entered by the user, (d) does not recompute and remains 0.

    How to recompute / refresh (d) ??

    Any help on this is highly appreciated.




  • #2
    It's not your fault - but whole thing is what we call in Australia - all over the place like a dogs breakfast - you have 22 posts - so it's time to stop you in your tracks from continuing down the path your heading.
    Just say what it is as a specification you are wanting to do and i'll put you on the right track. What is it you want to build.

    Pete


    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein, (attributed)
    US (German-born) physicist (1879 - 1955)

    Comment


    • #3
      Originally posted by peteconway View Post
      It's not your fault - but whole thing is what we call in Australia - all over the place like a dogs breakfast - you have 22 posts - so it's time to stop you in your tracks from continuing down the path your heading.
      Just say what it is as a specification you are wanting to do and i'll put you on the right track. What is it you want to build.

      Pete

      Hi Pete, thank you for offering to help out !

      I don't quite "get" your post and the mentioning of my 22 posts , but all I really want to do is offer the user a screen where he can make a choice, enter some data and then have some calculated fields recalculate based upon all of that.
      It really (i.m.h.o.) shouldn't be that hard as I encounter it to be. I just want some calculated fields on the UX component to re-calculate based upon the data available AT THAT TIME. Which, I dare to say, should be quite basic a wish?

      If I understand correctly, the UX component is the dialog component designed to just do that?
      So, if you have a calculated field on the UX, how do YOU re-calculate it when the user enters some data?

      Or am I incorrect at a design level, and should I use the component differently to obtain my goal, or even use a different component all together?

      Confused.

      Comment


      • #4
        Originally posted by hocomlabs View Post
        So, I have put some time into this problem before writing this question, but I find myself getting farther and farther from home.

        I have a UX Component. In that component there is a control with a lookup function that gets a value from a grid. Several fields in the UX are then filled from the corresponding fields in the grid record selected in the lookup.
        That all works, and the fields are filled correctly.

        Now, the UX's calculated fields are executed on init of the UX component. I know that much. Which means, the calculated field is set to 0 because on init there has not been any record selected in the lookup yet.
        Once the record is selected in the lookup, the value of the fields filled changes.
        One of those changed fields is used in the calculated field. The latter one does not recompute automatically when the value of one of the used fields in the calculated field changes.

        So how do I "refresh" the calculated field?

        I have tried to do it with Javascript action scripting on the OnChange event of the used field, but no cigar.

        Before I take a really really deep dive into this and spend hours and hours of time, maybe one of you guys can point me into the right direction on how to solve this? Hopefully.

        So, example:

        (1) Lookup: "choose your package". It provides records of packages available in a grid by means of a lookup.

        Shown:
        Record 1:
        Name: package A
        Price: $10

        Record 2:
        Name: package B
        Price: $20

        (2) UX Controls:

        (a) UX Control: "Chosen Package" -> value inserted from lookup
        (b) UX Control: "Price p/package" -> value inserted from lookup
        (c) UX Control: quantity -> input from user
        (d) UX calculated field: COST (quantity * Price p/package)

        Problem: on selecting the package in the lookup field, (a), (b) get filled in correctly. (d) is still 0.
        Once the quantity (c) is entered by the user, (d) does not recompute and remains 0.

        How to recompute / refresh (d) ??

        Any help on this is highly appreciated.



        I think your missing something with your calculated field , if I get your question right , what you need to do here is changing the way of calculating field , I mean instead of writing the calculated field as

        (quantity * Price p/package)

        try this

        If(cost !="0", (quantity * Price p/package) , 0) // this should be changed upon your needs , try to play with it till you get exactly what you want to do.
        Or
        if(yourCalculatedField != "0" , The True Result , The False Result ) // think about it this way

        notice that your fields have to be numeric type .

        I honestly not sure if I got this right formula , but you will need to do it through if condition . that will directly refresh the calculated field .

        Let me know if this didn't work for you .



        Last edited by TheDevilIsMe; 10-19-2021, 06:37 AM.

        Comment


        • #5
          I'll take a look tomorrow for you as well, The process looks way to complicated - It's late here - Have to get some sleep been at it all day.

          Pete
          Insanity: doing the same thing over and over again and expecting different results.
          Albert Einstein, (attributed)
          US (German-born) physicist (1879 - 1955)

          Comment


          • #6
            Hi TheDevillsMe !
            Thanks for offering your approach. I appreciate your efforts to help me out hugely.

            But, I have found the solution just now a few moments ago, experimenting with the possibilities.
            And, with hindsight, the solution was quite simple.

            On the OnChange Event of the customers entry field on the UX, I placed an inline-Javascript action, holding the following code:

            {dialog.Object}.refreshClientSideComputations();

            So, the dialog.Object is on run exchanged with the objectid, and all clientside computations will be refreshed, which resulted in the desired behavior of the calculated fields re-calculating!
            It was that simple.....

            Thanks to everybody reaching out to help!

            Comment


            • #7
              Originally posted by hocomlabs View Post

              On the OnChange Event of the customers entry field on the UX, I placed an inline-Javascript action, holding the following code:

              {dialog.Object}.refreshClientSideComputations();
              I have found recently in the newer builds that clientside computations don't run as automatic as they used to in many contexts, especially if your data is being displayed in a 'label' control vs a 'textbox', and have had to use the same command myself when previously I did not.

              Comment


              • #8
                I would think onchange event rules for the quantity and package controls would solve the problem.
                Each control would check the other control for valid data before populating the price control.
                The rules should also blank out the price control if either package or quantity does not have a valid value.
                Gregg
                https://paiza.io is a great site to test and share sql code

                Comment

                Working...
                X