Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Special Business Map for duplicates?
#1
Is there a special business map for duplicates? I'm being asked to handle the duplication of salesorders in a special way and I'd rather not hack...
Reply
#2
For duplicates , you can try creating a map with the name SalesOrder2SalesOrder and select Mapping type.
Reply
#3
Cool. Could I also collect a field from a related module this way? So when a salesorder is duplicated, collect the payment condition field from the account in stead of taking the source-SO payment condition?
Reply
#4
cbMaps support the workflow expressions, so you can use the same syntax to get fields values when you create an email task and select fields to compile the email.

For example from if need the Account Industry field from SalesOrder module, the syntax is: $(account_id : (Accounts) industry)

You can try the same but with you custom field. The easy way is trying to create an email task to SalesOrder module to obtain the expression that you need.

Try it, and tell us if work, please.
Reply
#5
I don't have much experience with workflow syntax but I'll try some thingsd and get back here. By the way, how do I contribute my Business Maps to the store?
Reply
#6
A small trick: I open a "send email" workflow task against the same module, then go to the body of the email and select the value I want from the picklist. Then you just have to copy and paste.

Either follow the instructions on the documentation project: https://github.com/tsolucio/coreBOSDocumentation

or just send it to us and we will upload it. As you prefer.
Joe
TSolucio
Reply
#7
Good tip, thanks.. I'll fork the documentation as soon as I can.
Reply
#8
I've setup a Business Map, but so far it's not working yet. The Business map name is "SalesOrder2SalesOrder", the target module is SalesOrder and the map is as follows:

Code:
<map>
<originmodule>
 <originid>22</originid>
 <originname>SalesOrder</originname>
</originmodule>
<targetmodule>
 <targetid>22</targetid>
 <targetname>SalesOrder</targetname>
</targetmodule>
<fields>
 <field>
   <fieldname>exact_payment_cond</fieldname>
   <fieldID>933</fieldID>
   <Orgfields>
     <Orgfield>
       <OrgfieldName>$(account_id : (Accounts) exact_payment_cond)</OrgfieldName>
       <OrgfieldID>932</OrgfieldID>
     </Orgfield>
    </Orgfields>
 </field>
</fields>
</map>

What am I doing wrong here?

It seems I've some error in my workflow expression. When I add this field to the Business Map:

Code:
<field>
    <fieldname>ship_street</fieldname>
    <Orgfields>
      <Orgfield>
        <OrgfieldName>$(account_id : (Accounts) ship_street)</OrgfieldName>
      </Orgfield>
     </Orgfields>
  </field>

It clears out the ship street on duplicating, rather than filling out the address from the account.
Reply
#9
The <OrgfieldID> directive is important:

<OrgfieldID>CONST</OrgfieldID>
means that the value is used exactly as you put it

<OrgfieldID>FIELD</OrgfieldID>
means that it has to processed as a field, either of the module or of one of it's directly related one (this is what you need)

<OrgfieldID>EXPRESSION</OrgfieldID>
the value must be passed through the workflow expression parser/engine

<OrgfieldID>TEMPLATE</OrgfieldID>
It is like the email body with static parts and variables, it is a simple way to avoid having to concatenate all the strings and variables
Joe
TSolucio
Reply
#10
Ah, makes sense. I'll try and get back to you.

Works like a charm. Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)