Issue in CURFIELDNO Function (NAV) - WEB SERVICE

Ravi_ThakkarRavi_Thakkar Member Posts: 392
edited 2009-05-19 in NAV Three Tier
Hello All,

I just found that, if I go through WEB to access the WEB-SERVICE in NAV at that time,
CURRFIELDNO function will always occupy 0 (Zero) value, which will affect some Business Logic or Technical Logic wrongly.

E.G. I tried to update "Qty. To Ship" field through WEB by using Web Service of Sales Order Sub Form. Refer the attached diagram of code in NAV containing CURRFIELDNO function call.
As a general behaviour, CURRFIELDNO will always contain 0 value on accessing it through WEB.


So, I think it will affect Business Logic badly sometimes, whenever there is a use of this Function. (Please Suggest)

Is there any other option to make it work, properly?
Thanks in Adv.
Ravi_Thakkar
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com

Comments

  • ara3nara3n Member Posts: 9,255
    This is the same behavior if you create a sales line through code in C/AL. Currfieldno would be zero as well.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello,
    Thanks for the reply.
    ara3n wrote:
    This is the same behavior if you create a sales line through code in C/AL. Currfieldno would be zero as well.
    Actually as I have specified, I am not going to create a Sales Line. I am going to modify the Qty. To Ship field value through WEB. And in that case CURRFIELDNO is 0(zero) vale.
    While through NAV side, on doing the same task, CURRFIELDNO field value will be 18.

    Refer the Attched for clear idea.

    Please, suggest me if any sollution.
    Thanks.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • ara3nara3n Member Posts: 9,255
    what I'm trying to say that, if you write c/al code.
    Salesline.get(Salesline."Document type"::Order,'docno',10000);
    Salesline.validate("Quantity to ship",12);
    Salesline.modify(true);
    

    Currfieldno is zero. web service is no different.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    But, through SalesOrder form, in NAV, if you change the field value Qty To Ship, then CURFIELDNO will have 18 value, since it is a form function.

    If I have designed the same form on WEB and To provide the same value to that function, what should I do?
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • kinekine Member Posts: 12,562
    Yes, but from NAV point of view the change is done through code, not by user interactively, and this is the difference. You need to count with it, if the system works differently when code change the value or user change the value, it is bad design. This variable is good for not calling some triggers or functions when the value is changed by code (e.g. to not show some warnings etc.) but not to change the business logic. It must be same in both ways else you can have inconsistent data.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,255
    As far as bad design, that's arguable.
    In his case, the user is actually entering the sales order, but not through RTC, but through some web front end, and he has integrated it through webservice.

    That is why he is expecting the same result. But there are other issue he will run into. For example Nav runs the validating at the time of insert. So you can't control the sequence of what get validated.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Yes, you are exactly right.
    You exactly got my requirement.
    ara3n wrote:
    As far as bad design, that's arguable.
    In his case, the user is actually entering the sales order, but not through RTC, but through some web front end, and he has integrated it through webservice.

    That is why he is expecting the same result. But there are other issue he will run into. For example Nav runs the validating at the time of insert. So you can't control the sequence of what get validated.
    I want to execute the same code as the NAV behaviour.
    Any Suggestion?
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
Sign In or Register to comment.