Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Re: Problem calling a module
Wed, Jul 19 2017 8:51 AMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 7/19/2017 7:08 AM, Paul Coshott wrote:
> I am currently trying to write a module that will accept a field name and then using that field return the next ID for use in my EWB app.
> For example, if I'm adding a new client, before saving the new client, I'll make a call to the module using 'ClientId' as the field name. The (delphi) module itself is fine, but I am not even able to call it, as I'm doing something wrong in my EWB app.
> I have a form that is never shown, it is just used for common functions and procedures to be called from anywhere in the app. The following is the form's code. I have indicated in the code below where it fails, and the error is:

Is the actual form created either by you or IDE ?

In project options is the frmAppProcedures listed under "Auto-create
Forms and Databases" (Forms and Databases Tab).

If not then you need to either add it there or create it in your code on
app startup (i.e. frmAppProcedures := TfrmAppProcedures.Create... ).

easiest way to do latter would be to create it dynamically if needed.


function GetNextSystemId(sIdField : string) : integer;
begin
  Result := -1;

  if not assigned(frmAppProcedures ) then
      frmAppProcedures := TfrmAppProcedures.Create(Application);

  with frmAppProcedures do begin
    with srNextId do begin
      Method := rmPost;
      ...


Raul
Image