Skip to content
Snippets Groups Projects
Commit df898d6f authored by David Büchler's avatar David Büchler
Browse files

Fixed bug where campaign lookup was readonly when adding participant via person preview

The current step gets pre filled if a participant is added on campaignstep level
parent bdbb687a
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,6 @@
<mandatory v="true" />
<state>EDITABLE</state>
<displayValueProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/campaignstep_id/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/CampaignParticipant_entity/entityfields/campaignstep_id/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
......
import("system.neon");
import("system.result");
import("system.vars");
import("system.logging");
if(vars.exists("$param.CampaignId_param") && vars.get("$param.CampaignId_param") != "")
if(vars.exists("$param.CampaignId_param") && vars.get("$param.CampaignId_param") != null)
result.string(neon.COMPONENTSTATE_READONLY);
else
result.string(neon.COMPONENTSTATE_EDITABLE);
\ No newline at end of file
......@@ -5,5 +5,10 @@ import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW &&
vars.exists("$param.CampaignId_param") && vars.get("$param.CampaignId_param"))
{
//todo
//Has to be set here because of a bug which prevents loading of the param in the value process
if(vars.exists("$param.CampaignStepId_param") && vars.get("$param.CampaignStepId_param"))
neon.setFieldValue("$field.CAMPAIGNSTEP_ID", vars.get("$param.CampaignStepId_param"));
result.string(vars.get("$param.CampaignId_param"));
}
\ No newline at end of file
import("system.logging");
import("Campaign_lib");
import("system.vars");
import("system.db");
import("system.result");
logging.log("campaignstep_idim displayvalue -> " + vars.get("$field.CAMPAIGNSTEP_ID"));
result.string(db.cell("select NAME from CAMPAIGNSTEP where CAMPAIGNSTEPID = '" + vars.get("$field.CAMPAIGNSTEP_ID") + "'"));
\ No newline at end of file
result.string(CampaignUtils.getCampaignStepNameById(vars.get("$field.CAMPAIGNSTEP_ID")));
\ No newline at end of file
import("system.vars");
import("system.logging");
logging.log("campaignstep_id im onValueChange -> " + vars.get("$field.CAMPAIGNSTEP_ID"));
\ No newline at end of file
......@@ -2,7 +2,7 @@ import("system.db");
import("system.vars");
import("Sql_lib");
var currentId = vars.getString("$field.SALESPROJECTID");
var currentId = vars.getString("$field.CAMPAIGNID");
if (currentId)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment