Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Questions on Business Maps
#1
Since I think this module is going to play a big role I'd like to get a good understanding. Let me just fire some questions from reading the docs:

Code:
<map>
<sql>
SELECT accountid,accountname
FROM vtiger_account
INNER JOIN vtiger_crmentity ce ON ce.crmid=vtiger_account.accountid
WHERE ce.deleted=0 AND vtiger_account.accountid =?
</sql>
<return>accountname</return>    {count|recordset}
</map>

OK, this is a query sure enough. You create it as an entity since I think Business Maps follows the basic entity GUI model. I write the code into the entity and then... What's the event it responds to? What's done with the return value? Can this be used in a workflow for instance?

Next one: the field mapping.

I see:

Code:
<originmodule>
    <originid>22</originid>  {optional}
    <originname>SalesOrder</originname>
  </originmodule>

This is obvious enough. But the origin id, this is the module's ID right? What's called tabid in the database?

Then this part from fieldmapping:
Code:
<field>
      <fieldname>subject</fieldname>   {destination field on invoice}
      <fieldID>999</fieldID>  {optional}
      <Orgfields>  {if more than one is present they will be concatenated with the delimiter}
        <Orgfield>
          <OrgfieldName>subject</OrgfieldName>
          <OrgfieldID>634</OrgfieldID>
        </Orgfield>
        <Orgfield>
          <OrgfieldName>sostatus</OrgfieldName>
          <OrgfieldID>778</OrgfieldID>
        </Orgfield>
        <Orgfield>
          <OrgfieldName>_FromSO</OrgfieldName>  {this is a constant string}
          <OrgfieldID>CONST</OrgfieldID>
        </Orgfield>
        <delimiter>;</delimiter>
      </Orgfields>
    </field>

So the <fieldname> is the name of the field from the target module, then subsequent fields in this <field> set will be filled with the concatenated string using the delimiter. How de the constants work? Is this case only one. Are they PHP constants? Is there a list of these constances as a reference? Is the event automatically triggered by the name ({originalModule}2{TargetModule})?

Since I am also to investigate the GlobalVariable module some more (I just am too busy, still don't know what it does exactly, probably set global variables) I'd like to shine dome light on this:

PHP Code:
$cbMapid GlobalVariable::getVariable('BusinessMapping_SalesOrder2Invoice'cbMap::getMapIdByName('SalesOrder2Invoice'));
  if (
$cbMapid) {
    
$cbMap cbMap::getMapByID($cbMapid);
    
$focus->column_fields $cbMap->Mapping($so_focus->column_fields,$focus->column_fields);
  } else { 

So I create a global variable called BusinessMapping_{my_map_name} and paste in this code? I'm thinking a bit in loops here, probably my bad...
Reply


Messages In This Thread
Questions on Business Maps - Guido1982 - 07-04-2016, 06:17 PM
RE: Questions on Business Maps - joebordes - 07-18-2016, 10:45 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)