Sales Credit Memo/Purchase Credit Meno

Markandey_PandeyMarkandey_Pandey Member Posts: 178
Hi all,

I am using Sales Credit Memo and Purchase Credit Memo for cancelling Sales Invoices and purchase invoices respectively.

Here what is want is, the reason code that i am selecting on Sales Credit memo should get updated on Posted Sales Invoice when i am posting the Sales Credit memo.

Can anybody tell me the solution.
Markandey Pandey

Comments

  • SavatageSavatage Member Posts: 7,142
    You'll have to use code to do that.

    Hopefully what you are doing is applying the credit memo's to their Invoices.
    So if you have to in the future figure out how that invoice was closed you will be able to navigate to the applies entry and see that it was a credit memo and look at that credit memo to see the reason code.

    You can also enter info into the Invoices Notes/Comments about what is goin on with that invoice
  • Markandey_PandeyMarkandey_Pandey Member Posts: 178
    Any help on how to get the referenced Posted Invoice No.
    Markandey Pandey
  • chengalasettyvsraochengalasettyvsrao Member Posts: 711
    at the time of posting the creditmemo - > Just selct the field in the application tab.

    Applies - to Doc Type , Applies -to Doc No.

    when posted credit memo - > Invocing tab - > Applies - to Doc Type , Applies -to Doc No.
  • Markandey_PandeyMarkandey_Pandey Member Posts: 178
    at the time of posting the creditmemo - > Just selct the field in the application tab.

    Applies - to Doc Type , Applies -to Doc No.

    when posted credit memo - > Invocing tab - > Applies - to Doc Type , Applies -to Doc No.


    Thanx, i got it.
    Markandey Pandey
  • Markandey_PandeyMarkandey_Pandey Member Posts: 178
    Hi all,

    I have written the following code for updating the Reason Code of Posted Invoices on OnPush trigger of Post Button of Sales Credit memo but its not working:


    SalesInvHeader.RESET;
    SalesInvHeader.SETRANGE(SalesInvHeader."No.","Applies-to Doc. No.");
    IF(SalesInvHeader.FIND('-')) THEN
    SalesInvHeader."Reason Code":=SalesHeader."Reason Code";
    SalesInvHeader.MODIFY;

    can anybody suggest me the solution.
    Markandey Pandey
  • ssinglassingla Member Posts: 2,973
    Check whether the client license has the permission to Sales Invoice Header table.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • ssinglassingla Member Posts: 2,973
    Use GET Statement instead of setrange and find('-')
    CA Sandeep Singla
    http://ssdynamics.co.in
  • mkpjsrmkpjsr Member Posts: 587
    ssingla wrote:
    Use GET Statement instead of setrange and find('-')

    i have tried that also


    SalesInvHeader.GET("Applies-to Doc. No.");
    SalesInvHeader."Reason Code":=SalesHeader."Reason Code";
    SalesInvHeader.MODIFY;
  • SavatageSavatage Member Posts: 7,142
    you should change your code a bit for testing like this with an if statement "just in case" so the code doesn't crash

    if SalesInvHeader.GET("Applies-to Doc. No.") then begin
    SalesInvHeader."Reason Code":=SalesHeader."Reason Code";
    SalesInvHeader.MODIFY;
    end else begin
    message('doc not found');
    end;

    But as above, the first issue I see is that the Sales Invoice Header is usually not editable
    I have to add the editable field to CU391 in my version.
  • Markandey_PandeyMarkandey_Pandey Member Posts: 178
    Savatage wrote:
    you should change your code a bit for testing like this with an if statement "just in case" so the code doesn't crash

    if SalesInvHeader.GET("Applies-to Doc. No.") then begin
    SalesInvHeader."Reason Code":=SalesHeader."Reason Code";
    SalesInvHeader.MODIFY;
    end else begin
    message('doc not found');
    end;

    But as above, the first issue I see is that the Sales Invoice Header is usually not editable
    I have to add the editable field to CU391 in my version.

    Here SalesInvHeader is a variable of Record Type (Subtype- Sales Invoice Header)
    and all the fields of the table is editable.
    But Reason Code is not getting updated, i have tried your code also
    Markandey Pandey
  • idiotidiot Member Posts: 651
    This field has Tablerelation to Reason Code
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • ssinglassingla Member Posts: 2,973
    Run the debugger and check whether your code is getting executed or not?

    Where have you put your code and how it is getting fired?
    CA Sandeep Singla
    http://ssdynamics.co.in
Sign In or Register to comment.