Hello Everyone, I have written a code for blocking sales bill if party outstanding exceeds credit days, also i have added a new field in ledger master for selecting block credit days. Now i want to add that it should block only if the field added in ledger master is set to yes if it is No then it should not block.. Pls Guide.. Code is as below [#Field: EI Consignee] Control : CtrlCreditDays : @@ChkCreditDays>0 and $$InCreateMode and $$IsSales:##SVVoucherType [Collection: Credit PartyPending Bills] Type : Bills Child of : #EIConsignee Unique : $$Name Format : @@DateDiff Format : $BillDate, 8 : Universal Date Format : $$Name, 10 Format : $BaseClosing,-30 : "AllSymbols, DrCr" Format : @@DueDate Format : ##SVCurrentDate Filter : FltrCreditDays, FltrCrAmt [System : Formula] CtrlCreditDays : if @@ChkCreditDays = 1 then "The Customer has " + $$NewLine + $$String@ChkCreditDays + $$NewLine + " Bill OverDue." else "The Customer has " + $$NewLine + $$String@ChkCreditDays + $$NewLine + " Bills OverDue." ChkCreditDays : $$Numitems:CreditPartyPendingBills FltrCreditDays : $$Number@DateDiff>=1 DueDate : $$Date:$$String:$BillCreditPeriod:UniversalDate DateDiff : ##SVCurrentDate - @@DueDate FltrCrAmt : $$IsDr:$BaseClosing [#Part:Led Contact] Add:Lines:Block Credit Days [Line:Block Credit Days] Field:Medium Prompt, Block Credit Days Local:Field:Medium Prompt:Set as:"Block Credit Days?" [Field:Block Credit Days] Use:Logical Field Storageays [System:UDF] Days:Logical:53633