Dear experts,
I am using the nav 2016 version. My requirement is if purchase order is released through the approval process user can not modify the comments(both comments....line and header also). Please give me the suggestion, where I need to write the validation code.
*This post is locked for comments
That was my actual requirement. Now it is resolved. Thank you for your support. You guys are the best. Again thanks.
Hi MKY,
Similarly this can be done. There is a relation between Purchase Header(38) and Purchase Comment Line(43) on "No" field
here below Blockediting is a Boolean field
On the Trigger
OnAfterGetCurrRecord()
PurchaseHeader.RESET;
PurchaseHeader.SETRANGE("Document Type",Rec."Document Type");
PurchaseHeader.SETRANGE("No.",Rec."No.");
IF PurchaseHeader.FINDSET THEN BEGIN
IF PurchaseHeader.Status=PurchaseHeader.Status::Released THEN BEGIN
Blockediting:=FALSE;
MESSAGE('PO is Released, cant edit or rewrite new comments');
END
ELSE
Blockediting:=TRUE;
END;
Output:
Hi MKY,
You need to do the following steps
In table 43 i.e. Purch. Comment Line, you have to declare 'PurchaseOrderTable' as your global variable which is table 38 Purchase Header and write the following code in OnInsert(), OnModify(). OnDelete() trigger of the table:
Note: The status of the PO once approved changes to 'Released'.
Now after approving the PO, if you try to add, edit or delete the comments you will get following error:
You need to customize.
Hello experts,
Comments is saved in other table not in purchase document table. I know your provided idea in the given link.I have applied several places in navision. But in herem my requirement is if after releasing the PO if user is trying to edit the comments or remove the comments to click on comments button....system is flowing the auto message....PO is released, can't edit or rewrite the new comments..
Hi MKY,
You can refer my blog.
www.cloudfronts.com/make-editable-fields-un-editable-based-condition-nav
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156