how to customize export data(listview) SuiteCRM - suitecrm

I am able to customize if i write create_export_query() in main modules(modules/Leads/lead.php)
but I want this should be upgrade safe code,
can we add create_export_query() method in custom path instead of in lead.php
if so in which file we can add this function other than main module location?
custom/modules/Leads/lead.php will work?
thanks
Naren

custom/modules/Leads/lead.php will not work until you change beanFile location into main bean.
There are 2 ways to do this.
1) Make an extension, custom/Extension/application/Ext/Include, make
a new file CustomLeads.php, put your custom BeanFile location here
for lead module.
2) As export is certainly an action,you may create a custom
controller,ie custom/modules/Leads/controller.php, create a new
function action_export, put your custom code there.
Overriding bean of Suite core module is not recommeneded as it may crack whole system at any point. You should go with #2.

Related

Liferay 7.1 npm-react-module localization

I'm trying to include localization into my npm-react-module, but I have failed receiving the value for the corresponding key from the Langugage.properties file. It simply returns the key. I did some research but I couldn't find any source that would help me solve my problem.
In the code which I will show you bellow, I have included a Language.properties file into my module. In my portlet, I have included the needed configuration for the language properties. I have also tried to add a separate file for a specific locale, but that didn't help me either.
This is an example of my portlet configuration:
"javax.portlet.resource-bundle=content.Language"
This is an example content from my Language.properties file:
example-key=example-value
This is how I'm trying to access the value in my React Component:
<h1> {Liferay.Language.get('example-key')} </h1>
But it only returns "example-key" instead of "example-value".
In my view.jsp file I am able to retrieve the corresponding values using
<liferay-ui:message key='example-key'/>
I have tried this method: https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/localizing-your-portlet but it didn't work either. Did anyone get this to work properly in their npm-react-module? I really don't want to spend time implementing my own localization service. Thanks!
Liferay.Language.get('key') gets text replaced by the build mechanism. Therefore there is no actual object/class to do this. I have been trying to get this to work myself and have resolved that I will have to do internationalization on my own.
localizing is done only in build time meaning if you have a language
key that generated dynamicly , you can't localizate it or for example
if you get a key from api fetch and need to localizate it, you can't
beacuse Liferay localization method for react (
Liferay.Language.get("yourLanguageKey") ) its undefined in runtime and
you can't use it.
from: https://npm.io/package/liferay-react-runtime-localization

ODI 12C Smart import with actions using SDK

HI I'm able to smart import Projects in ODI using SDK. but i'm unable to use the predefined method which sets actions like merge, create copy, ignore, reuse, while importing the projects.
Please help me to implement the below method,
setMatchedFCODefaultImportAction(java.lang.String pFCOObjType, int pSmartImportAction)
by using below method i'm directly importing projects.
importObjectsFromXml (fnameAndPath, ExportKey, ExportWithoutCipherData);
I want to implement above mentioned actions, please help me.
thanks
Unfortunately you can not use setMatchedFCODefaultImportAction to specify the action for a specific object like a project as in your code :
smartImpServ.setMatchedFCODefaultImportAction("Dev_ODI_Project", 1);
It can only define the default action for a First Class Object i.e. for all the objects of a specific type. For instance you can set the default actions for any project as CREATE/COPY (equivalent to 1 as you used in your code):
smartImpServ.setMatchedFCODefaultImportAction(ISmartImportService.PROJECT_OBJECT_NAME, ISmartImportService.SMART_IMPORT_ACTION_CREATE_COPY);
The values you can use as the pFCOObjType parameters are all the Fields ending by _OBJECT_NAME in the ISmartImportService interface.
If you want to specify the action for a specific object, you would need to use a response file from a previous import with the importFromXml method.

Pass parameters to #Cucumber.Options dynamically

I am using cucmber+selenium. Is there a way i can pass options to #Cucumber.Options dynamically. Something like-
features="src/YahooSearch.feature" // i want to take this feature file names from excel & put here...
One way of setting it is through the System.setProperties() method.
Say, if my resources/features folder has all the necessary features, I can simply instruct Cucumber to scan for all the features in the folder like,
String features = "/src/main/resources/features";
System.setProperty("cucumber.options", features);
Also, you can instantiate your RuntimeOptions dynamically like
new RuntimeOptions(features);
You could code something simple by passing command line parameters and retrieving them using ENV['xxx'].
Please see this post
Instead of using Junit, use TestNG to invoke feature files. The flow goes like, Read from Excel and with the data generate testng XML suite dynamically to invoke each feature file. Please find the reference below,
https://github.com/sahajamit/cucumber-jvm-testng-integration

Close method not working in Office

Im trying to use Microsoft.Office.Interop.Word._Document.Close() in a .net 3.5 windows form app.
No matter how much I search here and on Google I cannot find the correct parameters to put in the Close method.
I am using version 14.0.0.0 of Microsoft.Office.Interop.Word and I would like to close the document without saving and ideally ensure that the application can isolate the document thread so that users can still open word documents outside the running application.
See the Close method of the Document class described in MSDN. If you need to omit the parameter and use the default value - pass the Type.Missing parameter.
Try this:
object doNotSaveChanges = Word.WdSaveOptions.wdDoNotSaveChanges;
object missing = System.Reflection.Missing.Value;
_Document.Close(ref doNotSaveChanges, ref missing, ref missing);
This is the source
I'm not sure if you'll need the middle line or not. It's not from the original source it's from here

CakePHP - Include class from a directory outside the app directory

I am trying to include a miscellaneous library class from outside my app (it gets used by different apps).
My app is located at:
/var/www/websites/my_website/app/
And the class is located at:
/var/www/websites/libs/CakePHP/MyClass.php
In my bootstrap I'm struggling to figure out how to add the path for loading the classes from that directory:
App::build(array('Lib' => array('/var/www/websites/lib/')));
App::uses('MyClass', 'CakePHP');
$myClass = new MyClass();
Loading shouldn't be done in your bootstrap, but in your AppController's beforeFilter method instead.
Also, there is a reserved place for non-Cake libraries, being the app/Vendor directory. You can place all your classes in there and then load team easily with:
App::uses('MyClass', 'Vendor');
If it really needs to be in an alternative path, you need to specify and call the full path instead. And make sure to use the same names. Right now, you're specifying Lib, yet calling CakePHP as if that was a build by itself (which it's not). This won't work. It should look like this instead:
App::build(array('Lib' => array('/var/www/websites/lib')));
App::uses('MyClass', 'Lib/CakePHP'); // Define the subdirectory here
Also check the documentation on loading vendor files, it has quite some examples.

Resources