how to refresh Subform

hai all… i have subform that bound to a table

but at the header it is a unbound form

so if i gave the parameter in DocumentNo at the header

it should be appear in the subform all records that same with the documentNo

the code is right, but i should refresh it manually (by pressing CTRL + ALT + F5)

CekStokBOM.RESET;
CekStokBOM.SETRANGE(“Document No.”,DocumentNo);
CurrForm.SubFormCekStok.FORM.SETTABLEVIEW(CekStokBOM);

what code should I add, if I want to refresh it automatically?

thanks

What i understood , you want to update the subform. What you can do is to create a function e.g; XX, without any parameters or any return value. Under this function XX, write code CurrForm.UPDATE. So your next line will be CurrForm.SubFormCekStok.FORM.XX;

Is this what you want?

where we should add that code?

form from subform?

or form header?

i already make functions like you told me at form header…

but it couldn’t , it was said that i must create C/AL global for XX

it should be form header. the function XX will be in the subform. and call this funtion from the form header. Like the way i told you.

exactly !!! this is what i want

thanks a lot IMRAN :slight_smile: