Jump to content

Enable Synchronous Operations


WillemvanZyl

Recommended Posts

I have Version:1.0.0 build 1424 installed.

 

Based on the demo sample  sUpdate I want to Implement the ShowMask/HideMask for a MailChimp Synchronisation of lists and members. This can be potentially a long process.

 

At first I simply enabled the EnableSynchronousOperations and got the error. I then tried to rather implement it in my actual Procedure (Which is preferable) but yielded the same error:

 

procedure TfrmMobileEditGroups.SyncMailChimpGroup;

Var OKtoGo :Boolean;
    LastErr :String;
    ListID :String;
 
Begin
  Logger('SyncMailChimpGroup; - Start');
  Try
    UniMainModule.EnableSynchronousOperations := True;
    OKtoGo := True;
    LastErr := '';
 
 
    if not dmMailChimpModule.InitDone then
      dmMailChimpModule.Init;
 
    dmMailChimpModule.SetOAuthPropertiesForUser(UniMainModule.qCurrentUserPracticeUserID.AsInteger);
 
    If dmMailChimpModule.OpenMCLists(UniMainModule.qCurrentUserPracticeUserID.AsInteger) Then
    Begin
      //Sync the List and ClientGroup First
      Logger('CheckGroupsandLists');
      ListID := CheckGroupsandLists;
      if ListID <>  '' then
      Begin
        CheckListMembers(ListID);
      End;
 
    End
    Else
    Begin
      OKtoGo := False;
      LastErr := 'Could not retrieve MailChimp Lists';
    End;
 
    if not OKtoGo then
      Messagedlg(LastErr,mtError,[mbOK]);
  Finally
    UniMainModule.EnableSynchronousOperations := False;
  End;
 
  Logger('SyncMailChimpGroup; - Complete');
End;
Link to comment
Share on other sites

I have implemented the whole MailChimp rest api, with the main MailChimp and OAuth2 processes in a datamodule. I have one UI Form that triggers the Synchronization calls with the procedure SyncMailChimpGroup. All this is working perfectly and seamlessly as is with EnableSynchronousOperations=False. When I set EnableSynchronousOperations=True (at design time) I get the error when the login Form opens. So the error occurs long before anything MailChimp comes into play, so in essence MailChimp integration is almost irrelevant. Does that make sense?

Link to comment
Share on other sites

×
×
  • Create New...