A mortgagee or the assignee or transferee of a debt secured by mortgage, or trustee or his assignee or transferee or cestui que trust of a deed of trust to secure a debt, who has received partial payment, if the mortgage or deed of trust is of record, must, upon request in writing to enter the date and amount of such partial payment by the mortgagor, or by a judgment creditor, or other creditor of the mortgagor having a lien or claim on the property mortgaged, or by a purchaser from the mortgagor, or upon the written request of the debtor in a deed of trust, enter on the margin of the record of the mortgage or deed of trust the date and amount of such partial payment or payments; a mortgagee or the assignee or transferee of a debt secured by mortgage, or trustee or his assignee or transferee or cestui que trust of a deed of trust to secure a debt, if the mortgage or deed of trust is of record, must, upon request in writing, of any judgment creditor or other creditor of the mortgagor having a lien or claim on the property mortgaged, or by a purchaser from the mortgagor, or upon the written request of the debtor or mortgagor, enter on the margin of record of the mortgage or deed of trust a statement of the total unpaid amount secured by said mortgage or deed of trust.