Question Status

Suggested Answer
jsshivalik asked a question on 16 May 2018 5:26 AM

Hi

    I want when Page opens it should not show data in Sub Form . On click of button i want to refresh sub form with Data.

Thanks

Reply
Suggested Answer
Suresh Kulla responded on 16 May 2018 7:40 AM

You need to use then a temporary table as the source of the subform and populate those values by action. 

Reply
jsshivalik responded on 16 May 2018 7:51 AM

Hi Suresh

   I agree with your first point .  Can u provide some example how to do this point

populate those values by action. Will it has to be done in Main Form . I have Main Form & Sub Form . Currently what is happening Data automatically gets displayed in Sub Form .

I want when user press button then Data gets displayed in Sub Form.

Thanks

Reply
Suggested Answer
Suresh Kulla responded on 16 May 2018 8:01 AM

Check Page 160 or 161, the subform is temporary and in this case it will populate the values using GetVATSpecification or SetVATSpecification, it does not do by the action but you need to apply that kind of logic in your scenario.

Populate the Temporary table on the action.

Reply
jsshivalik responded on 17 May 2018 9:48 AM

Hi

I have Location table as Main and Custom Table Issue Lines on Sub Form. I have set temporary table as the source of the subform

CDNLine is of Record Data Type with SubType Issue Lines.

 I have written below code on Push of Button but not working

TEntry.RESET;

TEntry.SETCURRENTKEY("Location",Date);

TEntry.SETRANGE("Location","No.");

TEntry.SETRANGE(Date,TempDate,WORKDATE);

IF TEntry.FINDFIRST THEN REPEAT

 Amount := 0;

 TPLine.RESET;

 TPLine.SETRANGE("Location","No.");

 TPLine.SETRANGE(Date,TempDate);

 IF TPLine.FINDFIRST THEN REPEAT

   Amount += TPLine."Amount";

 UNTIL TPLine.NEXT = 0;

 IF Amount > 0 THEN BEGIN

   CDNLine.RESET;

   CDNLine.SETRANGE("Location","No.");

   CDNLine.SETRANGE("Sale Date",TempDate);

   IF CDNLine.FINDFIRST THEN BEGIN

     CDNLine."Sale Amount" := Amount;

     CDNLine.MODIFY;

   END ELSE BEGIN

     CDNLine.INIT;

     EntryNo := EntryNo + 1;

     CDNLine.VALIDATE("Location","No.");

     CDNLine.VALIDATE("Entry No",EntryNo);

     CDNLine.VALIDATE("Sale Date",TempDate);

     CDNLine.VALIDATE("Sale Amount", Amount);

     CDNLine.INSERT;

   END;

 END;

 TempDate := TempDate + 1;

UNTIL TempDate > WORKDATE;

CurrForm.UPDATE(TRUE);

Thanks

Reply
Suggested Answer
Suresh Kulla responded on 16 May 2018 7:40 AM

You need to use then a temporary table as the source of the subform and populate those values by action. 

Reply
Suggested Answer
Suresh Kulla responded on 16 May 2018 8:01 AM

Check Page 160 or 161, the subform is temporary and in this case it will populate the values using GetVATSpecification or SetVATSpecification, it does not do by the action but you need to apply that kind of logic in your scenario.

Populate the Temporary table on the action.

Reply