Community

How to add a new variant to document definition from a web page

Guys, I am struggling to add variants to the variants dataset using JScript on a web page

You know that there is no way to check or debug java scripts in PSS so it takes heck or a lot time to verify. So far I have made a form and buttons, but when I add the script below the form stops opening. What is wrong here?

                    //On 'ok' button click

                    $('#confirm').click(function ()

{                       

                    //Save and close iframe               

                                         IDataSet dataSet = Context.DataSet("%Section%/Variants");

                                         IDataSetRecord rec = dataSet.CreateRecord();

                                         rec.AddValue( "VariantName", $('#VariantName').val());

                                         rec.AddValue( "IBAN", $('#IBAN').val());

                                         rec.AddValue( "EuropeanVATID", $('#EuropeanVATID').val());

                                         rec.AddValue( "DomesticVATID", $('#DomesticVATID').val());

                                         rec.AddValue( "CompanyAddress", $('#CompanyAddress').val());

                                         rec.AddValue( "CompanyZip", $('#CompanyZip').val());

                                         rec.AddValue( "CompanyCity", $('#CompanyCity').val());

                                         dataSet.addRecord( rec );                         

                              save();

  }

0

Comments

3 comments

  • Avatar
    Collins Sarmento

    Is this for FlexiCapture for Invoices?

    0
  • Avatar
    Anatoly Chernenko

    No, its for regular Flexicapture

    0
  • Avatar
    Collins Sarmento

    Are you using the Classification based on a database of companies?

    If so you could possibly add a button to edit/add to your dataset of companies. Once you add a new one to the dataset and it is selected for that document type it should train to the new variant.

    0

Please sign in to leave a comment.