• Updating a Newly-created document within the same Upload - is it possible?

    By Puhn Dunners 2 decades ago

    Hi,



    I am trying to import the phone log into a view with unique Numbers Dialed and consolidate the information in 1 document per dialled number:



    Excel:

    =====

    NumberDialled Date Hour Duration Cost

    35929355132 2006-11-29 12:09:26 00:00:27 0.10

    35929355132 2006-11-29 16:06:49 00:00:19 0.10

    35929355132 2006-11-30 09:30:20 00:00:36 0.12

                <br/>
    

    Notes DB:

    ========

    NumberDialled: 35929355132

    Date (Multiple values): 2006-11-29, 2006-11-29, 2006-11-30

    Hour (Multiple values): 12:09:26; 16:06:49; 09:30:20

    Duration (Multiple values): 00:00:27; 00:00:19; 00:00:36

    Cost (Multiple values): 0.10; 0.10; 0.12

    Total: 0.32

    NoOfCalls: 3



    The problem is that the view is not updated after each imported line and new documents are created instead of updating the existing.



    Any idea for a workarround?



    Cheers,



    Puhn

    • It is possible with a code change

      By David Jeyachandran 2 decades ago

      Hi Puhn,



      Thank you for your excellent feedback. I'll respond properly soon but I thought I should deal with your query immediately.



      It is possible for the views to refresh after documents are added. I've specifically set the code to prevent the refreshing of the view using view.AutoRefresh is false. I've done this primarily for performance. I usually set this option on the Source view because a view refresh can mess with getNextDocument but I can't think of any reason that we can't have the Target view from refreshing.



      To fix this, go to the Script Library "Common-FieldLevelLibrary" and locate the function "getTargetDbViews". Here there is a line that can be changed to AutoUpdate=True

      viewTargets(i).AutoUpdate = False



      You could also put in an explicit viewTarget(0).Refresh in the Script Library "Upload-Library" in the function "processSourceSpreadsheet". Just remember to re-compile all script library afterwards.



      Please let me know how this goes. I may add this in a future release as an option in the Config - "Do you want the Target view to be automatically updated?".



      Thanks again.



      Kind Regards

      David

      • Worked - thanks

        By Puhn Dunners 2 decades ago

        Hi David,



        It worked but only after I did both changes:

        1) AutoUpdate = False

        2) viewTarget(0).Refresh



        I first tried only with the first change, but it did not work.



        Thanks!



        Puhn

    • How to append values when uploading

      By David Jeyachandran 2 decades ago

      Hi Puhn,



      In my last response I discussed how to autorefresh the view. The other part of your question relates to how the phone number data can be appended to the existing information.



      This can be done by uploading the date, duration and cost first into a temporary field eg. date_temp



      You can then in the Advanced Tab and "Fields to Modify - Target Db" set a formula so

      Date := Date: date_temp



      Does that make sense?



      Regards

      David