Acumatica. Error during updating the Customer's Credit Limit - api

Could you help me with the following question?
I try to update the Customer Credit Limit in Acumatica:
Request:
PUT https://{Base_URL}/Customer?$select=CreditVerificationRules&$filter=CustomerID%20eq%20'0e31e8a5-08e3-ea11-a828-000d3ab2c384'
{
"CreditVerificationRules": {
"CreditLimit": {
"value": 1234.0
}
}
}
But I receive the following error:
Response: {"message":"An error has occurred.","exceptionMessage":"Syntax error: character '%' is not valid at position 10 in 'CustomerID%20eq%20'0e31e8a5-08e3-ea11-a828-000d3ab2c384'

Try it without the html encoding. I.e. CustomerID eq '0e31e8a5-08e3-ea11-a828-000d3ab2c384' FYI, if this was an instance where you needed html encoding, then you should have encoded the ' symbol as well.

Related

How do I check in "rego" that aws arn contains both valid bucket name and object name? One way is regex match , but its not giving me valid result

I am running as below :
package play
import future.keywords.if
default hello := false
arn_list := input.message
hello if {
regex.match("aws:arn:s3:::.*/*", arn_list)
}
arn_list is {
"message": "arn:aws:s3:::my_corporate_bucket/ram"
}
I tried regex.match , Still I am not getting valid result.
https://play.openpolicyagent.org/p/XruONuENli

Karate Api : check if a phrase is available response object array

I've a response
{ errors: [
{
code: 123,
reason: "this is the cause for a random problem where the last part of this string is dynamically generated"
} ,
{
code: 234,
reason: "Some other error for another random reason"
}
...
...
}
Now when I validate this response
I use following
...
...
And match response.errors[*].reason contains "this is the cause"
This validation fails, because there is an equality check for complete String for every reason ,
I all I want is, to validate that inside the errors array, if there is any error object, which has a reason string type property, starting with this is the cause phrase.
I tried few wild cards but didn't work either, how to do it ?
For complex things like this, just switch to JS.
* def found = response.errors.find(x => x.reason.startsWith('this is the cause'))
* match found == { code: 123, reason: '#string' }
# you can also do
* if (found) karate.log('found')
Any questions :)

TypeError: Cannot read property 'replace' of undefined in the context of VueJS

I am filtering some of the characters from the string. I went across few questions which has a same problem ie error in the console, but could not find any good answers.
Here is my string:
response_out1|response_out2|response_out3
Here is the method that i have used:
<vs-select v-model="change">
<vs-select-item :key="index" v-bind="item" v-for="(item,index) in
userFriendly(out.changes)" />
</vs-select>
...
methods: {
userFriendly (str){
return str.replace(/_/g, ' ').split('|').map(value => ({text: value, value }))
}
Here is the output that i am getting in the vs-select:
response out1
response out2
response out3
The error that i am getting in my console:
Here i want to know why i am getting this error and i wanna know how to rectify it and the output that i am expecting is: Response Out1, here how to capitalize first character of each word in the same method.
you're using a method directly in the template which causes multiple calls whenever your data changes,
you can use computed property to avoid such a scenario, not sure about how you are accessing out.changes
this might help you to solve your error and capitalize your text,
capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
},
sentenceCase (sentence) {
return sentence.split(' ').map(s => this.capitalize(s)).join(' '));
},
userFriendly (str) {
if (!str) return;
return str.replace(/_/g, ' ').split('|').map(value => ({text: this.sentenceCase(value), value }))
},

warning use of undefined constant.. this will throw an error in future version of php

This should be enough for someone to correct my issue - I'm very much a newbie at this.
It's a short bit of code to strip spaces from the ends of strings submitted in forms.
The warning message is saying "Use of undefined constant mystriptag - assumed 'mystriptag' (this will throw an error..."
How should I change this?
function mystriptag($item)
{
$item = strip_tags($item);
}
array_walk($_POST, mystriptag);
function t_area($str){
$order = array("\r\n", "\n", "\r");
$replace = ', ';
$newstr = str_replace($order, $replace, $str);
return $newstr;
}
You must use single quote in order for PHP to understand your parameter mystriptag.
So the correct line would be :
array_walk($_POST, 'mystriptag');

Payload data manipulation

My payload looks something like this. I am not posting the entire request.
{
"Package": {
"#UniqueID": "Some383",
"Content": {
"Application": {
"#UniqueID": "SUB1536201342468",
"PersonApplicant": [
{
"#ApplicantType": "Whateever",
"#Citizenship": "IND",
I am able to set values to the payload
* set request $.Package.Content.Application.#UniqueID = someID
But, I am unable to get a value from the request for a second service call. Below is the code I use.
* set type= request $.Package.Content.Application.PersonApplicant.#ApplicantType
I get the below error, Please advice.
jdk.nashorn.internal.runtime.ParserException: <eval>:1:13 Expected ; but found $
lixiInitiate $.Package.Content.Application.PersonApplicant.#ApplicantType
Please read the docs and examples carefully: https://github.com/intuit/karate#karate-expressions
* set type = request.Package.Content.Application.PersonApplicant.#ApplicantType