Update Purchase order header when create purchase line

NavkidNavkid Member Posts: 16
Dear All,

I have a problem which i am still troubled by it. The problem goes like this: I have created a budgeted checkbox(boolean) which will be ticked if the purchase line being created is found in the G/L budget table.

I have implemented the logic and it worked, the issue now is : i need to click on the header in order for the checkbox to be ticked. I now need to configure in a way that when i create the purchase line, the checkbox will be ticked without user click on the purchase header.

I have also searched through mibuso forum on topic such as refresh form where suggestions such as using time interval property. However i have tried the suggestions given and it does not work out for me. I hope if anyone encounters similar problem like me and able to provide advices on it.

Appreciate to all who have read this post. Thanks :D

Best Regards

Answers

  • kinekine Member Posts: 12,562
    That's normal behaviour. Rather teach the users how it works than try to "force" NAV to refresh the form. The field is set correctly, it is just visual "problem", because you do not see the change until the form is updated (e.g. by clicking on the header). I implemented some way of update only in some special cases, but in most cases the users understand that (the refresh is not done each time you change something on subform because performance and other things...).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • vijay_gvijay_g Member Posts: 884
    hi,
    as far as my knowledge you should use flowfield for this boolean type field and use Exist function in CalcFormula property either you would have to add a field (type bool) in purchase line to update purc header.
  • garakgarak Member Posts: 3,263
    mhm, how do you use the "Search the Forum" function :-k maybe wrong search words :-#

    http://lmsmfy.com/?q=Update%20Mainform%20from%20Subform

    Follow the link and then take a look to the matches. I'm sure more then one has that what u need ;-)

    Regards
    Do you make it right, it works too!
  • NavkidNavkid Member Posts: 16
    vijay_g wrote:
    hi,
    as far as my knowledge you should use flowfield for this boolean type field and use Exist function in CalcFormula property either you would have to add a field (type bool) in purchase line to update purc header.

    To Vijay, thank for reply but however i still do not understand your explanation as i am still new to navision thus could you please explain in greater detail? thanks :D
    garak wrote:
    mhm, how do you use the "Search the Forum" function :-k maybe wrong search words :-#

    http://lmsmfy.com/?q=Update%20Mainform%20from%20Subform

    Follow the link and then take a look to the matches. I'm sure more then one has that what u need ;-)

    Regards

    To garak, thank for replying, i have followed ur link but i do not find the result that i want but thanks anyway :D
  • SavatageSavatage Member Posts: 7,142
    Navkid wrote:
    vijay_g wrote:
    hi,
    as far as my knowledge you should use flowfield for this boolean type field and use Exist function in CalcFormula property either you would have to add a field (type bool) in purchase line to update purc header.

    To Vijay, thank for reply but however i still do not understand your explanation as i am still new to navision thus could you please explain in greater detail? thanks :D

    He means add a field to the Header "Budget Line Exists" or whatever name you like type Boolean
    for the properties-> fieldclass = flowfield
    calcformula would be something like
    Exist("Purchase Line" WHERE (Document Type=FIELD(Document Type),Document No.=FIELD(No.),YourCheckBoxField=FILTER(Yes)))
  • NavkidNavkid Member Posts: 16
    Savatage wrote:
    Navkid wrote:
    vijay_g wrote:
    hi,
    as far as my knowledge you should use flowfield for this boolean type field and use Exist function in CalcFormula property either you would have to add a field (type bool) in purchase line to update purc header.

    To Vijay, thank for reply but however i still do not understand your explanation as i am still new to navision thus could you please explain in greater detail? thanks :D

    He means add a field to the Header "Budget Line Exists" or whatever name you like type Boolean
    for the properties-> fieldclass = flowfield
    calcformula would be something like
    Exist("Purchase Line" WHERE (Document Type=FIELD(Document Type),Document No.=FIELD(No.),YourCheckBoxField=FILTER(Yes)))

    Dear Savatage,

    Thank you for your reply. I had tried the method that you further had explained from Vijay however i still need to click on the purchase header in order to update the boolean field.

    Best Regard
    Navkid
  • SavatageSavatage Member Posts: 7,142
    did you follow garak's post & look thru the posts?
    garak wrote:
    mhm, how do you use the "Search the Forum" function :-k maybe wrong search words :-#
    http://lmsmfy.com/?q=Update%20Mainform%20from%20Subform
    Follow the link and then take a look to the matches. I'm sure more then one has that what u need ;-)
    Regards
  • matttraxmatttrax Member Posts: 2,309
    And also, what if you create one line that is budgeted and one line that is not. What are you expecting the header to say then?
  • NavkidNavkid Member Posts: 16
    matttrax wrote:
    And also, what if you create one line that is budgeted and one line that is not. What are you expecting the header to say then?
    Savatage wrote:
    did you follow garak's post & look thru the posts?

    Dear Mattrax,

    i have added in validation to ensure that is the first line is budgeted then the rest of the purchase lines must be budgeted else system will prompt error and vice versa.



    garak wrote:
    mhm, how do you use the "Search the Forum" function :-k maybe wrong search words :-#
    http://lmsmfy.com/?q=Update%20Mainform%20from%20Subform
    Follow the link and then take a look to the matches. I'm sure more then one has that what u need ;-)
    Regards

    Dear Savatage,

    I have followed garak's post and look thru the posts,however most of the methods were suggesting about using time interval property and add "Currform.update" which will degrade the system performances. I have also tried out garak method on using Automation XML but it will not updated the option field in the purchase header.
Sign In or Register to comment.