The best way to learn the datamodel for Capitex Företagslån is to start by learning to use the GUI and fill in a credit case there.

When you master the GUI you can use different features to explore the data in the case.

Using javascript api in the webbrowser console.

  • Access the case input data using CpxcompanycalcAPI().HaemtaIndata()

  • Access the current company calculated data using CpxcompanycalcAPI().HaemtaUtdata()

  • Access the calculated data for the whole case using CpxcompanycalcAPI().getFullOutput()

  • Transfer a credit case from JSON into the GUI using CpxcompanycalcAPI().TilldelaIndata()

If you want to get the complete JSON as a string for a case you write following in the console:

JSON.stringify(CpxcompanycalcAPI().HaemtaIndata())

Using the debug printouts (need to be activated first in the configuration)

This feature creates test code that you can copy to your development environment to test around with.

If you wonder how the code looks to fill in "Månadsfördelning" for example, just fill in that section in the program and then use the printout, then you get a code example using what you just filled in.

You can also copy the SOAP XML directly as it is and paste it into soapUI to test a webservice call.

The output for the javascript you can run directly in the console window.

Some data is stripped from the example code in the printouts: 

  • Settings - So the example code you get will always use the built in settings if you do a javascript-call. If you do a webservice call you will get the "globally" stored settings. So normally you should not include the settings in a calculation call. If you do a call clientside in javascript you normally should fetch the "globally" stored settings from the server before you make a calculation call.

  • ImportedData - Data that is imported is hidden in the GUI but used in more complex case to compare what the user changed after import and similar things, this is not nessesary in more simple integration with Capitex Företagslån

  • DatasourceInformation - Keeps track from where the data comes and has mostly to do with imported data.

  • Credit PM - In the GUI you can edit the Credit PM, the datamodell for the PM is quite large and normally you just want the standard template unmodified when you integrate with Capitex Företagslån så this part is also removed. When you call for creation of a Credit PM without have the template in the case you will ge the default template that is configurated for your company and that is what you normally want.

  • Empty strings, null, false and whole objects that only contains empty strings, nulls and false is removed also. In some case this will lead to incomplete examples that is not possible to "load" back into the userinterface, but that only happens in really "small" cases where you for example haven't filled in any historical figures at all. So the printouts can return data that is not the smallest possible data for a case if it should be able to load into the user interface, normally the calculation engine handles that kind of incomplete cases rather good but not always the GUI that have a bit more hardcoded approch to what data that is expected to exist in the case.