Caption dynamic?

brauzbrauz Member Posts: 14
Hi everybody,

I'm would like to change the Caption property on an Report 205 (Order Confirmation) at run time for the Order Number...

Anybody knows if this it's posible??

Thanks

Comments

  • krikikriki Member, Moderator Posts: 9,116
    Instead of "STRSUBSTNO(Text004,CopyText)" in the textbox, put a variable and in the "OnPreReport"-trigger fill it up with the value you want.
    (I hope I understood your question correctly)
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • brauzbrauz Member Posts: 14
    Thanks kriki for your reply, but I think than it's no useful for me.

    My problem is that I'm printing this document as pdf, and the name that it suggests when I will save the file is the CaptionML value of the report and I would like to change for a field of the record that will be printed.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You could try to use the System Table 2000000001 Object to modify the name of the object, before printing to PDF.
    recObject.SETRANGE(Type,recObject.Type::Report);
    recObject.SETRANGE(ID,205);
    IF recObject.FIND('-') THEN BEGIN
      recObject.Name := 'New Name';
      recObject.MODIFY;
      IF CONFIRM(recObject.Name) THEN;
    END;
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • brauzbrauz Member Posts: 14
    Thanks,

    This code seems to be a very good, but I don't know how it works. I put in the OnPrereport trigger, and works correctly, change de recObject.name y show it, but the filename still being the original CaptionML value. I try to change recObject.caption but it seems be a Flowfield, and I can't change it.

    Perhaps this cannot be done.

    Greetings
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Try to remove the Caption-property in the report. Maybe then the object-name will be used instead.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • brauzbrauz Member Posts: 14
    Once again thanks Luc for your reply, you are a resources man... :wink:

    I trying with your last suggestion but the report still giving the old name ](*,)

    I'm begining to think that navision not permit this. Caption on the report is not a property that could access from C/AL Symbol Menu :|

    greetings
  • Captain_DX4Captain_DX4 Member Posts: 230
    What about overriding the CaptionML property to a name you desire? Make sure you make the change in the language you are actually using the database with (Tools --> Language...)
    Kristopher Webb
    Microsoft Dynamics NAV Developer
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    He wants to change it using C/AL, because it changes for every order. And this property can't be modified at run-time.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
Sign In or Register to comment.