How to set type currency from API?

Hi everyone,

I want to know how to set or update the type currency of a currency field, I mean, I have an external database and once per day I send all the new information from this database to sugarcrm through the API, but there are some prices that I want to put in MXN and I don't know how to do it.

Hope you can help me.

  • Hi Eduardo Martínez 

    Do you mean that the same Item's price may be expressed in different currencies or each Item's price is expressed in a specific currency?

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Hi André

    I mean each price has a specific currency, for example, field1 is in USD and field2 is in MXN but both fields are in the same record, so I want to set or update the type currency of the field when I send the information to sugarcrm.

    Regards

  • Thank you for clarifying the scenario  Eduardo Martínez .

    I'm afraid you have to rethink the architecture of the current solution once all currency fields in the same modue share the same currency id (the very same currency name/conversion rate) and SugarCRM force updating all currency fields according to the related currency id.

    I can imagine two possible solutions:

    1. Convert the MXN currency field into a regular float one, so it will not be get updated by any Currency's hook;
    2. Manage Price List in a separate module the way you can manage specific currencies for the same Product from the Catalog avoiding conflicts.

    We had implemented both solutions on some customers, each one according to specific business roles.

    Good luck!

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Thank you André, you gave me an idea to how wo do it, through the API to update an record I can send "currency_id" with the type currency I want to have, it change the currency of the whole record but works how I want.

    Best Regards