Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 446,798
» Latest member: percantqhr
» Forum threads: 1,744
» Forum posts: 9,036

Full Statistics

Online Users
There are currently 613 online users.
» 7 Member(s) | 606 Guest(s)
Judithe

Latest Threads
#1(Shark-Tank) Derm La Fl...
Forum: User Support
Last Post: Judithe
Less than 1 minute ago
» Replies: 0
» Views: 1
Кракен - Ссылка на сайт в...
Forum: Modules/Extension Support
Last Post: Davidnak
4 hours ago
» Replies: 0
» Views: 21
Кракен - Ссылка на сайт в...
Forum: Modules/Extension Support
Last Post: Davidnak
4 hours ago
» Replies: 0
» Views: 20
little bug trasformin LEA...
Forum: Administrator Support
Last Post: payalbatra
04-23-2024, 06:57 AM
» Replies: 4
» Views: 3,552
como manejar github en un...
Forum: International
Last Post: ntermacabre
04-10-2024, 03:52 AM
» Replies: 2
» Views: 1,208
whatsapp
Forum: User Support
Last Post: Yash
04-03-2024, 09:26 AM
» Replies: 2
» Views: 6,062
[RESUELTO] - Tipo de impu...
Forum: Administrator Support
Last Post: joebordes
04-01-2024, 10:39 PM
» Replies: 12
» Views: 7,808
PRODUCTS IN ACCOUNTS BY O...
Forum: User Support
Last Post: joebordes
03-31-2024, 11:04 PM
» Replies: 1
» Views: 354
Attachment in e-mail not ...
Forum: User Support
Last Post: julikarole
03-13-2024, 05:59 AM
» Replies: 2
» Views: 1,140
Mail Manager - Options Se...
Forum: Administrator Support
Last Post: joebordes
03-06-2024, 11:52 PM
» Replies: 16
» Views: 18,245

 
  Finetuning the way you send in data to a webservice call
Posted by: Guido1982 - 07-27-2018, 10:44 AM - Forum: coreBOS Development - Replies (3)

How to specify the format of you fields when sending in through webservice
In the default behaviour, a webservice call to either revise or update will demand you to make sure all fields are sent to coreBOS in the form of your current user. This applies in particular to number and currency fields, but also to date fields.

Let’s say you use user ‘John’ to login to coreBOS through a webservice in a remote application (maybe some customer portal). John has his preferences stored in the user settings page for his user. He likes his thousands separator to be a dot, his decimals separator to be a comma and he wants only two decimals. So his currency fields and numbers would be formatted like:

1.234,56

In the database however, the number would be stored like this:

1234.560000 if it’s a currency field, or

1234.56 if it was for instance a percentage.

When you send a record, or part of a record to either the revise or update webservice methods, you would be expected to send in the data in the format of the user that sends the data in. So for John, he would have to send in ‘1.234,56’ on a currency field to end up with ‘1234.560000’ in the database. When logged in to coreBOS, coreBOS would take care of the correct formatting when John views or edits a record.

But what if John sends in the value in database-format? What if he would send in ‘1234.560000’ for his currency field? Well, coreBOS wouldn’t understand that and try to convert it to the database format anyway. Since John uses the dot as his thousands separator, coreBOS would remove that from the value first, since databases don’t know this concept. Then coreBOS would apply decimals, if there weren’t any to start with. CoreBOS would expect those to be indicated with a comma, since it knows it’s John that sends in the data.

Now John would end up with the number ‘1234560000.000000’ in the database. In the application, he would see ‘1.234.560.000,00’, which is not what he wanted.
So John has to make sure he sends in all currency and number fields in the format he specified in his user preferences.

But, since 26-07-2018, he could also do something else. He could add a special flag (or multiple) to his data, that tells coreBOS what to expect. Say John is updating a Potential with this data:

PHP Code:
$input_array =  array (
        
'amount' => '1234.56',
        
'probability' => '5.00',
        
'id' => '5x195784',
);

$moduleName 'Potentials';

$update $cbconn->doRevise($moduleName$input_array); 
Normally, this would go horribly wrong. But if he were to update the input array with some special fields, it wouldn’t:
PHP Code:
$input_array =  array (
        
'amount' => '1234.56',
        
'probability' => '5.00',
        
'id' => '5x195784',
        
'__cbws_skipcurdbconvamount' => 1,
        
'__cbws_skipcurdbconvprobability' => 1,
); 
If he were to add the two fields with the name-prefix ‘__cbws_skipcurdbconv’ followed by the fieldname that he wants to send in formatted as database-format, he would get the result he expected (1.234,56 and 5,00).

But, there’s more. He could also add a single, special flag called ‘__cbws_skipcurdbconvall’ (notice the ‘all’ at the end) to make sure coreBOS treats all his fields as database-formatted.

There is one drawback to using the ‘all’ special flag though, which is quite obvious: you really need to make sure to input all data in the database-format. This includes date fields. Basically, setting the ‘all’ flag forces you to format the record as if you were doing an INSERT or UPDATE query on the database.

What about inventory lines?
If you had tried the above examples on an inventory module, you would notice that would not work. This is because the inventorylines are not fields, and are not treated as such by coreBOS. To be able to send your inventorylines with currencies formatted in the database format, you need to add:

‘__cbws_skipcurdbconv_pdo’

to your record and set it to anything, like ‘1’ or ‘true’ .

This mechanism works completely separate from the ones mentioned before. If you want to send in your entire inventory record (for instance a salesorder including the inventorylines) in database-format, you would have to set both ‘__cbws_skipcurdbconv_pdo’ and ‘__cbws_skipcurdbconvall’ to your record.

