// Add the correct String to the End of the Filter //my code start IF (TableNo=25) THEN BEGIN//check if table is vendor ledger entry IF pUserID='ITISME' THEN//building the filter by checking the vMyFilter := 'some test' ELSE vMyFilter := 'another test'; SupportFunctions.GetFieldCaption(TableNo,50006,FieldName); SupportFunctions.BuildFilterString(FilterString,FilterType::Filter,FieldName,vMyFilter); END; END; //my code end SupportFunctions.BuildFilterString(FilterString,FilterType::AddEnd,'','');(my custom filed is the 50006 at the GetFieldCaption above)
DecodeXML.FilterRecord(XMLDocLineFilters,TableNo,LineRecordRef,UserID);//the UserID ad the end
END ELSE BEGIN IF AddElement( XMLCurrNode,'FIELD', FormatFunctions.IntegerToText(EPConnHeadLine."Line Field No."),DocNameSpace,XMLNewChild) > 0 THEN EXIT; //my code starts here IF EPConnHeadLine."Line Field Default Value"='CM' THEN vTempFilter := FORMAT(CALCDATE('-1M',TODAY))+'..'+FORMAT(TODAY) ELSE IF EPConnHeadLine."Line Field Default Value"='CW' THEN vTempFilter := FORMAT(CALCDATE('-1W',TODAY))+'..'+FORMAT(TODAY) ELSE vTempFilter := EPConnHeadLine."Line Field Default Value"; //my code ends here IF AddElement( XMLCurrNode,'VALUE', //EPConnHeadLine."Line Field Default Value",//comment this line vTempFilter,//modified line by using the vTempFilter DocNameSpace,XMLNewChild) > 0 THEN EXIT; END; END; XMLCurrNode := XMLCurrNode.parentNode; // </FILTER> UNTIL EPConnHeadLine.NEXT = 0; END; XMLCurrNode := XMLCurrNode.parentNode; // </FILTERGROUP> END;(used a text var to build my text... )