In 1.0 we can get workflow action script paramater by getSetting. How about 2.0? - suitescript2.0

As per title, i wish to get the workflow action script parameter in 2.0.
I tried ScriptContext.getSetting('Script',parameter_id) in 2.0 but it doesn't work.
Please help! thanks.

You can try with the below code snippet, it returns the value of a script parameter for the currently executing script.
var scriptObj = runtime.getCurrentScript();
log.debug("Script parameter of custscript1: " +
scriptObj.getParameter({name: 'custscript1'}));
Let me know the output.

Related

How to solve runing error in Groovy Script

I have tried to get the property value, where I have saved in the project-properties.
This is the code which I have tried out.log.info wasn't working fine ,but when I run the code separately(that means only first line..), It shows the valid answer in a popup.
def ProjectProp = testRunner.testCase.testSuite.project.getPropertyValue("Name")
log.info {"Project Property = "+ProjectProp}
I am new to SoapUI.I would be really grateful, If you will be able to help me out to find a solution for the error which i received as follows,
INFO:Script13$_run_closure1#1d32637
Your problem is unrelated to SoapUI. You obviously have difficulty with basic Groovy syntax. Seek some tutorial on Groovy.
Your specific case, should read:
def projectProp = testRunner.testCase.testSuite.project.getPropertyValue("Name")
log.info("Project Property = " + $projectProp)

How to send parameters to Stimulsoft Report in Asp.Net Core 2.0?

I use Asp.net Core 2.0 Web Application.
I have a simple stimulsoft report file.
my report has a parameter Called #ID.
If I Use the report without parameter, it's working well, But When I send parameter to report, it's not working and report loaded empty.
my Code is:
var _Report = new Stimulsoft.Report.StiReport();
_Report.Load(#"C:\temp\report.mrt"); // load report
((StiSqlDatabase)_Report.Dictionary.Databases["Connection"]).ConnectionString = "new connectionString "; // change connection
_Report.DataSources["DataSource1"].Parameters["#ID"].ParameterValue = 5171; // set parameter value
_Report.Render();
Note: I use Asp.net Core version 2.0.
this code is working in asp.net well.
please help me.
thanks.
Wow!!!
solved.
I should use from Value Instead ParameterValue.
Like below:
_Report.DataSources["DataSource1"].Parameters["#ID"].Value = 5171;

How to pass the background response value of the to another feature json in function value using Karate

I have got the response in the background to one of the request and passing to the function for polling purpose and need to run until specific condition met. In that function, I need to pass the values to the calling feature JSON file
while (true) {
var result = karate.call('extractProgress.feature') packageid; -- package id
is response of another request
I followed the similar way as mentioned but in that not passing any parameter.
https://github.com/intuit/karate/blob/933d3803987a736cc1a38893e7039c4b5e5132fc/karate-demo/src/test/java/demo/polling/polling.feature
But i am getting the below error
feature(com.intuit.karate.testng.KarateTestngTest):
java.lang.RuntimeException: javascript evaluation failed: packageid,
ReferenceError: "packageid" is not defined in at line number 1
Input for call inside js should be given as
karate.call("<featureFile>",yourInputVaraible);
refer this on doc
https://github.com/intuit/karate#the-karate-object
It sounds wrong to me, maybe you have a typo.
Also please read the docs carefully. Only JSON is supported as a call argument.
The best way for you to get support is to follow this process, else no one can help you with the limited info you seem to be providing in your questions.
https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Magento SOAP API: Error in retrieving catalogCategoryTree

Currently I'm using Magento 1.9.01 and PHP 5.3.28. In ASP .NET I'm trying to retrieve the catalog tree by using the SOAP API using the following code:
var magentoService = new MagentoService.Mage_Api_Model_Server_Wsi_HandlerPortTypeClient();
var sessionId = magentoService.login(userName, apiKey);
var categoryTree = magentoService.catalogCategoryTree(sessionId, "", "");
The errror I get is "Internal Error. Please see log for details."
And in the logs I can see the following:
Argument 1 passed to Mage_Catalog_Model_Category_Api::_nodeToArray() must be an instance of Varien_Data_Tree_Node, null given
From what I've read it can be a bug with PHP 5.4 or greater, but not the version I'm using... So if someone has any idea how to solve this, it will be greatly appreaciated.
Seems pretty straight forward, though the error thrown suggests a much bigger problem. First make sure that the variables are exactly as you specified in your Magento installation (pay attention to caps). Second you can't pass empty strings, instead try "Null".
Good luck

Mule ESB: How to call a flow inside Datamapper( script)

I have datamapper, ( source: pojo and target:CSV), I need to call the other flow ( or groovy) inside datamapper. I stuck in passing the parameter to the flow. For example, I don't want entire payload has to go to flow for validation. I need to pass only two values. I used
flowRef(String,Object)
output.Item = flowRef("sampletestFlow",input.Model);
It works fine for single payload. But i have to pass one more parameter ( called input.Policy). I know we have to use
flowRef(String,Object,Map).
But it don't know the format for two input parameter.
Could you please anyone help me on this.
I have handled the scenario by the below way. Have create java class and called the java via damapper script. Below is the code inside datamapper script to call the java code.
stringUtil = new com.test.util.StringUtil();
output.style = stringUtil.formatValue(input.RuleStyle);
Hope this helps.