[DataEventHandler(tableStr(CreditCardAuthTrans), DataEventType::Inserted)] public static void CreditCardAuthTrans_onInserted(Common sender, DataEventArgs e) { CreditCardAuthTrans creditCardAuthTrans = sender as CreditCardAuthTrans; MCRHoldCodeTrans holdCodeTrans; CustParameters custParameters; select custParameters where custParameters.DataAreaId == 'rev'; str declinedCCHoldCode = custParameters.revDeclinedCCOrderHoldCode; CreditCardProcessorStatus status = creditCardAuthTrans.ProcessorStatus; str salesId = creditCardAuthTrans.SalesId; if(creditCardAuthTrans.ProcessorStatus == CreditCardProcessorStatus::Declined) { ttsbegin; select forupdate holdCodeTrans; holdCodeTrans.initValue(); holdCodeTrans.InventRefId = creditCardAuthTrans.SalesId; holdCodeTrans.MCRHoldCode = declinedCCHoldCode; holdCodetrans.RetailInfocodeId = 'HoldCode'; holdCodeTrans.insert(); ttscommit; } }/// Idea 2: CoC on CreditCardAuthTrans.insert() public void insert() { MCRHoldCodeTrans holdCodeTrans; CustParameters custParameters; select custParameters where custParameters.DataAreaId == 'rev'; str declinedCCHoldCode = custParameters.revDeclinedCCOrderHoldCode; CreditCardProcessorStatus status = this.ProcessorStatus; str salesId = this.SalesId; if(this.ProcessorStatus == CreditCardProcessorStatus::Declined) { //ttsbegin; holdCodeTrans.InventRefId = this.SalesId; holdCodeTrans.MCRHoldCode = declinedCCHoldCode; holdCodetrans.RetailInfocodeId = 'HoldCode'; holdCodeTrans.insert(); //ttscommit; } next insert();/// Idea 3, event handler on inserting [DataEventHandler(tableStr(CreditCardAuthTrans), DataEventType::Inserting)] public static void CreditCardAuthTrans_onInserting(Common sender, DataEventArgs e) { CreditCardAuthTrans creditCardAuthTrans = sender as CreditCardAuthTrans; MCRHoldCodeTrans holdCodeTrans; CustParameters custParameters; select custParameters where custParameters.DataAreaId == 'rev'; str declinedCCHoldCode = custParameters.revDeclinedCCOrderHoldCode; CreditCardProcessorStatus status = creditCardAuthTrans.ProcessorStatus; str salesId = creditCardAuthTrans.SalesId; if(creditCardAuthTrans.ProcessorStatus == CreditCardProcessorStatus::Declined) { ttsbegin; select forupdate holdCodeTrans; holdCodeTrans.initValue(); holdCodeTrans.InventRefId = creditCardAuthTrans.SalesId; holdCodeTrans.MCRHoldCode = declinedCCHoldCode; holdCodetrans.RetailInfocodeId = 'HoldCode'; holdCodeTrans.insert(); ttscommit; } }
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156