How to disable editing and inline-editing for a single record in SuiteCRM/SugarCRM - sugarcrm

I'm wondering what the best way to disable editing and inline-editing for a single record in SuiteCRM/SugarCRM. I am familiar with how to remove the edit button from the dropdown menu when looking at a detail view record (although it still allows the inline-edit capability).
I am also familiar with $dependencies and making a specific field disabled under certain conditions. But I am looking for something that allows me to programatically type in an ID of a record within a specific module, and automatically no user would be able to edit that record (no access to edit view, and no inline-editing).
How would I go about introducing that feature?

For SugarCRM use following code:
$dictionary['module']['fields']['yourfield_c']['inlineedit']=false;
OR use dependencies
For SuiteCRM use following code:
$dictionary['module']['fields']['yourfield_c']['inline_edit']=false;

Related

Remove menu option for specific selected values?

Is there a way to remove the option to select a menu link for specific fields?
For example I have a dashboard that has details of each users action and a few of those users are actually an automated system. So the few that are part of the system do not need to be reviewed as those are always automatic.
I want to only allow this menu selection for actual users and not the few "accounts" that are part of an automated system.
The kind of menu link on selection I am talking about.
Is it possible to remove this menu link for only specific values in a column?
I don't think it's possible - am fascinated to know if someone comes in with a way to do it - so one option to consider is renaming to "Daily Details - ignore for Bot 1 & 2" so the users are aware they should do nothing.

Editing a custom object record in visualforce page

How can I achieve editing a custom object record by listing all the records and selecting a particular record in checkbox which will open popup window for editing purpose in visualforce ?
What have you tried already, do you have any code sample you're stuck with?
Be careful what you wish for, "all records" when it's tens of thousands of them will likely blow the page's viewstate. I mean solution might be as simple as making a page with <apex:enhancedList> in it...
Read up about StandardSetController.
It's old feature, it's battle-tested, there will be tons of examples how to use it like https://developer.secure.force.com/cookbook/recipe/editing-multiple-records-using-a-visualforce-list-controller or http://www.sfdcpoint.com/salesforce/pagination-using-standard-set-controller-salesforce/
Looks like you need something very simple that just displays list of links & these links will have JavaScript (window.open function?) that creates a popup with record id passed.

SYMFONY FORM - filter attribute form on top with submit button, that provides a table with other form used to edit each row details

