Get current Matrix cell

Hi,
I'll try to be clear on that one. I want to get the column ID i'm currently focusing. For example, in the screenshot :
1. The user type default values in Area 1 (Red)
2. He focuses the cell he wants the default values to be typed (Area 2 in blue + Area 5 in pink)
3. When he presses enter on the cell, the line is created in Area 3 (green) with the correct "Resource No." and "Date"

Problem is, if I just type the data manually, it'll work because in the code I passed 1, 2, 3 etc... depending on which "OnAfterValidate" it is. And i want to use the button marked as 4 ("Create Line") to automatically fill the value "10" (in area 1) into the cell i'm focusing.
Is there any way to achieve it ? The only thing to have is basically the currently focused column ID (from 1 to 12 in this example).

qxbi7c04mp85.png


Thanks.

Best Answer

Answers

  • MaximeDawnsMaximeDawns Posts: 6Member
    OK i'll give it a try. But I can't actually find this assembly : Microsoft.Dynamics.Framework.UI.WinForms.Controls.BusinessGrid

    I only get this for "Microsoft.Dynamics.Framework"
    99nkrckcn6ji.png

    In the "Server" Tab wi56nni8azle.png
  • da_nealda_neal Posts: 50Member
    edited 2019-03-12
    Copy needed component from \\RoleTailored Client\ to \\RoleTailored Client\Add-ins\
  • MaximeDawnsMaximeDawns Posts: 6Member
    Alright ! All variables set now (thanks a lot for your help by the way). Now two error messages.

    First when I open the page :
    svjf66mxaf27.png

    Second, when I click the Action :
    i1wkjpla6yhl.png


    I think the error might wome from what you call "PageID" and "RepeaterID". Here's what i took :
    Page ID :
    ysckr7nx5c93.png

    And RepeaterID :
    m455iz8rzy6d.png
  • krikikriki Posts: 8,670Member, Moderator
    [Topic moved from 'NAV Tips & Tricks' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
    NAV TechDays 2019: 21 & 22 November 2019, Antwerp (Belgium)
  • da_nealda_neal Posts: 50Member
    edited 2019-03-14
    PageID It is Object ID
    RepeaterID is ok but better make for example number = 1, it is not ok for big value (i do not know why :smile: )
    And i forgot to say that dot net variables must be declared RunOnClient=Yes.
  • MaximeDawnsMaximeDawns Posts: 6Member
    Ok so now, page is opening then closing instantly, wiht no error message :disappointed:
  • MaximeDawnsMaximeDawns Posts: 6Member
    Tried commenting and uncommenting line by line. Appears to be this line causing the issue of instant closing:
    lFormCollection := lApplication.OpenForms;
    
  • AlexDenAlexDen Posts: 23Member
    CurrForm and BusinessGrid variables should be global.
  • MaximeDawnsMaximeDawns Posts: 6Member
    edited 2019-03-13
    Alright ! I don't really get why CurrForm has to be Global but ok. It's working properly now. Thanks guys
  • da_nealda_neal Posts: 50Member
    edited 2019-03-13
    If variable is local it is destroyed after using. If variable is global it is alive until page opened.
    In dot net, variables transfers by reference, so your Currform variable it is single reference to page. And when variable cleared it is destroy own page.
Sign In or Register to comment.