NetTalk Central

Author Topic: Running Source Procedure from menu  (Read 2830 times)

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Running Source Procedure from menu
« on: January 05, 2012, 06:09:21 AM »
I would like this code to execute, preferably from a Menu Choice
eg Utilities/Fix Employees
but apparently one cannot call a Source procedure from a menu choice?
So how and where can I go about it?

    set(Employees)
    loop until Access:Employees.Next()

        If   clip(EMP:EmployeeLastName) ='' or len(clip(EMP:EmployeeLastName)) = 1
              EMP:EmployeeLastName = '* Last Name Field EMPTY *'
        end
         EMP:EmployeeCombinedName = clip(EMP:EmployeeLastName)&' '&clip(EMP:EmployeeInitials)&' '&(EMP:EmployeeTitle)&' '&clip(EMP:AlsoKnownAs)
           IF EMP:IsPostalSameAsPhysical
              EMP:PostalAddress1 = EMP:PhysicalAddress1
              EMP:PostalAddress2 = EMP:PhysicalAddress2
              EMP:PostalAddress3 = EMP:PhysicalAddress3
              EMP:PostalAddressPCode = EMP:PhysicalAddressPCode
            end
        Access:Employees.Update()
       
    end
   
Thx
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Running Source Procedure from menu
« Reply #1 on: January 05, 2012, 06:54:43 AM »
When the user selects the menu item, you'll want there to be "some response" so they know what is happening.

the way I'd probably do it is to open a WebForm, which contains some text on what is about to happen, with a Start button. Then when they click start you can call a procedure that does your code (probably a normal Source procedure, albeit one that takes p_web as a parameter) - then you can show a progress bar so the user can see how long the process is taking.

you'll want to check the Upgrade-to-NT6 doc, and play around with the Start button and Progress bars to get it working. But I think that'll give the most feedback to the end user.

cheers
Bruce

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: Running Source Procedure from menu
« Reply #2 on: January 05, 2012, 09:01:19 AM »
Thx Bruce

On this WebForm, can I have various Start buttons ie from one form run different Source Procedures?
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: Running Source Procedure from menu
« Reply #3 on: January 05, 2012, 08:12:11 PM »
Yes