I am looking for best practices on SYMFONY FORM handling to achieve the following standard page (surprisingly I haven't found anything similar existing yet on SO).
Here is a shema of what I want to achieve:
As you can see at the top there is a SYMFONY FORM to filter the results that should be displayed.
It displays a table and each tuple of the table should permit to open another SYMFONY FORM kind linked to the tuple.
I am in the process of learning SYMFONY FORM, so far, I can manage to create the top row FORM to set the filter that'll apply to the table display.
But I wonder if anyone has experience on the second part: Displaying the table that embed as well many forms of a similar kind -That seems a bit more complex. I read about TWIG.EXTENSION and FORM.COLLECTION, I'll investigate that. But if someone could save me to re-invent the wheel and lead me to some direct shortcut, I'd be really grateful.
No idea if it's the best practice, but one way to do it would be to create a new property for your entity being listed in this table, called $editionForm (without mapping it to the database) for example.
Then, either throught a custom loop or by listening to a doctrine (or any ORM you use) hydration event (or triggering such an event if you don't use any ORM), fill the property with the generated form, probably within a dedicated service.
Then, just use it in your template like this :
$entity->getEditionForm()->render()

SugarCRM fetching data from outside REST service to subpanel

I'm trying to create subpanel in Account detail view where list of elements is fetched from external REST service.
I know how to define subpanel, but have no idea how to fill it with data from external network source. Was trying to use get_subpanel_data but there I can only change SQL.
Any ideas how can I do this?
When I've done this in the the past, at least with Sugar 6, I opted distinctly not to try to create a true subpanel. The data being loaded is coming from an outside source and is loaded dynamically with the page, so why present it as if it's static data coming from Sugar? Instead, I created a custom Smarty template to use as the footer on the detail page. For such an example, you can check how it works on the Calls Edit View. I think it's the footerTpl parameter in the detailviewdefs.php or editviewdefs.php. I loaded the smarty template by creating a custom detail view for my module, so custom/modules/MyModule/views/view.detail.php - extend the base Detail View class and override the display to feed Smarty new params, then your Smarty template only needs to iterate through and present the data that your view defined.
To be super-hip and abide by MVC, you could even put your custom code into your bean (if it's a custom module) or into a custom controller method, then reference that from the view.detail.php, and still feed it from there to the Smarty template.
Alternatively, you could just load JavaScript into the Smarty template and use the JavaScript to call the third-party service, parse and present it, etc.
I realize this question is a little bit old now however it comes up fairly often so why not provide an answer with a couple possible solutions. I won't get into code but more just into the design theory of how it can work. If someone needs more specific code help then that is another question.
A couple ideas...
As you mentioned you can define a custom Function which will load in Data to the SubPanel from your own SQL Query. That is one method that I just recently got to finally put to use after knowing about it for a good year and a half.
When you go this route, you are restrained to using the Columns in the SubPanel. I assume it is using the actual Metadata files to determine which Field Columns a SubPanel can use so you pretty much need your custom data in a Database table to have the same column names as the fields defined in the SubPanel Metadata.
Obviously this works great in the right situation, however not always and that leads us into the 2nd method I know of.
The other way is pretty much what #Mattew-Poer mentioned in his answer. It means abandoning the SubPanel altogether and instead generating your own HTML. This is by far my favorite and prefered way of doing it and I have been some really custom modules due to this being possible in a custom module! I will show an example below.
(Click HERE to View full size image)
In the screenshot, you can see in this example that I have something looking Similar to a SubPanel however it is not and is much for flexible and easy to customize.
Example, to the far left column in my fake subpanel is image checkboxes. When clicked on, an AJAX request is made to change the Task row Status.
After that, the checkbox image is updated to indicate the new Status state, the Modified DateTime is updated, the Status column has color background SPANS and is also updated with the correct text and background color when the left side checkbox is clicked.
Doing any of this with the standard SubPanels is a complete nightmare and would be difficult to do some of the stuff that you are open to do when you build your own version of a SubPanel.
With that said, I have built an identical clone of the above screenshot using SugarCRM default SubPanels! It was a nightmare. I could easily update the content and HTML in some of the columns. I even had the AJAX click checkbox image to update and do all the other updates I mentioned above. It wasn't too hard and worked fairly good but it had some issues.
When you do inline edit, inline create record, or subpanel paging to load different set of record. You would then lose all the custom HTML formatting that was applied. The reason is, in the SubPanel you are limited to using the After UI load logic hook. So since the "Page" is loaded already, when an AJAX request is made to add/edit the subpanel content or load a new set of items with the paging links. It only loads the SubPanel content on those events and the whole Page content does not reload. Because the logic hook only fires off 1 time after the page loads, this newly loaded subpanel data doe not receive any of your custom HTML formatting.
In my case, this means that nice looking colored background Status spans are lost, the image checkboxes are lost, and some other functionality is lost.
Now to get super technical, I could have gone another 3rd route and instead made new Custom Field Types for each SubPanel filed that I needed to apply custom HTML to. This process is super hard in my experience and in some cases it really isn't the BEST solution.
Because of the reason explained, this is why my new modules use the Custom HTML route to generate my own version of a custom subpanel or whatever Data is needed in my Module pages! So far it is working better than I imagined and has opened doors for me to build custom SugarCRM modules that I previously didn't even realize would be possible to build due to some of the issues I mentioned above. Now I bypass them altogether and open the door to do pretty much anything!
I've got some really cool stuff for SugarCRM in the works right now. If anyone has any questions feel free to ask in a new question or for me personally in a comment here.

Stop form from open when no records

I have a data entry form that when it closes opens another form for further updating the just newly entered data. However, at times no further update is necessary. How can I suppress the 2nd form from opening when there is no need for further update? Presently the form opens even when there are no recordsets present. (need a similar Event like for the report "On No Data")
Have a bit field such as a checkbox with default set to true open second form. Uncheck it to avoid the system from opening the next form. You will need to handle this in your code and check if that check box is checked or not.
Of course we will need more details such as why you are currently opening this second form...in addition, cant you check if any changes were made and if they were then open that second form else dont? Also what lang ?
Without knowing more about what you're working on, I'd say you would have to modify the process that shuts down the first form to check if the second form is needed. In .NET, for example, you could add code to the OnClosing event for a WinForm to check. If it's needed, open it as normal, if not then don't.
Subject: Tool Kits. Tool Kits consist of 1 or more tools. If tools already exist, no need for 2nd form to pop up. If tools are new, I need to fill in one of the 3 fields in the drop down listing. I like the idea of adding code to the OnClosing event, but do not understand what you mean by WinForm.