Create new record on portal by script
We have two portals in Payment layout. One is PaymentDetail. The other is Invoice. Both are linked to Payment table. When user select Invoice Portal row, we need to create and copy it to PaymentDetail portal by script. How can we create portal row by script without leaving current layout? Currently, we jump to the other layout which is dedicated to PaymentDetail, and create a new record. From data point of view, it works. But, we cannot use Revert command which is associated with Payment Layout. Because, after create new record on PaymentDetail layout and exit, the record will be committed.