Can I grab and populate a screen made by a programmatically triggered button push? - acumatica

Am I able to grab a screen that is created by a programmatically triggered button push call and populate it with values?
My specific example is that I want to grab the new e-mail screen that is made when I execute this code:
CRCommunicationDraft graph = PXGraph.CreateInstance<CRCommunicationDraft>();
graph.AddNew.PressButton();
I want to grab the screen created after AddNew.PressButton() is executed. Is there any way to do this?

For this specific case, I think is answered here:
How can I open an editable, sendable e-mail screen with prepopoulated values?
For most cases you want to:
Override the Action Handler of the button. You can use OVERRIDE METHOD button of customization editor for that. In your case override the AddNew action event handler.
Create a new graph instance for your target screen, here it is CREmailActivityMaint.
Assign to or insert a record into the current DataView of that graph, in your case use CREmailActivityMaint.Message DataView.
Redirect to the screen, using PXRedirectHelper class.

Related

How to override the Process button in the Process order screen in Acumatica

How to override the Process button in the Process order screen in Acumatica
enter image description here
There may be a way to directly the "Process" function for a specific processing screen but I am unaware of it nor do I see anything obvious in the customizer to do so. You could try to override a method within the Sales Order graph that you know fires within this process and implement your custom logic there. This way it would be hit by both the processing page and whatever action item you override within the order directly.

How to Override the Sales Order Quick Process Action Button in Acumatica

Is there a way to override the Quick Process Action Button in Acumatica.
Requirement:
After clicking on the OK Button, print pick list and the Shipment confirmation should be opened as a Combined in a single report instead of opening in the two separate tabs.
We could not able to locate the Quick Process action button.
Please help me to resolve this .
Quick Action button is made available, per order type. Review the Sales Order type screen.
Inside the standard graph SalesOrderEntry graph, you will find the method QuickProcess. It is available after you create the graph extension. Inside your extension, you may extend QuickProcess. Or override if you wish.

MonoTouch - how can I pass a value back to my controller from a custom UIActionSheet?

I have a UIViewController with a UITableView. I have implemented a UITableViewDelegate and overridden the RowSelected event to display a custom ActionSheet with UIPickerView i.e. if the user selects a row the ActionSheet displays a list of choices for that row.
What I'm looking to do is ... when the user dismisses the custom ActionSheet (by pressing a Done button), the ActionSheet is dismissed, and the value of the selected item is passed back to the UIViewController for display purposes.
I'm a little unsure as to the best way to handle this. I was hoping someone might have some pointers ?
I think you should subclass UIActionSheet and subscribe to Dismissed and set a property for the value the user selected. (You can also do other work like fill up the action sheet from within the subclass)
Your controller can then subscribe to Dismissed and read your new property.

Automatic show a dialog in ObjectListView, wxpython

I meet a problem in ObjectListView. When I choose some objects or use checkbox to choose them, the function on those objects will be called by pressing a button and utilizing GetCheckedObjects().
Is it possible for a dialog showed automatically when I choose or check an object like this?
If ObjectListView doesn't support that function, is there any other ways to realize it?
According to this previous SO question, the event that is triggered when a user clicks on a ObjectListView is the same as for a wx.ListCtrl, namely wx.EVT_LIST_ITEM_SELECTED.
So all you need to do is create your dialog (tutorials here and here) then bind a function to wx.EVT_LIST_ITEM_SELECTED that launches your dialog.

XPages remove documents on server and trigger partial refresh

I am struggling with the following.
On my XPage I have a viewpanel component, but it is not bound to a notesview datasource, but to a hashmap stored in viewScope. Reasons for this is beyond scope of my question.
Since the lines in my view are not actually linked to the documents I cannot use the standard checkboxes and the related getSelectedDocIds. I do however want a way to remove the selected documents. I have a column with checkboxes containing the unid of the corresponding row.
So long story short. I have an array of unids and want to perform an action that does the following:
Display a dijit.Dialog asking for confirmation
If OK clicked call a function that does the following:
Remove the documents based on the unids
Refresh the viewpanel
I am thinking of the following 2 solutions, but in doubt what would be best (maybe a third, even simpler solution?)
Have the OK button of the dojo dialog call a function that does an XmlHttpRequest to an XAgent or plain old LS agent
Have the OK button trigger an eventhandler that runs on the server as described by JeremyHodge here. But how would I pass the unids as parameter and refresh the view afterwards?
Thanks!
Cant you just make use of the extension library dialog with the dialog button control. In this button control you can then
A third option would be to add a column to your datatable/view which contains checkboxes. On the onchange event of these boxes you add an eventhander which adds the value to a viewScope variable.
A button on the bottom (or top.) of the page you add the code you need to remove the selected items from the hashmap, delete the documents associate with the selected id's. this button can be a ordinary button with a partial refresh on the viewpanel. When you run into the bug that you cant use buttons in a dialog please use the extension library dialog control because this fixes that issue for you.
If the current user does not have the correct access level to delete documents you could use the sessionAsSigner global (assuming the signer of the design element has the correct access levels).
This way you dont need to go call an xAgent by xmlthttprequest and can stay with the default xpage methodology.
I hope this helps in some way
I would second #jjbsomhorst in the use of the extension library for the dialog box - if you use one at all. Usually users don't read dialog boxes. So the approach would be add the column with the checkboxes, but don't bother with an event handler, but bind them ALL with their value to ONE scopeVariable. On submission that variable will then hold an array with the selected UNID.
Then render a page that lists these documents and have a confirm button. While the new page affords a server round-trip the likelihood, that users actually pay attention is way higher. What you can do:
Have the normal page that renders the dialog with editable checkboxes and when the user clicks "Delete" you set something like viewScope.confirmDeleteMode=true; and use that as condition for the checkboxes and make them read-only AND set the class of the selected rows to "morituri" which in your CSS would have something like .morituri { color: white; background-color : red; font-weight: bold } and a new button "Confirm Delete" (and hide the Delete button).
This way you only have one page to deal with.
I went for option 2, which has the possibility to provide the partial refresh id. I passed the unids as a submitvalue like:
function doRemove(unids){
XSP.executeOnServer(ISP.UI.removeEventID, ISP.UI.removeRefreshID, {
params: {
'$$xspsubmitvalue': unids
},
onComplete : function() {
//alert('test')
}
});
}
The ISP.UI.removeEventID performs the following code:
var unids = context.getSubmittedValue();
removeDocuments(unids); //SSJS function performing the actual delete
viewScope.reload = 'reload' //triggers the hashmap to be rebuild based on new documentcollection

Resources