Delchr Function

Hi everyone,

i want to export some fields to an Excel File from a purchase order in nav 2016.

one of this fields is Code:20 and it represents the Purchase order No. which it always starts with(example PO-2222).

i dont want to show this 'PO-' in the excel file.

i know that i can use Delchr or Copystr but i dont know how to integrate this function in my code to get my output.

EXPORT PO :

EnterCell(ExcelBuf,RowNo,24,PurchHeader."No.",FALSE,FALSE,FALSE,'','@');

Can someone help me please?

  • source Data : Purchase Header
    field Name : No.
  • You can use the copystr function to get the purchase order no. from position 4 viz example variable Pono := copystr(pono,4,10) and then use this variable on your export.
  • In reply to sbhatbng:

    "PONo.L" := COPYSTR(PurchHeader."No.",4,20);
    thank you for answering.
    I do not get my output, i am just a little familiar with nav programming but i want to solve this problem.
  • In reply to Amaytors:

    First make sure purchheader record is open in other words you can read the purchheader table, secondly the arguments for COPYSTR are variable, starting position, length), your syntax is correct. put a message for PONo.L and see what value its returning.
  • In reply to sbhatbng:

    hi it works.
    my initial code line.
    EnterCell(ExcelBuf,RowNo,24,COPYSTR(PurchHeader."No.",4,20),FALSE,FALSE,FALSE,'','@');
    thank you sbhatbng
Related