How to update DocProperty fields with Word js - javascript

I'm developing an Office 2016 Addin using Word js 1.3. The addin allows to define custom properties and save their value.
I'd like to add a button in the UI of my Addin that updates all usages of DocProperty fields (see pic 1) in the document which use custom properties that the user added. Basically the button should update the fields (see pic 2).
I mean these things here:
I can't wrap the fields in ContentControls and then update those. The documents come pre-configured with some custom properties and their content must not be changed.

Related

Make Fiori header fields invisible

I want to hide the Fiori app header field (which is used in several apps) in one of the apps, but SAP has not provided any extension to hide these type of fields.
How can I make Fiori header fields invisible?
Runtime Adoption (RTA) of UI5 could be used to remove/hide/rename/etc. UI elements. If you start the application with a user who is a key user (has SAP_UI_FLEX_KEY_USER) then you can switch to adoption mode via the 'Adapt UI' button & do the adjustments via hovering over individual UI elements. The result can be published and transported from dev landscape.
More at: https://help.sap.com/doc/saphelp_nw751abap/7.51.0/en-US/5c/424437bf794f809087fdce391149f2/content.htm?no_cache=true
You can do the following:
create a new library which contains a control which extends the PersinfoControl of library hcm.lib.common. In this extention overwrite the init function of this control, first call super, then replace the header with a custom fragment(copy of the original without the button).
Extend the Family Data app an replace the main View. Replace the reference to library hcm.lib.common with your newly created library.

how to set Annotation (notes) on a form as required

I have a customized form of a customized entity, on my form I have crm annotation (notes), I need to set the notes part as required (according to a rule) how do I do that? when I clicked on the notes field I couldn't see the field name, Is it possible ?
The question reffers to dynamics crm annotation mechanism
We cannot achieve this straight forward, as we know Notes (annotation) is a separate entity which may have many records for a parent entity record. This is not a simple field in form, cannot be accessed in business rule. Instead of showing in subgrid, Platform giving different UI/UX for notes only like Timeline etc.
You can write script to validate/prompt user to create a child note on need basis. But not before creating a parent record itself.
This was already discussed in community, maybe you can have a custom mandatory multiline field to capture notes & rollup to annotation, can handle different scenarios/validations in code.

How to add custom field to dhtmlxScheduler?

I want to add multiple custom fields to the lightbox in dhtmlScheduler. I realize that this is a dup of a prior question but that answer is incomplete/incorrect.
My application correctly stores and recalls data from a MySQL database using dhtmlxDataProcessor on the client and dhtmlxConnector via PHP on the server side. I have carefully read, re-read, and parsed documentation on Custom "details" form. I've worked with the code in the 05_custom_editor.html sample.
The problem is that those examples do not work - they silently fail to store the second field, "Details", in the Description section. This is not surprising since nowhere is the field mapped to a database column.
What changes are needed so the "Details" field of the example form stored in the database and recalled with the event?
What changes are needed to support read-only data in the Details field that is populate based on the "Text" field? What I'm thinking of is a name that has an address associated with it.
How to invoke a custom windows with a form from the lightbox to populate the address?
I would prefer to be able to do this by extending the default lightbox, but that is not a requirement.
Any guidance is appreciated.
There are 3 required fields when using dhtmlScheduler. They are the first 3 in your PHP connector:
$scheduler->render_table("my_table","id","start_date,end_date,name,details,....
Your connector may use any column names as long as the order is preserved. But because it's required and used all over the place the dhtmlScheduler must refer to the name of the event. It is called "text".
The lightbox section maps description on to "text". I think that there is no
scheduler.locale.labels.section_description
for the same reason.
1) Update the PHP connector to pull in the required fields.
2) You can use sched.formSection('myfield') to get components from inside the lightbox, then you can add javascript to blur on focus.
3) Normal javascript
You can use one of the custom events alter any form items before you display the lightbox.
My dhtmlScheduler seems very vocal when it fails! What does the console say? Have you stepped through to see where it's failing?

Show specific page when opening Account window

Following on from my previous Dynamics CRM question (Show popup/alert if account has related entity records)
In the OnLoad event of the Account form, I want to set the window to open with a specific sub-navigation item loaded into the right-hand frame.
For example, by default, when you open the Account window, it loads the account details. Listed on the left are various related items. I have a custom related entity called Alert. If a specific criteria is met in my javascript, I want the Alert entity view to be loaded into the right-hand view instead of the Account details.
Is this possible?
Solved it by using Xrm.Page.ui.navigation.items.get("navItemName").setFocus();
I can suggest three approaches
Approach 1
1. add a tab>section>subgrid to show that associated view
2. use form.onload javascript to show/hide that tab depending on criteria
Approach 2 (probably unsupported)
1. use form.onload javascript to .click() the navigation link [you can take the associated entity name in webresource function parameters to make this a generic library]
Approach 3
Have you considered custom forms in CRM 2011?

Dynamically display Edit Control Block menu item in SharePoint

I am trying to set up dynamic per-item menus (Edit Control Block) in SharePoint 2007. My goal is to have certain features that are available based on the current user's group membership.
I know that the CustomAction tag that controls the creation of this menu item has a Rights attribute. The problem that I have with this is that the groups I am using have identical rights in the site (ViewListItems, ManageAlerts, etc). The groups that we have set up deal more with function, such as Manager, Employee, etc. We want to be able to assign a custom feature to a group, and have the menu items associated with that feature visible only to members of that group. Everyone has the same basic site permissions, but will have extra options availble based on their login credentials.
I have seen several articles on modifying the Core.js file to hide items in the context menu, but they are an all-or-nothing approach. There is an interesting post at http://blog.thekid.me.uk/archive/2008/04/29/sharepoint-custom-actions-in-a-list-view-webpart.aspx that shows how to dynamically modify the Actions menu. It is trivial to modify this example to check the users group and show or hide the menu based on membership. Unfortunately, this example does not seem to apply to context menu items as evidenced here http://forums.msdn.microsoft.com/en-US/sharepointdevelopment/thread/c2259839-24c4-4a7e-83e5-3925cdd17c44/.
Does anyone know of a way to do this without using javascript? If not, what is the best way to check the user's group from javascript?
There are two different Javascript functions that you can implement for dynamically adding menu items to list item drop downs. Core.js (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\CORE.JS) checks for the existence of these methods when generating the menu items for a selected list item. "Custom_AddDocLibMenuItems" and "Custom_AddListMenuItems" are the names of the Javascript methods.
One article that I think you can use to solve your specific problem, dynamic menu item customization based on user role membership, can be found here:
MSDN: Customizing the Context Menu of Document Library Items (note the process is exactly the same for any list type)
This article outlines how server side code can be executed to define the menu items that will be displayed:
[...] in more complex cases, you must retrieve the list of available commands from the server, because only there you can run your business logic and perhaps get the commands from a custom database. Typically, you want to do this if you are implementing a workflow solution where each document has its own process state, with commands associated to it.
The solution for this situation is to have the Custom_AddDocLibMenuItems dynamically call a custom ASP.NET page. This page takes the ID of the document library and the specific item on the query string, and returns an XML string containing all the information for the commands available for that particular document. These commands are available according to the document's process status (or some other custom business logic). [...]
Unfortunately this is not possible to accomplish without using javascript. The ECB doesn't render server controls defined as a custom action (unlike the SiteActions etc).
To learn how to accomplish this by using Javascript check out the following article:
http://www.helloitsliam.com/archive/2007/08/10/moss2007-%E2%80%93-item-level-menus-investigation.aspx

Categories