Options

Page Vs Form

navuser1navuser1 Member Posts: 1,329
edited 2012-03-10 in NAV Three Tier
Dear All,

I have creates a Card Type Page(TandC,ID 50008) to Store some information against Sales Quote and Sales Order. I want that few fields/Controls should be non-editable when it being opened by Sales Order Screen. To do these I have written a Function in the Page(ID 50008). :
SetData(VAR Flag : Boolean)
EditableControl :=Flag;

And this EditableControl is used in Controls property(Editable) as required. ref http://www.mibuso.com/forum/viewtopic.php?f=32&t=33236&hilit=currForm.Control+RTC

In the Sales Order Screen, I have added the below code in the Action to open the TandC Page:

<Action1000000002> - OnAction()
TESTFIELD("No.");
SalesLn.RESET;
SalesLn.SETCURRENTKEY("Document Type","Document No.",Type,"No.");
SalesLn.SETRANGE("Document Type","Document Type");
SalesLn.SETRANGE("Document No.","No.");
SalesLn.SETRANGE(SalesLn.Type,SalesLn.Type::Item);
IF SalesLn.FINDFIRST THEN BEGIN
SalesLn.TESTFIELD(SalesLn."No.");
SalesLineCopy :=SalesLn;
END
ELSE
ERROR(CSATEXT01);

CLEAR(TCForm);
TCTab.RESET;
TCTab.SETRANGE("Document Type","Document Type");
TCTab.SETRANGE("Document No.","No.");
TCForm.SETTABLEVIEW(TCTab);
Flag :=FALSE;

TCForm.SetData(Flag);
TCForm.RUNMODAL;

But it does not work.
I can open the Screen(TandC, ID 50008) from the Sales Order where it is fully non-editable and
I can get the required result from the same Screen (TandC, ID 50008) after clicking the New in Action Button.

How to solve these issue.
kindly reply.
Now or Never

Answers

  • Options
    carboncarbon Member Posts: 22
    I have not read your post too much. But be sure variable used in Editable property has set IncludeInDataset property to Yes.
  • Options
    navuser1navuser1 Member Posts: 1,329
    carbon wrote:
    I have not read your post too much. But be sure variable used in Editable property has set IncludeInDataset property to Yes.

    already done.
    issue is still there. ](*,)
    Now or Never
  • Options
    navuser1navuser1 Member Posts: 1,329
    Is there any solution ?
    Now or Never
  • Options
    carboncarbon Member Posts: 22
    Really not except to use show value by using message(Format(Flag);).
  • Options
    SogSog Member Posts: 1,023
    If you open the page in view mode, it's normal that nothing is editable.
    When you go to edit mode, then you'll probably get the desired result.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Options
    navuser1navuser1 Member Posts: 1,329
    I have removed the following line from my code and now it works.
    TCForm.SETTABLEVIEW(TCTab);
    
    Thanks to all
    Now or Never
Sign In or Register to comment.