A note: Do not mistake inventorylines with the InventoryDetails modules. InventoryDetails is a modern module that does treat all of its numbers as fields. Setting the ‘__cbws_skipcurdbconv_pdo’ flag there or on a salesorder (for instance) that does not use the ‘old’ inventorylines mechanism would not do anything.

Print this item

  Default filter
Posted by: rslemer - 07-26-2018, 02:21 PM - Forum: Administrator Support - No Replies

I wish setting a default filter for my users.

Today system exhibit filter "All" or in the better situation, if user has only one filter marked as Default.

Problem is, my default filter is setting in my admin user.

Better solution is setting a global variable, because in this way, I can standarized for a role or group.

Print this item

  How to carry an account to timecontrol from a projecttask
Posted by: Guido1982 - 07-24-2018, 09:02 AM - Forum: Administrator Support - No Replies

Lets say you use timecontrol to keep track of the time spent on projects. You create timecontrol records from the project tasks, but you also want to carry over the account on the project to the timecontrol record, even though the projecttask is not directly related to the account.

You'd need the following business map (adjust to fit you exact needs)

Code:
<map>
<originmodule>
<originid>49</originid>
<originname>ProjectTask</originname>
</originmodule>
<targetmodule>
<targetid>56</targetid> <!-- Make sure this is correct or remove al together -->
<targetname>Timecontrol</targetname>
</targetmodule>
<fields>
<field>
<fieldname>cf_722</fieldname> <!-- The field on timecontrol you want to fill -->
  <Orgfields>
     <Orgfield>
          <OrgfieldName>$(projectid : (Project) linktoaccountscontacts)</OrgfieldName>
          <OrgfieldID>EXPRESSION</OrgfieldID>
      </Orgfield>
</Orgfields>
</field>
</fields>
</map>

The magic is in the '$(projectid : (Project) linktoaccountscontacts)' part. It gets the 'projectid' field from the project task, searches in Projects, and returns the result from the field 'linktoaccountscontacts'. Be careful when you link a project to a contact and carry it over to a UI10 field that is only meant for accounts!

Print this item

  Error in scheduled reports cron
Posted by: Guido1982 - 07-24-2018, 08:12 AM - Forum: coreBOS Development - Replies (2)

My cron gives me the following result:

[ERROR]: ScheduleReports - cron task execution throwed exception.
DateTime::__construct(): Failed to parse time string (1970-01-01 25:43) at position 11 (2): Unexpected character

The time clearly seems off. Does anyone have any experience with this problem?

Print this item

  [ solved ] Error on tried import comments
Posted by: rslemer - 07-23-2018, 06:30 PM - Forum: Administrator Support - Replies (13)

When I tried impor comments, system shows error at created cbCalendar db

At log
2018-07-23T18:24:40+00:00 DEBUG index Prepared sql query parameters : [110665]
2018-07-23T18:24:40+00:00 DEBUG index Prepared sql query being executed : INSERT INTO vtiger_activity_reminder_popup (semodule, recordid, date_start, time_start, status) VALUES (?,?,?,?,0)
2018-07-23T18:24:40+00:00 DEBUG index Prepared sql query parameters : [Calendar,110665,????,]
2018-07-23T18:24:40+00:00 INFO  VT PearDatabase ->ADODB error  Query Failed:INSERT INTO vtiger_activity_reminder_popup (semodule, recordid, date_start, time_start, status) VALUES (?,?,?,?,0)::->[1048]Column 'time_start' cannot be null
2018-07-23T18:24:40+00:00 INFO  VT PearDatabase ->TRANS Rolled Back
2018-07-23T18:24:40+00:00 INFO  VT PearDatabase ->TRANS Completed
2018-07-23T18:24:40+00:00 INFO  VT PearDatabase ->TRANS saveentity ends

Print this item

  Will an 'update field' workflow task trigger workflows on the related record?
Posted by: Guido1982 - 07-23-2018, 01:53 PM - Forum: Administrator Support - Replies (10)

I think I've asked this before, but somewhere in a thread that I can't find anymore. So here's twice then:

If I create a workflow task that updates a field on a related module, will that update in turn trigger the workflow system on the record to which that related field belongs?

Print this item

  Calendar integration with Nextcloud
Posted by: partnerwerk - 07-23-2018, 09:55 AM - Forum: Open Discussions - Replies (5)

Are there any plans to add calendar integration with CalDAV calendars? I would be very happy if I could switch from GCal to Nextcloud where I control most of my calendars.

Print this item

  Do we have a 'maintenance mode'?
Posted by: Guido1982 - 07-20-2018, 08:38 AM - Forum: coreBOS Development - Replies (2)

I was wondering if we have something like a maintenance mode, that would disable users from being able to login (and logout already logged in users) and disable webservices, so we could do some maintenance without worrying about changes to the database being made.

Print this item

  ordenar listado por fecha más nuevo primero
Posted by: construmet4 - 07-20-2018, 08:27 AM - Forum: User Support - Replies (11)

Buenos días:

No sé si alguien me puede ayudar en la organización de la información

Me gustaría ordenar por la fecha de creación del más nuevo al más antiguo lo que se visualiza en el módulo cuando es seleccionado, por ejemplo en eventos, cuando accedo a ellos, me pone el primer resultado el más antiguo y el último resultado el más nuevo, y quiero invertir ese orde ¿Cómo podría hacerlo?

http://localhost/index.php?action=index&module=cbCalendar

Print this item

  Autocomplete: what about more UI types?
Posted by: Guido1982 - 07-19-2018, 09:42 AM - Forum: coreBOS Development - Replies (10)

I read we can only use autocomplete on UI types 10 and 2. That's fine for newer custom modules, but in most system modules like salesorders or invoice we have more 'exotic' types like 73 or 57. What is the reason we can't use autocomplete business maps on those?

Print this item