Affzo not working without mask abbreviation?

SOLVED

Hi

When I use the following line of code

Affzo [M]ITMDES2(NLIG)

I get the following exception

According to the documentation at https://online-help.sageerpx3.com/erp/12/staticpost/affzo/ this should be working

If I check the value of the field on that mask on that line using an Infbox, the field and the value is existing.

Also, if I set the screen abbreviation explicitely (like [M:SIH4]), it works as well.

Since the code is running on multiple different screens, setting the screen abbreviation explicitely is not an option.

Has anyone ever had the same behaviour?

I know, the chances that I'm getting a feedback on thi aren't very great, but it's friday and I am trying my luck ;-)

  • 0

    When you refer to "[M]" it makes use of the values preset by the supervisor into the the default set. But when you use "Affzo [M:SIH4]ITMDES2" it knows the context to which you are referring. You seem to be working in a specific of TRTVENTAR, I am not sure what the specific is that you are working, but that is sales price search function. Could you maybe if you give a bit more context as to what you are trying to do and from where?

  • 0 in reply to Regard Hulsbos

    Hi Regard, thanks for you reply. You're absolutely right, we need to implement a custom price calculation which we want to use in several different functions like SQH, SOH, SIH. That's why we want a dynamic solution that could be possibly used for other funtions in the future...

    For now I had to set all possible variants explicitely to get it work. Ugly version but it does the job for now.

    If clalev([M:SIH4]) <> 0 and dim([M:SIH4]ITMDES2) > 0 : Affzo [M:SIH4]ITMDES2(NLIG) : Endif
    If clalev([M:SOH4]) <> 0 and dim([M:SOH4]ITMDES2) > 0 : Affzo [M:SOH4]ITMDES2(NLIG) : Endif
    If clalev([M:SQH2]) <> 0 and dim([M:SQH2]ITMDES2) > 0 : Affzo [M:SQH2]ITMDES2(NLIG) : Endif

    Best regard(s) ;-)

    Benjamin

  • +1 in reply to Benjamin Eich
    verified answer

    Good day Benjamin, Without knowing exactly the exact point of the branch, there is a variable indicating in some of the subprograms which indicate the mask code, but for the most part, sections do the same conditional test as you or value within [V]GFONCTION. You do not need to have both conditions, the first condition is enough as the value of dim for a non-existent variable is -1.   

    If dim([M:SIH4]ITMDES2) > 0   : Affzo [M:SIH4]ITMDES2(NLIG)   : Endif
    If dim([M:SOH4]ITMDES2) > 0 : Affzo [M:SOH4]ITMDES2(NLIG) : Endif
    If dim([M:SQH2]ITMDES2) > 0 : Affzo [M:SQH2]ITMDES2(NLIG) : Endif