3
0

Improve trigger condition imp/exp handling

This commit is contained in:
Denis Arh 2019-09-30 10:45:02 +02:00
parent 04ee38d9e3
commit 262d01f7af
5 changed files with 21 additions and 7 deletions

View File

@ -603,7 +603,8 @@ func expAutomation(ss automation.ScriptSet, tt automation.TriggerSet, mm types.M
switch t.Event {
case "beforeCreate", "beforeUpdate", "beforeDelete",
"afterCreate", "afterUpdate", "afterDelete":
"afterCreate", "afterUpdate", "afterDelete",
"manual":
moduleID := t.Uint64Condition()
if moduleID == 0 {

View File

@ -151,7 +151,8 @@ func (asImp *AutomationScript) castTriggers(handle string, script *automation.Sc
return tt, deinterfacer.Each(def, func(n int, _ string, def interface{}) (err error) {
t = &automation.Trigger{
Enabled: true,
Enabled: true,
Condition: "0",
}
err = deinterfacer.Each(def, func(_ int, key string, val interface{}) (err error) {
@ -198,7 +199,6 @@ func (asImp *AutomationScript) Store(ctx context.Context, k automationScriptKeep
return
}
//return asImp.set.Walk(func(s *automation.Script) (err error)
for _, s := range asImp.set {
var name = s.Name

View File

@ -5978,8 +5978,6 @@ modules:
ActivityDate:
label: Due Date
kind: DateTime
required: true
multi: true
CallDisposition:
label: Call Result
kind: String

View File

@ -103,6 +103,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Account
resource: compose:record
CaseInsertCaseNumber:
source: |-
@ -177,6 +178,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Case
resource: compose:record
ContactSetRecordLabel:
source: |-
@ -336,6 +338,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Quote
resource: compose:record
SolutionInsertSolutionNumber:
source: |-
@ -446,6 +449,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Account
resource: compose:record
CaseSetStatusToWorking:
source: |-
@ -477,6 +481,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Case
resource: compose:record
CaseSetStatusToClosed:
source: |-
@ -611,6 +616,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Case
resource: compose:record
AccountCreateNewCase:
source: |-
@ -702,6 +708,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Account
resource: compose:record
ContactCreateNewCase:
source: |-
@ -769,6 +776,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Contact
resource: compose:record
LeadConvertLeadIntoAccount:
source: |-
@ -891,6 +899,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Lead
resource: compose:record
LeadConvertLeadToAccountAndOpportunity:
source: |-
@ -1076,6 +1085,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Lead
resource: compose:record
QuoteSendQuoteToCustomEmail:
source: |-
@ -1194,6 +1204,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Quote
resource: compose:record
QuoteSendQuoteToPrimaryContact:
source: |-
@ -1312,6 +1323,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Quote
resource: compose:record
QuoteSubmitQuoteForApproval:
source: |-
@ -1354,6 +1366,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Quote
resource: compose:record
OpportunityGenerateNewQuote:
source: |-
@ -1618,6 +1631,7 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Opportunity
resource: compose:record
QuoteUpdateTotalPrice:
source: |-
@ -1664,7 +1678,7 @@ scripts:
enabled: true
timeout: 0
triggers:
- event: afterUpdate
- event: beforeUpdate
module: Quote
resource: compose:record
OpportunityApplyPriceBook:
@ -1820,4 +1834,5 @@ scripts:
timeout: 0
triggers:
- event: manual
module: Opportunity
resource: compose:record

File diff suppressed because one or more lines are too long