This topic contains 7 replies, has 0 voices, and was last updated by saenzmariano 7 years, 6 months ago.
-
AuthorPosts
-
May 5, 2017 at 9:55 am #5772
VerdeOSIn 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. -
May 5, 2017 at 10:36 am #5773
zackb22Try window.setTimeout(FunctionName(), 10)
VerdeOS replied on 05/05/2017, 01:40 PM: Hi Zack
I already deal with that function and it gives me the error mentioned (function not found)
Already use;
* window.setTimeout(funcion(), 5000)
*setTimeout(funcion(), 5000)
* nlobj.setTimeout(funcion(), 5000)
-
May 5, 2017 at 11:10 am #5774
Olivier Gagnon NCWhy do you want a delay, where does this come in?
VerdeOS replied on 05/05/2017, 01:51 PM: Hi oliver
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
-
May 9, 2017 at 2:14 am #5775
GauravAgrawalYou can get the start time for the script and run the logic for code in a FOR loop after 3 sec. So, you might have to do something like this :
var start = new Date().getTime(); for (var i = 0; i milliseconds){ break; }
VerdeOS replied on 05/10/2017, 10:06 AM: Okay, I’ll try to use it.
Thank you
-
May 12, 2017 at 12:46 pm #5776
zackb22Do you have 2 functions then? One for the bit above the delay and one for the bit after it?
>I already deal with that function and it gives me the error mentioned (function not found)
“Try window.setTimeout(FunctionName(), 10)”. Are you putting your function name for the second half under the delay in for “FunctionName”?
VerdeOS replied on 05/15/2017, 10:03 AM: Hi Zack
If I put the name of the function in “functionName” but I am afraid that there is no such API for NetSuite.
Call NetSuite to the SuiteCloud area, I was told that in NetSuite there is no API to create a delay
-
May 13, 2017 at 6:58 pm #5777
Chuan ZhuoHi VerdeOS,
Before go to wait 3 second approach.
Did you try CreateRecord in dynamic mode, in SS1.0, use the initializeValues parameter for entity.nlapiCreateRecord(type, initializeValues)
VerdeOS replied on 05/15/2017, 10:13 AM: Hi Chuan
It’s a good idea, I do not even try with initializeValues for the provider, I’ll try it at the moment.
Thank you
-
May 15, 2017 at 1:01 am #5778
teddycaguioaIs the delay due to sourcing? If yes, when calling nlapiSetFieldValue(), set the synchronous parameter to true
VerdeOS replied on 05/15/2017, 10:14 AM: Hi Teddy,
I do not understand the synchronous parameter well but I will look for information about it and see how it works
Thank you
-
May 16, 2017 at 11:38 am #5779
saenzmarianoThis needs to be moved to the SuiteScript forum.
VerdeOS replied on 05/19/2017, 08:30 AM: 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.