CoreBOSBB
[ solved ] user case | lead transfer to another salesman - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Support (https://discussions.corebos.org/forumdisplay.php?fid=17)
+--- Forum: Administrator Support (https://discussions.corebos.org/forumdisplay.php?fid=8)
+--- Thread: [ solved ] user case | lead transfer to another salesman (/showthread.php?tid=1739)



[ solved ] user case | lead transfer to another salesman - rslemer - 03-20-2020

I have this situation


Leads were received in coreBOS by marketing automation (integration with another system, in the cloud)

Any salesperson can obtain this lead, as long as they convert to their user to start a negotiation, creating the contact and the opportunity

Solution:

Create a business map to check some fields and alert the seller to change the user to his (thus define that he is working with that lead)

first BM
type validations
PHP Code:
<map>
<
originmodule>
<
originnameleads </originname>
</
originmodule>
<
fields>
<
field>
<
fieldnameleadsource </fieldname>
<
validations>
<
validation>
<
rulenotIn </rule>
<
restrictions>
<
restriction> --None-- </restriction>
</
restrictions>
</
validation>
</
validations>
</
field>
<
field>
<
fieldnamemobile </fieldname>
<
validations>
<
validation>
<
rulelengthMin </rule>
<
restrictions>
<
restriction10 </restriction>
</
restrictions>
</
validation>
</
validations>
</
field>
<
field>
<
fieldnamephone </fieldname>
<
validations>
<
validation>
<
rulelengthMin </rule>
<
restrictions>
<
restriction10 </restriction>
</
restrictions>
<
message> {fieldincomplete </message>
</
validation>
</
validations>
</
field>
<
field>
<
field nameassigned userid </ field name>
<
validations>
<
validation>
<
ruleexpression </rule>
<
restrictions>
<
restrictionBusinessMap_IdUserActive </restriction>
</
restrictions>
</
validation>
</
validations>
</
field>
</
fields>
</
map

checks if the lead source, phone number and cell number are correct to successfully contact

So far, everything is fine.

This BP needs to call another BM (BusinessMap_IdUserActive) to check if the user is already assigned to it (does this by checking if the user registered in the lead is the same user logged in)

This is my problem
I can't find the correct syntax

PHP Code:
<map>
<
expression> if assign_user_id! = substring (getCurrentUserID (), 3then 'true' else 'false' end </expression>
</
map

something wrong with this second BP system as it does not return false, even when users are different

How can I solve this?


RE: user case | lead transfer to another salesman - joebordes - 03-20-2020

the expression is incorrect. I suggest you create it in the workflow editor and evaluate it there. In the editor you will be able to select the field so you will get the correct format and there is an example in the popup help where you can see the format of the "if": it has to end in "end"

The validation business map will probably not understand 'true' and 'false', they are both TRUE because they are just strings: use 0 and 1


RE: user case | lead transfer to another salesman - rslemer - 03-20-2020

Got it !

PHP Code:
<map>
 <
expression>if assigned_user_id == (substring (getCurrentUserID (), 3)) then 1 else 0 end</expression>
 </
map


now works,

thanks!