Forum Discussion
WillVitale
3 years agoContributor II
Amount and Annotation Confirmation Rule
Hello, I'm trying to create a confirmation rule that looks if these two accounts have a difference of 10k USD or more and if so it looks to see if it has a comment (annotation) made by our user and ...
- 3 years ago
Hi WillVitale ,
This will return the cell text Annotation - update with your respective POV:
stringAnnot = api.Data.GetDataCellEx("Cb#GolfStream:E#" + WFEntity + ":C#USD:V#Annotation:A#Account:F#Flow:O#Forms:I#None:U1#None:U2#None:U3#None:U4#None:U5#None:U6#None:U7#None:U8#None").DataCellAnnotation
You can then do
If ResultCellEx.DataCellAnnotation.Length < 1 Then
MikeG
3 years agoContributor III
Hi WillVitale ,
This will return the cell text Annotation - update with your respective POV:
stringAnnot = api.Data.GetDataCellEx("Cb#GolfStream:E#" + WFEntity + ":C#USD:V#Annotation:A#Account:F#Flow:O#Forms:I#None:U1#None:U2#None:U3#None:U4#None:U5#None:U6#None:U7#None:U8#None").DataCellAnnotation
You can then do
If ResultCellEx.DataCellAnnotation.Length < 1 Then
- WillVitale3 years agoContributor II
Just to make sure. Can I added to the original code I have above? I need it be both if the amount is greater than 10k usd and has no annotation to cause an error.
- MikeG3 years agoContributor III
I would re-write it so you have a set of condition statements that will advise the user on the range and the Annotation status. You can combine the condition statements it would be something like this:
If (System.Math.Abs(args.ConfirmationRuleArgs.DisplayValue) > 10000) AND (ResultCellEx.DataCellAnnotation.Length < 1) Then 'Range greater than 10,000 And No Annotation entered- WillVitale3 years agoContributor II
So something like this? Sorry, very new to OS, sorry for asking lots of questions.
args.ConfirmationRuleArgs.DisplayValue = math.Round(api.Data.GetDataCell("A#Bad_Debt_Comp:U1#Top1:U2#Top2:U3#Top3:U4#Top4:U5#Top5:U6#Top6:U7#USGAAP:F#TopFlow:O#Top:I#Top:C#USD").cellAmount, 2) If System.Math.Abs(args.ConfirmationRuleArgs.DisplayValue) > 10000 AND stringAnnot = api.Data.GetDataCellEx("E#" + WFEntity + ":C#USD:V#Annotation:A#0319:F#Flow:O#Top:I#Top:U1#Top1:U2#Top2:U3#Top3:U4#Top4:U5#Top5:U6#Top6:U7#USGAAP:U8#Top8").DataCellAnnotation(ResultCellEx.DataCellAnnotation.Length < 1) Then 'Range greater than 10,000 And No Annotation entered args.ConfirmationRuleArgs.Info1 = "Bad Debt USD = " & String.Format("{0:#,##0}",math.Round(api.Data.GetDataCell("A#0319:U1#Top1:U2#Top2:U3#Top3:U4#Top4:U5#Top5:U6#Top6:U7#USGAAP:F#TopFlow:O#Top:I#Top:C#USD").cellAmount, 0)) args.ConfirmationRuleArgs.Info2 = "CCM Bad Debt USD = " & String.Format("{0:#,##0}",math.Round(api.Data.GetDataCell("A#CCMBadDebt:U1#Top1:U2#Top2:U3#Top3:U4#Top4:U5#Top5:U6#Top6:U7#USGAAP:F#TopFlow:O#Top:I#Top:C#USD.cellAmount, 0)) 'args.ConfirmationRuleArgs.Info3 = "Out of BALANCE Check = " & String.Format("{0:#,##0}",math.Round(api.Data.GetDataCell("A#BALANCE:U1#Top1:U2#Top2:U3#Top3:U4#Top4:U5#Top5:U6#Top6:U7#USGAAP:F#TopFlow:O#Top:I#Top:C#USD").cellAmount, 0)) Return True Else args.ConfirmationRuleArgs.Info1 = "Bad Debt USD = " & String.Format("{0:#,##0}",math.Round(api.Data.GetDataCell("A#0319:U1#Top1:U2#Top2:U3#Top3:U4#Top4:U5#Top5:U6#Top6:U7#USGAAP:F#TopFlow:O#Top:I#Top:C#USD").cellAmount, 0)) args.ConfirmationRuleArgs.Info2 = "CCM Bad Debt USD = " & String.Format("{0:#,##0}",math.Round(api.Data.GetDataCell("A#CCMBadDebt:U1#Top1:U2#Top2:U3#Top3:U4#Top4:U5#Top5:U6#Top6:U7#USGAAP:F#TopFlow:O#Top:I#Top:C#USD).cellAmount, 0)) 'args.ConfirmationRuleArgs.Info3 = "Out of BALANCE Check = " & String.Format("{0:#,##0}",math.Round(api.Data.GetDataCell("A#BALANCE:U1#Top1:U2#Top2:U3#Top3:U4#Top4:U5#Top5:U6#Top6:U7#LOAD:F#TopFlow:O#Top:I#Top:C#USD").cellAmount, 0)) Return False End If
Related Content
- 2 years ago