Impossible!!!

pedroccdapedroccda Member Posts: 90
:twisted: :twisted: :twisted:

I'm trying to get a Decimal value from a table ( DettProvvigioniPrezzi."% Provvigione" ) and convert it in Text of lenght 2 (variable Val).


Val := FORMAT(DettProvvgioniPrezzi."% Provvigione");

Debugging I can see that DettProvvgioniPrezzi."% Provvigione" is equal to 5, but making conversion the var Val become equal to 0! Why?? I thinked it's due to lost of information during conversion and so I tried using a Text of 30 but it's the same thing!! Someone can help me please?? I'm working with Navsion since few days and I have understand many things..... ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)
Kiki

Comments

  • ara3nara3n Member Posts: 9,257
    is that field a flowfield? if it is you need to write
    DettProvvigioniPrezzi.caclfields("% Provvigione");

    before your line. A flowfield is a field that looks into anther table and displays the value. When you code you have to write calcfields in order to calculate the value at run time.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • pedroccdapedroccda Member Posts: 90
    I think it's not a flowfield, and anyway it's yet valorized before I use it(in this particular case is equal to 5 during debug). I'll report you more code:


    IF DettProvvigioniPercentuali."% Provvigione" = 0 THEN BEGIN -> Here is 5
    Val := '0';
    END ELSE IF DettProvvigioniPercentuali."% Provvigione" <> 0 THEN BEGIN -> Here is 5
    Val := FORMAT(DettProvvgioniPrezzi."% Provvigione"); -> Here set VAl to 0???!!!

    END;
    Kiki
  • pedroccdapedroccda Member Posts: 90
    I have solved this problem.... \:D/ \:D/
    Kiki
  • ara3nara3n Member Posts: 9,257
    and the problem was?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • pedroccdapedroccda Member Posts: 90
    The problem is so stupid.... the code should use DettProvvigioniPercentuali."% Provvigione" in this part of code but I used DettProvvigioniPrezzi."% Provvigione" becouse of an my error during copy and paste. I manage two tipe of provvigioni, based on % or based on fixed $ and the code is similar, so I use copy and paste from Prezzi but one line of code was not updated to manage Percentuali. :roll:
    Kiki
Sign In or Register to comment.