sugarcrm custom save function when task is created from subpanel - function

When a task is created from Case page (Activities subpanel), it always call action_save function defined in root/modules/Tasks/Task.php file where as I want it to call action_save function defined in root/custom/modules/Tasks/controller.php (or in a file which is upgrade-safe) file. When task is created/edited from Task main page then it calls for action_save function defined in controller.php file.
Thanks-

Related

How to repeatedly launch a task from another task in gulp 4

I recently upgraded to gulp 4 and I am trying to solve a long standing issue of with my export process.
In short I have 3 (or more) independent folders in my project. By independent I mean that they each have their own bundle.js and global.css file. I have setup a target variable in my gulpfile which is used to create all the paths gulp needs for that target.
In the current situation when I want to export my entire project I need to manually change the target variable in the gulpfile and then run the export task.
I need something that works like the following (as the other_folders array can change)
/*---------- Exports current target ----------*/
gulp.task('export', gulp.series(to_prod,'export_files', 'export_scripts_and_styles', 'export_fonts', 'export_core'));
/*---------- Exports all targets ----------*/
gulp.task('export_all', function(done){
var needs_exporting = other_folders.concat("website");
needs_exporting.forEach(function(export_this){
target = export_this;
set_paths();
// Here it needs to fire the generic export task
gulp.series('export');
});
done();
});
The problem is that I cannot seem to find a way to call a gulp task in the forEach loop. Is there a way to do this or do I need a workaround?
Calling gulp.series('export') doesn't immediately start the export task. It just returns a function that you have to call in order to start the export task.
However calling the returned function doesn't start the export task immediately either. The function is asynchronous. Only later is the export task actually started.
The easiest way to run an asynchronous function for each element of a collection in series is to use the eachSeries() function that's provided by the async package:
var async = require('async');
gulp.task('export_all', function(done){
var needs_exporting = other_folders.concat("website");
async.eachSeries(needs_exporting, function(export_this, cb) {
target = export_this;
set_paths();
gulp.series('export')(cb);
}, done);
});

How can External Assemblies deal with SSRS variables?

I want to create an External Assembly and reference it inside my SSRS reports, so that I avoid repeating functions like this on every report I create:
Public Function UserName()
Try
Return Report.User!UserID
Catch
Return "System"
End Try
End Function
However, "Report.User!ID" won't be available inside my external assembly.
I'm trying to implement item 7 from: http://www.ssw.com.au/Ssw/Standards/Rules/RulesToBetterSQLReportingServices.aspx#userExperience

Polymer.import calls callback even when path to .html file is invalid

I am using Polymer.import to import a web component dynamically. I am writing
Polymer.import(['path to .html file of web component'], function () {
console.log('web component loaded');
})
The callback gets called correctly when the path to the HTML file is valid (which is the expected behavior), but it also gets called when the path to the .html file is invalid. I think this is a bug. Shall I raise a bug report for this ?

ForEachloop SSIS

Task: Loop thru these excel files and insert data into SQL table but in the process i get an error and i don't know which it errored on.
My understanding is SSIS doesn't loop thru file in an random order but i get an error about CANNOT ACQUIRE CONNECTION FROM CONNECTIONMANAGER. Excel Source failed validation and returned error code.. I did set 64bitruntime to False. This happened on VS 2008/SQL Server 2008 R2 on Windows 7 OS. Initially i was able to run the whole process successfully on Windows XP- VS2008 /SQL Server 2008 R2.
Problem: How do i know which file system is going to iterate next if i have 70 odd files in a folder. The thing i get an error and i'm not sure which file SSIS is working on. However i do see files are executed and data is in SQL.
Let me know how to find which file SSIS is currently working or the next one it will work on.
You could add a Script Task and log the variable used in the foreach loop.
Add the variable as readonly variable in the script task editor and then add something like this in the main method (C#):
public void Main()
{
bool fireAgain = true;
Dts.Events.FireInformation(0, "Logging FELC variable", "File: " + Dts.Variables["User::FilePath"].Value.ToString(), string.Empty, 0, ref fireAgain);
Add a script task inside your ForEach container, immediately before you do the Excel processing. In the script task, add the variable you configured in your ForEach loop to hold the filename to the Read Only Variables. In the script itself, call the FireInformation event, which will add an informational message to the progress log in SSIS. In the FireInformation call, pass the value of your filename variable as the message argument.
This will let you see each file being processed, and which one it was processing when it failed.
FireInformation help: http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.idtscomponentevents.fireinformation.aspx

Variable scope between spreadsheet script and script library

I have a script that I use as a library loading it in the spreadsheets I need.
When I add it to a spreadsheet, I define an onEdit and onLoad function that are calling the library's corresponding methods.
I need my individual sheets that are using the library, to define a global variable that should be available to the library, that variable may not be set in a sheet's cell.
I tried setting
var previd = "myid";
at the beginning of the spreadsheet script but that doesn't seem to do the trick.
How may I solve that ?
The "global scope" is not shared between scripts, it is actually a "script scope".
All variables needed for your library functions must be passed as parameters to these functions. If you make many functions call with the same parameters you should consider wrapping them in an object. Like some Apps Script built-in functions have optArguments.
You may also have a setParameters function on your library to pass these variables once (per runtime) and have them available to next library calls. Something like this:
//on the library script
var clientParams = null;
function setParameters(parameters) { clientParams = parameters; }
function exampleFunc() { return clientParams.previd; }
//on your client script
library.setParameters({previd:'myid', otherParam:'example'});
//then you can call
library.exampleFunc();