Can openUrl in a Function open a Stateless form?

Can openUrl in a Function open a Stateless form?

If yes, what is wrong with this function code? (The code sets the Invoice Number (as string) field for records whose current string is "0 (un-paid)". After that I want the Form named Add_Invoice to open as a popup.  It is not opening. Please help me figure out why not. Thank you.


  1. void SetPayCode()
  2. {
  3.     NewInvNum  =  InvoiceNumberList  [FilterAid == "Next"];
  4.     rec  =  Session  [InvoiceNumber == "0 (un-paid)"];
  5.     rec.InvoiceNumber = NewInvNum.Code;
  6.     openUrl("#Form:Add_Invoice", "Popup window", "height=500,width=400");
  7. }