Hi Term,
I have the following No. Series, No. = CA-0000001, IM-0000001, PR-0000001, TR-0000001 but I just need the first two string like CA, IM, PR,TR how can I achieve this.
Thanks.
Hi Term,
I have the following No. Series, No. = CA-0000001, IM-0000001, PR-0000001, TR-0000001 but I just need the first two string like CA, IM, PR,TR how can I achieve this.
Thanks.
What version of NAV do you have? Why do you only need the two characters? and Where do you only need the two characters?
The better question and explaination you do… the better and more correct answer you will get…
You have been around here for quite a while, and also asked a lot of questions, which is fine… But in many of the quesitons, the very first comment is What version do you have? So you should have figured out by now, that that kind of information is “mandatory” in order to get the best possible answer.
Microsoft Dynamics NAV 2018.
I has a page for PV.
I generated some fields from a Imprest page into PV page, In the PV page there is post button and at the end of my post code,
CODEUNIT.RUN(CODEUNIT::"Gen. Jnl.-Post",GenJnLine);
GLEntry.RESET;
GLEntry.SETRANGE(GLEntry."Document No.",PV."No.");
GLEntry.SETRANGE(GLEntry.Reversed,FALSE);
IF GLEntry.FINDFIRST THEN BEGIN
PV.Posted:=TRUE;
PV."Posted By":=USERID;
PV."Posted Date":=TODAY;
PV."Time Posted":=TIME;
PV.MODIFY;
// Journal Batch No / Document No. = CA-0000001,IM-0000001,PR-0000001,TR-0000001
//I wanted to validate and take the imprest to surrender
i wanted to validate Journal Batch No. or Document No. to check from it is the real PV or Imprest so that it will take the imprest to surrender page.
ImprestHeader.Type =ImprestHeader.Type::Surrender;
I need to set some condition
Before PV. MODIFY;
Hello,
Check this link.
https://docs.microsoft.com/en-us/dynamics-nav/copystr-function–code–text-
best regards,
Thomas Barbut
Thank you, have gotten it CA= COPYSTR(GenJnLine.“Document No.”,1,2) OR IM =COPYSTR(GenJnLine.“Document No.”,1,2) OR PR=COPYSTR(GenJnLine.“Document No.”,1,2) OR TR = COPYSTR(GenJnLine.“Document No.”,1,2) but real PV No. = PV-0000001.
What i want to achieve is that before PV. MODIFY; I wanted to a add check code that will be reading CA= COPYSTR(GenJnLine.“Document No.”,1,2) OR IM =COPYSTR(GenJnLine.“Document No.”,1,2) OR PR=COPYSTR(GenJnLine.“Document No.”,1,2) OR TR = COPYSTR(GenJnLine.“Document No.”,1,2) and assign ImprestHeader.Type =ImprestHeader.Type::Surrender;
Thanks