This topic contains 8 replies, has 0 voices, and was last updated by VerdeOS 7 years, 3 months ago.
-
AuthorPosts
-
VerdeOS- Contributions: 0
- Level 1
- ☆
In javascript setTimeout (); is used
But in NetSuite it sends the error; function not found.
What function can I use in NetSuite to generate the delay?
Thank you
This is a cached copy. Click here to see the original post. -
ironside- Contributions: 0
- Level 1
- ☆
There is no such behavior available in (server-side) SuiteScript.
VerdeOS replied on 05/15/2017, 10:19 AM: Hi IronsideI’m afraid you’re right
I call SuiteCloud and they told me that there is no API for a delay on NetSuite
-
Vesku1980- Contributions: 0
- Level 1
- ☆
I have used setTimeOut in my code.
setTimeout(function(){
yourcode here….
},10);
Vesku
VerdeOS replied on 05/15/2017, 10:21 AM: Hi VeskusetTimeout(function(){
yourcode here….
},10);
Did this work for you?
I try to use that function but it generates error
O.o???
-
Vesku1980- Contributions: 0
- Level 1
- ☆
Yes, it is in use, but in client side.
What is your script doing that you need a delay in it?
VerdeOS replied on 05/15/2017, 02:15 PM: I have a button on a CustomRec, this should create a check.The problem is this; The check form has a bank account for “default”, when a vendor is assigned automatically the bank account, subsidiary and currency are updated.
But to update it takes 3 seconds so I need to pause, something like this;
var recCheck = nlapiCreateRecord(‘check’); // create check
var montoCheck = (antiTotalOC/cantAnti);
var montoFixed = montoCheck.toFixed(2);
nlapiLogExecution(“DEBUG”, ” montoFixed: ” , montoFixed);
recCheck.setFieldValue(‘customform’,107);
recCheck.setFieldValue(‘entity’, prov); //set vendor value
nlapiLogExecution(“DEBUG”, ” prov: ” , prov);
//////////////////////////////////////////////////////////////////////////////////////////////Wait 3 seconds////////////////////////////////////////////////////////////////////////////////////////////////////////////
recCheck.setFieldValue(‘subsidiary’,sub); // set the rest of the values to the check
nlapiLogExecution(“DEBUG”, ” sub: ” , sub);
recCheck.setFieldValue(‘department’, depto);
nlapiLogExecution(“DEBUG”, ” depto: ” , depto);
recCheck.setFieldValue(‘class’, clase);
nlapiLogExecution(“DEBUG”, ” clase: ” , clase);
recCheck.setFieldValue(‘location’, ubic);
nlapiLogExecution(“DEBUG”, ” ubic: ” , ubic);
recCheck.setFieldValue(‘usertotal’, montoFixed);
nlapiLogExecution(“DEBUG”, ” montoFixed: ” , montoFixed);
recCheck.setFieldText(‘currency’, moneda);
recCheck.setFieldValue(‘account’, cuenta);
nlapiLogExecution(“DEBUG”, ” cuenta: ” , cuenta);
recCheck.setLineItemValue(‘item’,’item’, 1, artiLst);
recCheck.setLineItemValue(‘item’,’rate’, 1, montoFixed);
var dateCheck = recCheck.getFieldValue(‘trandate’);
var idCheck = nlapiSubmitRecord(recCheck,true); //submit the record
-
borncorp- Contributions: 0
- Level 1
- ☆
You could create a loop to emulate setTimeout, it’s not efficient but does work. See how I did it here: https://ursuscode.com/netsuite-tips/…r-side-script/
ironside replied on 05/15/2017, 08:14 PM: shame on developers for doing this, but shame on NetSuite if they actually allow it! -
erictgrubaugh- Contributions: 0
- Level 1
- ☆
Why do you need this delay? What happens without it?
Since the record is being created server-side, the record being created should be in Standard mode, so no sourcing should happen any way until you submit the entire record.
-
Vesku1980- Contributions: 0
- Level 1
- ☆
Why don’t you execute client side script from button that creates the record, there you can use wait function.
I had a similar case but with creating a new workorder.
-
ironside- Contributions: 0
- Level 1
- ☆
Originally posted by borncorp
View Post
Just saying… if Netsuite didn’t disallowed it, it means it was consensual.
That statement is a non sequitur
-
VerdeOS- Contributions: 0
- Level 1
- ☆
And solve the problem even if you do not use the delay,
I did not find the way to create it properly
thank you for your advices
-
AuthorPosts
You must be logged in to reply to this topic.