lib/zoho/crm/models/concerns/persistence.rb
# Generate a blob of XML to send to Zoho
Generate a blob of XML to send to Zoho
Generate a blob of XML to send to Zoho
def to_zoho_params
        builder = Nokogiri::XML::Builder.new do |xml|
          xml.send(self.class.zoho_entity_name.to_sym) {
            xml.row(no: "1") {
              changes.each do |param,change|
                param_name = param.match(/id$/i) ? param.upcase : param.to_s.humanize.titleize
                xml.send(:FL, {val: param_name}, send(param))
              end
              xml.send(:FL, {val: "Imported Via Api"}, true)
            }
          }
        end
        builder.doc.root.to_xml
      end
def to_zoho_params builder = Nokogiri :: XML :: Builder . new do | xml | xml . send ( self . class . zoho_entity_name . to_sym ) { xml . row ( no : "1" ) { changes . each do | param , change | param_name = param . match ( / id$ /i ) ? param . upcase : param . to_s . humanize . titleize xml . send ( :FL , { val : param_name } , send ( param ) ) end xml . send ( :FL , { val : "Imported Via Api" } , true ) } } end builder . doc . root . to_xml end
Generate a blob of XML to send to Zoho
Generate a blob of XML to send to Zoho
# only include changed params # if a parameter ends in 'id' or 'ID' we need to make it uppercase - this is how Zoho needs IDs for other associated entities (contacts => accounts for example)