Report-Cust name

idontknow
idontknow Member Posts: 66
I have created a report with "Sales credit memo line" table.I need to print customer name on it.So i have written the code this way on OnAfterGetRecor().But the code is not working.What's wrong with this code?
IF Cust.GET(CreditmemoLine."Sell-to Customer No.") THEN BEGIN
   CustName:=Cust.Name;
   END;

Answers

  • Savatage
    Savatage Member Posts: 7,142
    try just using
    ("Sell-to Customer No.")
    instead of
    (CreditmemoLine."Sell-to Customer No.")
  • idontknow
    idontknow Member Posts: 66
    Savatage wrote:
    try just using
    ("Sell-to Customer No.")
    instead of
    (CreditmemoLine."Sell-to Customer No.")

    Thank you very much....But can you just tell me what is the real difference between both?
  • ssingla
    ssingla Member Posts: 2,973
    On After Get Record means you have defined "Sales credit memo line" as data item and your code says
    "CreditmemoLine"

    Either directly use the field (which is good) or "Sales credit memo line".field.
    "CreditmemoLine" seems to be a variable and it might not have been intialized.
    CA Sandeep Singla
    http://ssdynamics.co.in