autorefresh form

karuchuakaruchua Member Posts: 151
how can i auto refresh a form upon running the form from modal.

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Can you be more clear?
    what exactly is your requirement?
  • karuchuakaruchua Member Posts: 151
    can i auto refresh a form that have run modallly.
  • ChinmoyChinmoy Member Posts: 359
    Can you give us some details about the following:

    1. What form is this? - customized or standard?
    2. What type of form is this?
    3. Does this form have subforms in it?
    4. How is the form opened? Is there any code getting automatically fired when the form opens / periodically?
    5. Some more details (if you think that may help us suggest a solution)...

    Chn
  • karuchuakaruchua Member Posts: 151
    ok, this is what i have done.


    i have a report that am running,upon passing the filters to the report, its opens the form modally see the code below.
    IF GSuggestPrices THEN BEGIN
      Window.OPEN('Processing    #1########## \' +
                  '@2@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@' ); 
    
      FnCheckItemLE;
      TempItemsREC.SETCURRENTKEY(TempItemsREC.Make,TempItemsREC.Model,TempItemsREC.Category);
      TempItemsREC.COPYFILTERS(Item);
     [b] FORM.RUNMODAL(FORM::"Inventory With Zero Movement",TempItemsREC);[/b]
      CurrReport.QUIT;
    END;
    
    CLEAR(GNo);
    


    upon opening this form with the details i have filtered i want to view, in the header of the form i have field known as percentage , here i enter the percentage value i want,then it modifies on my fields,lets call it unit price by that percentage value.


    the problem is that when i pass this value the field am modifying doesn't auto refresh until i close the form and open it again.

    i want once i pass the value,that field is refreshed automatically with my new value.

    in the form i have set autoupdate properties to yes,autotimer but none is working,even on modify trigger of the form but to no avail
  • ChinmoyChinmoy Member Posts: 359
    After you modify the record in the code, did you try CurrForm.UPDATECONTROLS?

    If the code which is modifying the record is written inside the form, this method should work fine. Let us know whether this works for you?

    Chn
  • karuchuakaruchua Member Posts: 151
    i have tried that but still doesn't work
  • ChinmoyChinmoy Member Posts: 359
    That's quite odd. You can also try using CurrForm.SAVERECORD before the updatecontrols, but that's it, nothing else is coming to my mind now to refresh the records on a form. Let's see if we get anymore ideas here.

    Chn
  • karuchuakaruchua Member Posts: 151
    anyone else with any other idea on how to go about this.
  • SogSog Member Posts: 1,023
    You say in the header of the form is the textbox with the percentage.
    Does that mean your form has a subform?
    If that is the case, refresh the subform...

    BTW you say that after you edit the percentage. it triggers an update on the records.
    What happens when you enter the wrong percentage? can a user easily edit the percentage over and over without losing the initial values of the records?
    This I ask because when you add for example 7% it is not the same as subtracting 7%, and mistakes are hard to undo.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • karuchuakaruchua Member Posts: 151
    in the header is where i have the percentage which am passing to the form which is just one form,no subform.


    yes the user can modify the percentage over and over again,coz the field we are modifying is not that critical ,its just for analysis purposes.
  • SavatageSavatage Member Posts: 7,142
    so you're entering a "percentage" into a field and it's not updating the corresponding field "unit price by that percentage value" can you show us the code that's OnValidate of your "percentage" field?

    IS your code on the form or on the table?
  • karuchuakaruchua Member Posts: 151
    the form
    LItemREC.SETRANGE(Category,Category);
    
    IF LItemREC.FINDSET THEN BEGIN
      LCount := LItemREC.COUNT;
      LWindow.OPEN('Calculating New Disposal Selling Price  ########1# \'+
                  'Item #########3# : #########4# \\Progress Update @5@@@@@@@@@');
      LWindow.UPDATE(1,Category);
      //LWindow.UPDATE(2,"Vendor No.");
      REPEAT
    
       LWindow.UPDATE(3,LItemREC."No.");
       LWindow.UPDATE(4,LItemREC.Description);
    
       LItemREC."Suggested Disposal Price" := ROUND(LItemREC."Unit Price" * (1 + (GPercent/100)));
    
    
       LItemREC.MODIFY;
    
       LWindow.UPDATE(5, LItemREC."Suggested Disposal Price");
    
    
    
      UNTIL LItemREC.NEXT = 0;
    
    END;
    
Sign In or Register to comment.