locked
Save as Completed + Save and New RRS feed

  • Question

  • Hi,

    I'm trying to implement a function in one of the activity forms that does save as completed + save and new in one operation. I.e. you click the save as completed, and you will be asked if you would like to enter more ....

    I have tried different combinations with

    crmForm.SubmitCrmForm(58, true, true, false);
    crmForm.SubmitCrmForm(59, true, true, false);

    ... but with no luck. I hope that I don't have to make a funny solution to this (jscript or WF closing etc...).



    Morten

     

     

    Thursday, June 4, 2009 11:56 AM

Answers

  • Here is a suggestion that might work.
    The following example binds to the unload event and opens a new activity window after the save and completed is called.

     

    e.g.

     

    //toolbar button

    <button JavaScript=’SaveAsCompletedAndNew();’ />

     

    SaveAsCompletedAndNew = function()
    {
           window.onunload = UnloadEvent;   

           //Save as Completed

           SaveAsCompleted();

    }

     

    UnloadEvent = function()
    {

          //And New
          window.open(‘activity url’, ‘window name’, ‘features’);
    }


    Blog: http://mscrm4ever.blogspot.com/ * Website: http://gicrm.upsite.co.il/
    Monday, June 8, 2009 7:46 AM

All replies

  • Hi Morten,

    Try : _MBcrmFormSubmitCrmForm59truetruefalse.click(); on OnSave of the activity form.
    Regards,
    Chinmay
    http://metrix.blogspot.com
    Thursday, June 4, 2009 12:57 PM
  • That will not work, it's the same as I have tested with crmForm.SubmitCrmForm(59, true, true, false);
    i.e. your click event calls this function.
    Thursday, June 4, 2009 7:52 PM
  • It did work for me... otherwise I would not have suggested it. It's your call :)

    And yes.. one more thing.. there is a HUGE difference in window.execScript(function) and a normal function call.


    Regards,
    Chinmay
    http://metrix.blogspot.com
    Friday, June 5, 2009 6:46 AM
  • Hi,

    The issue you I had was that I managed to get it set to completed, but that it did not open a new window as in save and new. I got the same result with your approach, i.e. it did not fire up a new screen. But I might have done something wrong.

    Could you confirm that when you
    1. press the save&new button that it saves your record as completed,
    2. and that a new screen appears?

    .... in that case I'm doing something wrong ....

    Morten
    Monday, June 8, 2009 6:57 AM
  • Here is a suggestion that might work.
    The following example binds to the unload event and opens a new activity window after the save and completed is called.

     

    e.g.

     

    //toolbar button

    <button JavaScript=’SaveAsCompletedAndNew();’ />

     

    SaveAsCompletedAndNew = function()
    {
           window.onunload = UnloadEvent;   

           //Save as Completed

           SaveAsCompleted();

    }

     

    UnloadEvent = function()
    {

          //And New
          window.open(‘activity url’, ‘window name’, ‘features’);
    }


    Blog: http://mscrm4ever.blogspot.com/ * Website: http://gicrm.upsite.co.il/
    Monday, June 8, 2009 7:46 AM
  • Hi Adi,

    You are right; I must use the window.open to do this. Thanks for your effort! ... and the onunload was new to me ... cool!

    Morten
    Monday, June 8, 2009 8:10 PM