Pass Parameter from Form to corresponding Table...

JutJut Member Posts: 72
Hallo!

I'm seriously fighting with one small tiny problem.

I try to customize the Account-Schedule-Form. Unfortunately, many information inside this form are stores inside of variables. Now, if the user enters for example a new Date-Filter, I need to use the information of same variables (e.g. ColumnLayoutName) in the On-Validate-Trigger of the corresponding table (Acc. Schedule Line). I tried to manage it using a Set-Function in the table which is called from the form and stores the values in a global var in the table- but the value of the global var is always lost in the trigger.
I even tried it the other way round: in the onvalidate-trigger i created a from var (account schedule form) and then i call the get-function of this form. but it still doest help because there seems to be no connection to the form the user used to enter the date-filter. Can anyone help me with this problem?

I hope you understand what I mean :)

bye bye
Jut

Comments

  • kinekine Member Posts: 12,562
    1) Can you post your code?
    2) Are you passing the values into function through Rec variable or some new global defined?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • JutJut Member Posts: 72
    1) yeah of course:
    This is inside table acc. schedule line. AccSchedForm ist a for-variable with subtype: account schedule form

    { 11 ; ;Date Filter ;Date ;FieldClass=FlowFilter;
    OnValidate=BEGIN

    IF NOT AccSchedManagement.CheckUserRight(Rec,AccScheduleForm.GetAccountLayoutName()
    ,AccScheduleForm.GetAccountScheduleName()) THEN
    ERROR(Text016);
    END;

    CaptionML=[DEU=Datumsfilter;
    ENU=Date Filter] }
    This is my Get-Function in the Account-Schedule-Form:

    PROCEDURE GetAccountScheduleName@1109200008() : Code[10];
    BEGIN
    EXIT(CurrentSchedName);
    END;


    As you can see, only the global-var CurrentSchedName of the form is passed to the table.
    I started the form and changed the DateFilter.Unfortunately, no value is retrieved from the form although the global-var CurrentSchedName certainly has a value!

    2) The other way round (from form -> table) I passed it through Rec-Variable.
  • JutJut Member Posts: 72
    The only way I could get the value from form to table was by using my codeunit 8 (accScheduleManagement) to store the values - but I had to make it singleInstance what probably is no good idea :D
  • kinekine Member Posts: 12,562
    Of course that you cannot read the value from form (pull the value). You need to use Push method. You need to use something like this in the form:
      Rec.SetMyGlobalVariable(Value);
      Rec.VALIDATE(MyField,FieldValue);
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.