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

Programatically Open a UX by Name/Alias

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

    #16
    mikeallenbrown Cunning solution Mike, so instead of storing the component name, store the JS Action name that will open a specific popup? Am I correct in saying that Javascript actions only exist within the grid or ux context, in other words you cannot create global, app wide JA Actions without creating a pure JS version?

    madtowng I am open to using any method that will achieve the objective but I will not be using any grid stored data, aside from a reference to a component to open or js action to call. Thank you for the sample code, it will take me a minute to wrap my head around it, but it may be a more robust solution if global JS Actions are not possible.

    The reason we are chasing sql/grid based solutions is that we have access and distribution metadata we want to attach to the sql table report records. These settings are actually an intersection of hundreds of reports, across multiple apps, intersecting with multiple platform tenants and user roles. As a rule we have very little if any business logic contained in Alpha, all in SQL and we looking to hook our Alpha reports into the same architecture.

    Comment


      #17
      I have to go off line for a while. Will attempt a solutions and post results later. Many thanks.

      Comment


        #18
        Originally posted by ChristopherG View Post
        mikeallenbrown Cunning solution Mike, so instead of storing the component name, store the JS Action name that will open a specific popup? Am I correct in saying that Javascript actions only exist within the grid or ux context, in other words you cannot create global, app wide JA Actions without creating a pure JS version?
        Correct, store the action name. Javascript Actions only live in the component they are written in. That said a child UX can get a pointer to the parent object and then run the parent's JS actions (and vice versa). You could probably write a custom JS function to do a lot of this work. That may be a good option if you have a lot of grids/reports doing a similar process. Having to maintain it all would be easier if everything is in once place.

        It may be beneficially to talk with a developer over the phone/zoom to help work out the details. It sounds like you have a lot of nuance to work through.

        Mike Brown - Contact Me
        Programmatic Technologies, LLC
        Programmatic-Technologies.com
        Independent Developer & Consultant​​

        Comment


          #19
          SOLUTION 1:

          I have built an example around mikeallenbrown 's simple and effective solution.

          1. SQL Table holding a list of report names and a report codes.
          2. The report code values are exactly the same as predefined Action JS scripts, each of which opens a different, report specific UX
          3. Report table is presented in a grid or list, with a button on each row.
          4. The grid or list buttons 'on-click' JS event, gets the "report_code" field value for the selected row, stores it in a variable and then uses the variable as a parameter in a call to run an Action JS of the same name.
          5. The Action JS opens the UX for the corresponding report and a button on that UX will run the report with the requisite arguments.

          This solution requires creating a report grid/list bound to the SQL table and having all Action JS calls predefined in the same grid/list component.

          The advantages are:
          - to be able to manage report access, scheduling and distribution as SQL objects and procedures, linked to the report_id
          - to store report metadata (description, date added, date updated etc) linked to the report_id and to display as need on the client side

          The disadvantage are:
          - having to create an Action JS script and UX for each report, athough the UX was likely necessary anyway
          - losing role based control over who can run a certain report at 'first control' level. You could still impose role control on the report specific UX "run report" button, but you could not, using using security roles, stop someone opening that UX. A work may be to create multiple report grids/lists each showing only a subset of report records and then to role limit who can open each grid/list.

          Code:
          USE [MYDB];
          SET ANSI_NULLS ON;
          SET QUOTED_IDENTIFIER ON;
          
          CREATE TABLE [dbo].[reports] (
          [rep_id] [int] IDENTITY (1,1) NOT NULL,
          [rep_name] [nvarchar](50) NOT NULL,
          [rep_code] [nvarchar](30) NULL,
          PRIMARY KEY CLUSTERED
          (
          [rep_id] ASC
          )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
          ) ON [PRIMARY];
          
          --ensure the report name is unique
          ALTER TABLE reports ADD CONSTRAINT uk_reports_repname
          UNIQUE (rep_name);
          
          --ensure report code is unique as it will be used as the name of the action js.
          ALTER TABLE reports ADD CONSTRAINT uk_reports_repcode
          UNIQUE (rep_code);
          
          INSERT [dbo].[reports] ([rep_name], [rep_code]) VALUES
          (N'Daily Production', N'rep_0001'),
          (N'Weekly Production', N'rep_0002'),
          (N'Monthly Production', N'rep_0003');
          ​
          Attached Files

          Comment


            #20
            I would think you could check role permissions before executing the javascript action.
            Gregg
            https://paiza.io is a great site to test and share sql code

            Comment


              #21
              What madtowng said. You don't lose anything with this. I restrict access, based on security groups (roles), via Javascript. For example I have many system admin tools that regular users shouldn't see. To show/hide buttons (or other elements) I do the following:

              onDialogInitialize Server-side function (UX of course)
              Code:
              dim pUser as p
              dim sGroups as c = ""​
              
              a5ws_logged_in_user_values(pUser)
              sGroups = a5ws_get_user_assignments(pUser.userId)​
              
              if is_one_of("System Admin",sGroups) then
                 'Set a argument value
                 e.arguments.set("ISSYSADMIN","True")
              end if
              UX JS function to show/hide
              Code:
              function isSysAdminUser(){
                  var _arg = {dialog.object}.argumentValue('ISSYSADMIN');
              
                  if(_arg == 'true'){
                      return true;
                  } else {
                      return false;
                  }
              }​
              Grid's don't have arguments (not like a UX anyways) but you can use a state variable in it's place.
              Mike Brown - Contact Me
              Programmatic Technologies, LLC
              Programmatic-Technologies.com
              Independent Developer & Consultant​​

              Comment


                #22
                I would think you can be more proactive, considering you have the report information in a sql table, is there
                anything preventing you from storing roles along with the report data ?
                Gregg
                https://paiza.io is a great site to test and share sql code

                Comment


                  #23
                  Apologies for the tardy reply. Yes indeed the reason for managing reports out of the DB is to connect it to the rest of the ERP superstructure. It opens up all manner of intersections between reports and other general platform functions (security controlled access, distribution lists, aws storage) and module specific functions (eg. scheduled or triggered compilation based on module specific events). While there will always be an essential xbasic element to this, we always build from the perspective of one day adding other interfaces or even reporting engine. So the solution I posted above is simplified from my actual db implementation which uses field names that are more specific, eg "aa_report_code", so that we can add fields that reference other reporting tools as needed.

                  Comment


                    #24
                    I expect it will never happen as I'm about to suggest, but I think this will be a better scenario.
                    Presume you have a report named sensitivedata.
                    I would expect somewhere in your superstructure, you have (or could have), a code of some sort that indicates
                    a minimum security level to access the report.
                    When you do your query for reports, check the user's security level; if it fails to meet the report requirements, don't even return the report.
                    Gregg
                    https://paiza.io is a great site to test and share sql code

                    Comment


                      #25
                      No you're spot on. Our reports are grouped by module (eg Estate Management, HR etc) and access level and so when we open the reports list/grid for a specific module tui, the list/grid is filtered by both the module name and user access level.

                      Comment

                      Working...
                      X