<@U373C5U11> I'm not getting anything from adding ...
# suitescript
k
@jmacdonald I'm not getting anything from adding those logs.
j
What do you mean you're not getting anything from those logs, as in they are logging but just blank?
k
not logging
Copy code
if (context.request.parameters.hasOwnProperty('sl')) {
                    lod.debug({title: 'parameters', details: context.request.parameters});
                    if (<http://context.request.parameters.sl|context.request.parameters.sl> === 'application') {
                        log.debug({title: '<http://context.request.parameters.sl|context.request.parameters.sl>', details: <http://context.request.parameters.sl|context.request.parameters.sl>});
                        sendIwocaApplication(customerRecordID, customerRecordType);
                    }
                }
i'v added those.
j
Then your code isn't making it that far I would assume, you're going to need to add logging further up in the code to figure out how far it gets. I wonder if you've got a return statement somewhere that is stopping execution.
k
i'm not returning anything on the sendIwocaApplication function.
that is where the redirect is.
I wonder if it would just be easier to return something from the function and then do the redirect afterwards instead of being in the function.
j
I'd add a log at the top of the if method==post bit, just to make sure it actually gets in your post bit. Then I'd make sure that prior to if statement on like 403 of the file you sent had a log to check params.sl
I'd probably also add a log right after you save your custom record prior to the redirect. Something is stopping your code, either an error or it's not following the execution path you expect.
k
Just going to test now.
My params after clicking submit on the form do not include the sl property so that is why the function isnt running.
Still dont understand why it was working before though
j
you'll need to make a field named sl and set the param to that if you want it to show in the post bit of a suitlet
as the url changes and therefore the previous url params are no longer there
k
really? it doesnt pass the params.
j
as far as I've seen, you need to manually create hidden fields and set the default values on them.
The params in a post seem to always come from the form fields, not sure if you can make it add params on the url from submitting a suitlet
k
a bit confused as to why it was working before.
i am wondering if i can use the enquiry form string that is passed int he params.
Thanks for your help. As i am not doing anything in my post other than the one function i'll just take the IF statements out. Don;t know why i put them in their in the beginning.
j
No problem, hope that's sorted!