Is it possible to call NotifyHost method in infopath forms buttons rule? - infopath2010

I need to call NotifyHost method in the button control which is in the infoptah form. Need to call this using a rule. Is this possible? If so please help !

Why does it have to be done using a rule? You could change the action of the button to "Rules and Custom Code" and access NotifyHost from there. You can also do whatever the button was previously doing (E.g. Submit, Rules, Validation, etc) in the code behind as well.

Solved the problem by creating a data connection to submit the data to the host and calling the data connection in the button rule for submission of data to host

Related

Openerp: How to disable a side menu(More) in form view while using ir.actions.server

I want to disable a menu from "More" options in form view while using action type "ir.actions.server".
How can i make it possible?
In case of action type "ir.actions.act_window" we can do it by multi = True. Is there any equivalent attribute or something exists for this?
Thanx in advance.
As siddharth jambukiya said, we can use a web module to do his. But there is an another method that can be done from python. If you look at the result of the function field_view_get of the model to which the server action belong, you an see that there is a key called "toolbar" in the fields_view_get result. This key contains all the details regarding the action in the "Print" and "More" dropdown in web client. So if you remove the server action from here, that server action wont be listed in the "More" dropdown.
You can remove any Menu from "More" using web client. you need to implement web module to remove option from More menu. i think no other alternative attribute exists in openerp.

Have to push button twice to get partial refresh to work

Background: Xpage with multiple data sources. Each row of tabbed table contains an edit panel bound to a different data source than the main page. Each page contains a table to enter new documents. These documents are children of the main document. There is a view control that shows the user created documents immediately. The button in the table saves the document in addition to adding some control fields. It does a partial refresh of the editPanel.
Recently I added validation to the fields in the entry table. I use a function, and prevent updating from anything but the button. I am using Tommy Valand's method from this blog post: http://dontpanic82.blogspot.com/2010/03/xpages-making-validation-behave.html. If I don't use Tommy's method, then the validators fire when switching tabs, and are useless.
All of this works sort of, but I am experiencing the following issues.
1) I have to push the button twice to get the partial refresh to fire. Not only that, but the validation messages to not fire until the button is pushed twice. The first part was still an issue prior to adding the validation.
2) The table values do not clear after the refresh does happen. This used to work prior to adding the validation. The only way to get the values to clear now, is to do a full refresh (F5).
I really just need partial refresh to behave like it should. Any help is greatly appreciated.
I am answering my own question because I think that I might have found out why the partial refresh was acting so flaky. Here is what I did that solved my issues: Each tab had an editPanel. If I make the edit panel do a partial refresh to itself then the buttons on that panel seems to behave as you would expect them to.
When I create a new core control panel, the default in No submission. I do not know whether this issue manifests itself only when using multiple data sources and/or tabbed tables. Hopefully this fix will be of use to someone down the road. It is worth a try if you are having issues with partial refresh working correctly.

Modifying sharepoint edit dialog

I have successfully created a feature in sharepoint that modifies the existing edit dialog and adds a custom button to it like this.
and I am aware that I can pass back data when the user clicks the custom button like this.
<CommandUIHandlers>
<CommandUIHandler Command="ActivateUser" CommandAction="/_layouts/MyFeature/MakeUserActive.aspx?ListID={ListId}&ItemID={ItemId}&ItemUrl={ItemUrl}&ListUrlDir={ListUrlDir}" />
</CommandUIHandlers>
As detailed here
I can now handle the list item and perform my required actions on it BUT given that this button has been added in the modify context (IE: Inside the sharepoint edit item dialog) what if you want to save changes to the data itself?
To me it seems like using your custom button would always mean losing any changes the user has made to the data. Is there a way around this?
Good question!
You actually already linked to the solution: Right now you are simply redirecting the user by using a URL as your CommandAction: CommandAction="/_layouts/MyFeature/MakeUserActive.aspx?ListID={ListId}&ItemID={ItemId}&ItemUrl={ItemUrl}&ListUrlDir={ListUrlDir}"
This if course redirects the user to another page without saving the current entry. What you want to do is use Javascript as linked in the MSDN article:
CommandAction="javascript:alert('here be dragons');"
You can either work the the SharePoint Javascript object model here and use something like SP.ListOperation.Selection.getSelectedItems(); or you could use complete custom code.
From your aspx page name I can see you want to "make a use active" (btw: wouldn't "ActivateUser.aspx" be nicer?). If this simply means setting a property in another list you could do that with the SharePoint OM, if it is some custom stuff you would need a webservice which you can call from JavaScript and "activate the user" like that. You can of course always access the current form and pass on the values the user entered. Or you could create a custom save button which does some stuff (activate user) before saving.
Lastly: You can also have postbacks in your custom button where you could do anything you'd like.

combobox onchange with partial update doesn't fire in new document mode

In my Custom Control I have SSJS for a combobox onchange event to update an element using partial update.
The event is not fired when I'm in new document mode but fires when in edit mode.
I've tried other combinations such as Full Update, other events but it seems like Partial update is not working when in New Document mode.
Am I missing something here?
Using examples from: xpageswiki.com
Please advice
/Mike
I'll need to see the block for your radio button from your page's XML source.
These types of issues are sometimes caused by a bad event handler. In particular, depending on how you use Eclipse, there may be more that one block due to bugs in DDE. If you find more than one block, remove all but one, and try again. When this happens to me, I normally remove all blocks, then use the DDE UI to manually add the code and settings back.
When having required fields on the form and they are not filled in the event will not fire due the JSF phase. Setting the Server option "Process data without validation" to True will prevent the JSF to validate and continue with the event.

NSButton, binding question

I am trying a cocoa application with core-data. The application contains an entity: UsefulUrl with attribute: url. The entered urls are displayed in table view.
I am able to insert, modify and delete the entered urls from table via cocoa bindings (NSArrayController).
Now,
I want to open the urls of selected
rows in browser, on click of a button, using cocoa bindings.
I think I can do it via button's bindings: Action Invocation - Argument/ Target, but I could not make it working.
Can anyone suggest me exactly how to do it or some useful url?
Thanks,
Miraaj
I was right... in the argument binding pane I binded the url of UsefulUrl and in target I binded the selector gotoUrl: in my controller class. In gotoUrl method I used NSWorkspace method to open the link in default browser and it is working as intended :)

Resources