Updating the Caption of a Field on a Page Dynamically

BlackStarBlackStar Member Posts: 9
edited 2011-02-24 in NAV Three Tier
Hello,

I've been searching through the board but I didn't seem to find a solution for that. I've placed several fields on a card type page. Depending on the current record I want to change the captions of them. I've tried to use the CaptionClass property with the name of another field so the content of the field is shown as the caption. It works for the first record when the page is being opened but the caption doesn't get updated when switching to the next record. It seems I need to call some kind of UpdateControls function in the OnAfterGetRecord trigger but this function is missing in RTC. Does anybody have an idea for that?

Regards

Comments

  • deV.chdeV.ch Member Posts: 543
    This could be related to the same problem as the Visible Proberites which need to be controlled via Boolean that has to be set to IncludeInDataset=TRUE.

    I would try tu use a Var of Type Text and set IncludeInDataset=TRUE. then work with this var. IF this doesnt work i assume you need to close and reopen the page to achieve that...
  • BlackStarBlackStar Member Posts: 9
    Thank you for your response. I tried what you suggested. Unfortunately it didn't work out. The caption stays the same until I press F5 for refreshing the page.
  • BeliasBelias Member Posts: 2,998
    you can try with a
    CurrPage.UPDATE(FALSE);
    
    in the onaftergetrecord
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • BlackStarBlackStar Member Posts: 9
    I'm afraid this does not work, neither.
  • Marc_Hansen_[MSFT]Marc_Hansen_[MSFT] Member, Microsoft Employee Posts: 12
    Hi BlackStar,
    Sorry what you trying to do is not possible. The RTC dynamic captions are not as dynamic as in Classic Client, the main reason for this is that we wanted to keep the C/S communication to a minimum for performances reasons.
    It might be that you can solve your problem in another way.
    Why is it you want to change caption based on the record?
    /Marc
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • BlackStarBlackStar Member Posts: 9
    In our upcomming product we want to offer our customers the opportunity to customize a set of fields in some tables for their own purposes. There is a setup where they can indicate the captions of the fields and, as appropriate, valid input values for these fields. These captions and valid input values depend on the current contents of another field within the same table. So maybe if field A contains "P" the caption of one of the customizable fields switches to "Zone Value", and if field A contains "Z" the caption of the customizable field switches to "Height Value".

    Regards
  • BeliasBelias Member Posts: 2,998
    "Marc wrote:
    "]Hi BlackStar,
    Sorry what you trying to do is not possible. The RTC dynamic captions are not as dynamic as in Classic Client, the main reason for this is that we wanted to keep the C/S communication to a minimum for performances reasons.
    It might be that you can solve your problem in another way.
    Why is it you want to change caption based on the record?
    /Marc
    and what about dimension combination matrix? the caption is dynamic for that page :-k
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • EgnazEgnaz Member Posts: 111
    Have you thought about CaptionClass functionality ??

    Sounds like that what you're looking for

    Regards,
    eganz
  • BlackStarBlackStar Member Posts: 9
    Belias wrote:
    "Marc wrote:
    "]Hi BlackStar,
    Sorry what you trying to do is not possible. The RTC dynamic captions are not as dynamic as in Classic Client, the main reason for this is that we wanted to keep the C/S communication to a minimum for performances reasons.
    It might be that you can solve your problem in another way.
    Why is it you want to change caption based on the record?
    /Marc
    and what about dimension combination matrix? the caption is dynamic for that page :-k
    Can you give me more information about that?
    Egnaz wrote:
    Have you thought about CaptionClass functionality ??

    Sounds like that what you're looking for

    Regards,
    eganz
    The CaptionClass functionality cannot update the caption of a field on a page record-based. That seems to be by design according to what Mr. Hansen mentioned.
  • BeliasBelias Member Posts: 2,998
    open that matrix page, and take a look at it: if you click the flag, the caption changes.
    unfortunately, i don't remember how to do it and whether it's possible to achieve the same result in the onaftergetrecord.
    Moreover, matrix page is not a normal page, you've to investigate it...i just threw my idea, hoping that Marc Hansen enlight us :whistle:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • BlackStarBlackStar Member Posts: 9
    Do you remember which page number it is? Do you mean 538, which is 9250 and 9251 in the redesigned version?
  • Marc_Hansen_[MSFT]Marc_Hansen_[MSFT] Member, Microsoft Employee Posts: 12
    The Client needs to visit the Server to update the dynamic caption.
    The matrix page properly has a validation trigger, when changing this value the trigger is called and the captions are calculated.
    I am not sure if you also need to do a currPage.Update to make it work.

    In your case you want it updated when you change row. In a row change the Client does not call the Server.

    The only pagetype that visits the Server on a row change is the worksheet. I would not recommend using that as it would also decrease the general performance and it is a misuse of the page type, that could course problems for you later on.

    I would recommend you looking at using a factbox for showing the additional information, if that is what you want to do.
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • BlackStarBlackStar Member Posts: 9
    Hello,

    I agree with you, I won't use a worksheet type page. Aside from the performance reasons, a list would contradict my purpose to place the fields on a card type page. I can't use a factbox though, neither, because the user should have the opportunity to edit the fields just like regular ones.

    I have thought about another solution. I could use a subform on the page showing the fields in question. One column of the list contains the caption of the field, the other one the contents. I only fear that the user won't quite understand the concept of this because it's non-standard and hence takes much getting used to, especially because we will have some other subforms showing other values. That could strongly confuse the user.

    Regards
  • Marc_Hansen_[MSFT]Marc_Hansen_[MSFT] Member, Microsoft Employee Posts: 12
    The solution you suggest sounds like one of our suggestions to the problem.
    But i am not sure why you need a subform, you should be able to put the grid on the page.

    Do you have a screen shot that can help me understand the UI confusion?
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • BlackStarBlackStar Member Posts: 9
    The concept of these customizable fields is only in the process of development as their implementation has a low priority in our current project. Furthermore I'm not quite sure wether I'm allowed to post screenshots or whether they are subject to a corporate secret :( but I will ask someone for permission :)
Sign In or Register to comment.