ObjectID (integer) of a form

mataharimatahari Member Posts: 4
How can I get the object ID (integer) of a form? Form.OBJECTID just returns a string. Is this possible?

Answers

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You need to write some C/AL Code:
    fctGetObjectID(ptxtObjectID : Text[250]) : Integer
    
    EVALUATE(lintValue,COPYSTR(ptxtObjectID,STRPOS(ptxtObjectID,' ') + 1,99));
    EXIT(lintValue);
    

    And use it like this:
    MESSAGE (FORMAT(fctGetObjectID(CurrForm.OBJECTID(FALSE))));
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    :?

    Making a integer of a string and formatting it for a message Luc? :mrgreen:

    Be carefull the OBJECTID does not work when running from the object designer.
  • mataharimatahari Member Posts: 4
    Thanks! It works!
Sign In or Register to comment.