The Page- methods are the activity steps that create, copy, clean and remove pages on the clipboard. Almost every activity that works with more than one page uses at least one of them, so it pays to know exactly what each one does and does not touch.
The methods
| Method | What it does |
|---|---|
| Page-New | Creates a page on the clipboard, top-level or embedded. A model can fill it with starting values |
| Page-Copy | Copies the contents of a source page to a new or existing destination page. The source is not changed |
| Page-Remove | Deletes one or more pages from the clipboard. The database is not affected |
| Page-Set-Messages | Adds a message to a page. A page with a message normally cannot be saved to the database |
| Page-Clear-Messages | Removes the messages from a page so it can be saved or validated again |
| Show-Page and Show-Property | Send the page or property to the browser for debugging. Use only while developing |
Page-New
Use it to make a working page. Give it a name and a class, and optionally a model or data transform that sets defaults. The new page lives only on the clipboard until you save it.
Page-Copy
Use it to duplicate data, for example to copy a customer page from a data page onto your case, or to keep a backup before you change something. If the destination already exists, the copied properties are added on top of it.
Page-Remove
Clean up temporary pages when you have finished with them. It only removes them from memory. A record saved in the database stays there.
A worked example
A bank activity needs to check a customer's address without changing the case.
- Page-New: create
TempCustomerof classBank-Data-Customer. - Page-Copy: copy
D_CustomerontoTempCustomer. - Property-Set on
TempCustomer: standardise the address. - Page-Set-Messages on the case if the address is invalid.
- Page-Remove: remove
TempCustomer.
Tips
- Always pair a Page-New or Page-Copy with a Page-Remove when the page is temporary, or the clipboard grows during long sessions.
- Do not leave Show-Page steps in production activities. They are meant for debugging.
- When you only need to change data, consider a data transform, which is easier to read than a chain of page steps.
Related: The step page, clearing messages in a data transform and the Activity label.
No comments:
Post a Comment