This topic contains 2 replies, has 0 voices, and was last updated by eneusta1 7 years, 11 months ago.

  • Author
    Posts
  • #6133 Score: 0

    eneusta1
    • Contributions: 0
    • Level 1

    I am working on a button that exists on the case form.. The intent is to create an invoice from the case but a button press. I have the workflow elements working but the Workflow Action Script is giving an error

    I am not a script guy, by nature but this ‘seemed’ easy enough. Once it get this working in a basic element, I want to enhance it by auto-closing the case and inheriting a number of elements from the case into the invoice…. but I need to get the basics working:

    below is the simple version of the script.. what is this newb missing

    function CasecreatesInvoice()

    {

    var caserecord = nlapiGetRecordId();

    var casecustomer = nlapiGetFieldValue(‘company’);

    var newinv = nlapiCreateRecord(‘invoice’);

    newinv.setFieldValue(‘customform’, ‘116’);

    newinv.setFieldValue(‘department’, ‘2’);

    newinv.setFieldValue(‘entity’, ’20’);

    var invID = nlapiSubmitRecord(newinv);

    return invID;

    }

    on screen error is: nlapiResolveURL: type argument TRANSACTION is not a valid record or is not available in your account. Please see the documentation for a list of supported record types.
    This is a cached copy. Click here to see the original post.

  • #6134 Score: 0

    erictgrubaugh
    • Contributions: 0
    • Level 1

    Very strange. I don’t see a call to nlapiResolveURL anywhere in your code. Is this the entirety of your code? Are there other User Event scripts running on the Invoice record? You can check Customization > Scripting > Scripted Records to find out if any other scripts are running on the Invoice record.

  • #6135 Score: 0

    eneusta1
    • Contributions: 0
    • Level 1

    Yes, that was the entirety of the code (for now).

    Via Scripted Records, there are some SuiteSocial elements but nothing else except my workflow…. very strange indeed.

    SuiteSocial Auto Post
    1.0
    Released

    autoPost

    SuiteSocial Tab
    1.0
    Released
    newsfeedTab

You must be logged in to reply to this topic.