Bitrix - Can I change $arResult array from a file where it is created - bitrix

I am working on some changes in CRM > Deal section. I want to make some changes in $arresult[] array for some form validation. It takes a ready made input tag in field array. But I want to know in which file this variable $arresult[] is created?
Any help will be appreciated.

$arResult is created in the corresponding component. In your case it would be crm.deal.edit or crm.deal.list. These system components are located in /bitrix/components/bitrix/.
You should not modify "core" components anyway. If you want to somehow modify $arResult either create your own component (copy to /bitrix/components/YOUR_NAMESPACE/ or use result_modifier.php in the component's template.

Related

Dynamic list element in MvxDialogViewController

We have a dialog inheriting MvxDialogViewController containing two Sections - TheRadios and TheList.
In response to the user changing the radio within TheRadios, we repopulate TheList (in the view model).
How can we bind a Section of a MvxDialogViewController to a dynamic list?
Looking through all the mvvmcross samples I couldn't find an example of this being done. I considered inserting a MvxActionBasedTableViewSource into the relevant Section's TableView but the property is null.
If you do want to bind a list within a Dialog section to a list, then I believe this extension may help you - https://github.com/asednev/MvvmCross.AlexeysExtensions
I'm afraid it is for vNext rather than v3 currently, but I think it should port very easily - I think the only changes needed would be just a few namespace changes (if you do port it, then please send them a pull request with the changes)
Alternatively
it is open source, so it may give you alternative ideas
you could consider using a custom or manual binding to INotifyPropertyChanged in order to achieve the table changes you are looking to achieve

How do I manage Attachments (View / Delete)

I am able to add a file upload control to my page and add attachments. But how do I manage them? View , delete?
I added a computed field to my xpage and make the attachments field the source and set the field as HTML. I get a bunch of entries like (See attached file: abc.pdf). But that does not seem to do what I want.
Is there an easy way to manage these attached files?
Bind a file download control to the same data the upload control is bound to. One of the attributes this component supports is a boolean for whether to allow deletion. You can also choose which attributes of each file it displays (MIME type, size, etc.).
What is wrong with having an repeat control repeat over the filenames and generate links directly to those files where on the links there are event handlers which do a remove or view ?

Is there Java/SSJS equivalent of #AttachmentModifiedTimes?

I want to show list of attachments and FileDownload control is not an option (need custom actions for every file).
To get name and size of attachments there are properties of EmbeddedObject. AFAIK, to get modified time of attachment there is only one option: to use pure #Formula, either via session.evaluate or view containing column with #AttachmentModifiedTimes.
Is there a way (Java/SSJS) to get attachment's modified (and created) time without native #Formulas? That means date stored with file shown in document properties for $FILE item.
You can add a Repeat Control to the page and bind that to the attachments (stored in a rich text field) using document1.getAttachmentList("rt_field_name"). Every item in that list is an object of class
com.ibm.xsp.model.domino.wrapped.DominoDocument$AttachmentValueHolder
That class has a getLastModified() method that returns the last modified time as a Double.
A couldn't find a reference on the web showing the full API, but if you use the API Inspector in the XPage Debug Toolbar (sorry for the shameless plug...) you can view all properties and methods using:
getComponent( 'id_of_repeat_control' ).getDataModel().getRowData()
UPDATE
Found the API here,
I am not 100% sure what you want to achieve.
In general you can use #AttachmentModifiedTimes() - as well as #AttachmentNames() - as SSJS.

Drupal: How to add a form and perform functionality on it

I am new to Drupal and trying to get hand on it.
I am not able to find how to have the following functionality on my site. If anyone can help me out, it would be great for me.
I need to have a form that will take 2 fields one of which is supposed to be the login id(how to retrive login id?). I need to store this and display in tabular form also on a new page. Lastly I want to provide an edit form for this functionality using the same form but its use will be like whenever a person adds value in this form, it checks in Table1, if entry is not present it adds in table, else it updates the table.
Apart from this I need to store all the updations in a seperate table or something like that, so that I am able to see the history of all the changes
Eg:
ADD Form:
Fields:
- LoginID
- Phone number
Show Table Page(Tabular with the stored information)
Edit Form(same as above form):
Fields:
- LoginID
- Phone number
Now If I add my phone number to this it will get stored. Later when I try to modify my number it should update in initial table but also store the history of old and new entry in a separate table so that I can perform varies options on it.
I also dont know how to add/enable form fields in drupal. :(
Thanks
I'm not entirely sure what you're asking, but I think the Computed Field module might be helpful. The module allows you to define custom hooks that run when a node is saved.
If you're not creating nodes and are using something like the Webform module, you should be able to write a module to process the data.

Custom list form using sharepoint object model VS 2008

Is there a way to handle the DropDownSelectedIndexChanged for list item new form.
Let say I have a custom list named Temp having Title, Products (which is a DropDownList) and Color Shade (which is a TextBox).
When I create a list item I want to select a product from DropDownList and on the selected index changed I want to write the
business logic such as fetching the row from Color Shade list and bind the data to TextBox of Color Shade. Now I can say ok so that
a list item will be created. Is it possible using VS 2008 sharepoint object model.
you could add a custom control to your masterpage which resursively traverses your control tree (start from this.Page) to find your dropdown and attaches the event handler (which itself is defined in your custom control). Also set the AutoPostBack property to true on the dropdown once you found it.
In terms of getting a reference do your textbox within your eventhandler, you could also apply the same approach of traversing the control tree.
note, you need to ensure that event handler is attached before eventhandlers are run.
Jaap
I am not sure if I understand what you mean.
An alternative approach, and probably less work, would be to use javascript (I would recommend using the jQuery library) to automatically populate your textbox when the selection of the dropdown changes. Everything would be done clientside.
Jaap
There are some third party components that do this sort of thing as custom column types, but if you're developing from scratch you'll probably find it a lot easier doing a custom form. If you do a fully custom version of newform.aspx, you'll still be using the standard new item menu.
If you try to modify the standard controls you'll run into issues like security errors if the submitted value wasn't in the original list.
If you don't want to write your own saving code, hiding the standard new form with css and modifying the values with javascript from your custom control can work quite well.

Resources