CA Service Management

Expand all | Collapse all

ca_fdFetchSelectData too slow to select Items

  • 1.  ca_fdFetchSelectData too slow to select Items

    Posted 07-17-2017 07:25 AM

    Hi Guys,

     

    I create a form containing a dual list which should be filled with group names and select the items assigned to the user. Its triggered by an user selection field and the code is working when I call them separately but as the ca_fdFetchSelectData function is called asychnonous and takes about 10 seconds (even when the db statement runs in milliseconds) to fill the dual list, the select statements run before the fetch is done.

     

    How can I be sure, that the fetch is done before starting the select statements? 

     

    Here the code:

    // select the groups

    ca_fdFetchSelectData(ca_fd.formId, 'sd_groups');

     

    // assign associated groups
    ca_reportQuery('sd.mygroups', {'userid':ca_fdGetTextFieldValue('form_ca_servicedesk','benutzerid')}, function test(result) {
    if (result.length > 0){
    for (i=0; i<result.length; i++){
    ca_fdSelectOption(ca_fd.formId, 'sd_groups', result[i]['name'],result[i]['name']);
    }
    }
    }, null);

     

     



  • 2.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 07-17-2017 08:50 AM

    As additional Information I'd like to mention, that the query itself take under a second (also in the report data view) but it takes about 40 seconds to fill the dual list field using the ca_fdFetchSelectData(ca_fd.formId, 'sd_groups'); function with f.e. 8 entries.



  • 3.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 07-17-2017 09:49 AM

    Good Afternoon Christian.
     
    Although I do not know how to speedup the 'SelectData'. possibly, the following will help you further?
    As to this: ca_fdFetchSelectData(ca_fd.formId, 'sd_groups');
    Please see whether you can make use of setTimeout function.
    To wait for the 'Select' to complete before further processing?
     
    Thanks and kind regards, Louis.



  • 4.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 07-17-2017 10:28 AM

    Hi Louis,

     

    I also thought about that but as I don't know how long it really takes to complete the fetch data function, I must set this to about 60 seconds or more and this is not practicable as the enduser don't want to wait this long. 

     

    Is there any debugging possibility to find out what takes him so long to fill the dual list field? 

    I also tried to prefill the list when its loaded (without user fetchSelectData) but it also takes about 40 seconds to get displayed. 



  • 5.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 07-18-2017 01:56 AM

    Good Morning Christian.
     
    For now, I tend to say you can use the browser-debug(F12) function.
    And see in there what's happening?
     
    Thanks and kind regards, Louis.



  • 6.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 07-18-2017 05:02 AM

    Hi Christian,

    I see you're still on 14.1.02 - it may be worth you checking out the performance improvements in the new 14.1.04 update as well; there have been several changes for form performance:

     

    CA Service Catalog Fixed Issues - CA Service Management - 14.1 - CA Technologies Documentation 

     

    regards

    Iain



  • 7.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 07-18-2017 06:45 AM

    Hi Iain,

     

    I'm not aware of CP4 and CP3. Where can I download them? In the download center only CP1 and 2 are available.



  • 8.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 10-24-2017 07:18 AM

    Hi Iain,

     

    we are now running on CP4 and it still takes about 40 seconds to execute. When I run the statement against the database I get a result within milliseconds. 

     

    Cheers

    Chris



  • 9.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 07-18-2017 06:48 AM

    Good Afternoon Christian.

     
    Recently, SM(and included SLCM) 14.1.04 cumulative patch has been made available.
    Please download and apply the corresponding 'product' patches and confirm the issue as described in this case is then resolved.
    With this patch applied on a local server, the issue as described in this case was resolved.
     
    How to apply CA Service Management CP4 patch.
     
    Patch information to be found through page:
    https://docops.ca.com/ca-service-management/14-1/en/release-information/ca-service-management-release-14-1-04
    https://communities.ca.com/community/ca-service-management/blog/2017/07/05/ca-service-management-141-cumulative-patch-4-14104-is-now-available
     
    Hereby some more details on the Common Installer.
    Download RO96941.CAZ (e.g. in folder RO96941_CASM_14.1.04_VALUEPACK)
    Extract with cazipxp -u RO96941.CAZ
    As it will extract the Common Installer for the CP4 patch: CASM_14.1.04_CommonPatchInstaller_Win.zip
     
    Unzip file CASM_14.1.04_CommonPatchInstaller_Win.zip
    After the UNzip, you'll see folder CASM_14.1.04_CommonPatchInstaller_Win
    In there (among others) the folder \patches\<product>\Binaries.
    And the products are: ITAM, SDM, SelfService(USS), SLCM, SLCMPREREQ, xFlow.
     
    Open the above named folder CASM_14.1.04_CommonPatchInstaller_Win.
    Execute the common installer setup.exe.
    - Accept the 'terms of license' > Next
    - Database Configuration > Next
    - Select the Products to be updated (check/UNcheck per your choice) > Next
    - Mandatory Post-Install for SDM > Yes
    - CA Embedded Entitlements Manager(EEM) Details > Next
    - Patch Information Summary > Next
    > Install
    > The installation begins.
    While installing SDM it is split into 3 parts:
    1. SDM-Binaries
    2. SDM-MDB
    3. SDM-Localization
    4. 'Applying CA Service Catalog Patch' 'Hanging' at 75%.
    Although it seems to hang, it does not.
    It 'just' takes a while (up to 45 minutes) to execute in full.
    And then it is finished at 100%
    5. Applying Unified Self-Service Binaty Patch
    6. SDM Post Installation Steps
     
    Kind regards, Louis van Amelsfort.



  • 10.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 07-18-2017 06:53 AM

    And here's a direct link for the patch download, in case you're having trouble finding it:

     

    https://support.ca.com/irj/portal/solncdndtls?aparNo=RO96941&os=WINDOWS&fc=3&actionID=3

     

    (edit - for clarification, the reason you can't find 14.1.03 is that there was no CA Service Catalog component to the CA Service Management 14.1.03 update)



  • 11.  Re: ca_fdFetchSelectData too slow to select Items

    Posted 10-24-2017 12:46 PM

    #callback

    Hi,

    This is more of a JavaScript thing.

    To answer your question

    How can I be sure, that the fetch is done before starting the select statements? 

    You should use a callbackFunction. So basically, as this one function doesn't provide support out of the box, you have to encapsulate your ca_fdFetchSelectData in a function that has a callBack. This will ensure that the code only runs after that.

     

    A really good explanation on how callback works can be found here (with examples):

    http://recurial.com/programming/understanding-callback-functions-in-javascript/